Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend or add Junction with signature #27

Closed
mustermeiszer opened this issue Jan 11, 2022 · 4 comments
Closed

Extend or add Junction with signature #27

mustermeiszer opened this issue Jan 11, 2022 · 4 comments

Comments

@mustermeiszer
Copy link

Currently, XCM does not support a way to prove ownership of an AccountId32 via a Junction. This leads to the need, that parachains need to trust the sender of an XCM that it has made proper checks of ownership when converting something like

let loc = Multilocation {
  parents: 1,
  interior: X2(Junction::Parachain(2), Junction::AccountId32{NetworkId::Any, id})
}

into either an Origin (e.g. in the Instructions::Transact) or an AccountId (e.g. in the AssetTransactor::* calls).

Adding both or one of the below could help here:

// Default that the signer signs the bytes of id 
Junction::SignedAccountId32{network: NetworkId, id: [u8; 32], sig: Option<[u8; 64]>} 

// Add explicit struct allowing to define costume messages to be signed
Junction::SignedWithMsgAccountId32{network: NetworkId, id: [u8; 32], verification: Option<Verification>} 

struct Verification {
    sig: [u8; 64],
    msg: [u8, 64], // Not sure how many bytes one should allow here. But making it an unbounded Vec seems like a bad idea
}
@dzmitry-lahoda
Copy link

Sounds interesting, I feel this lacking in XCM. So may be parity working on this?

What type of signature is used? various chains use different signature schemes? should it be enum variant somewhere?

Did you saw ORML remote chains XCM helper? Does it solves you problem?

@mustermeiszer
Copy link
Author

Sounds interesting, I feel this lacking in XCM. So may be parity working on this?

I don't think so. I think the current solution is to just derive secure accounts that have no privat keys on the remote chains.

Did you saw ORML remote chains XCM helper? Does it solves you problem?

Can you point me to it?

@dzmitry-lahoda
Copy link

yeah, derived accounts (utility so limited to 65k of these) or https://github.com/open-web3-stack/orml-xcm-builder/blob/master/kusama/src/tinkernet_multisigs.rs

@mustermeiszer
Copy link
Author

Closing as we are having remote account derivation now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants