2

XCM version: 3

I have two ways of expressing an ethereum address via "MultiLocation", but don't know which is correct, or both are wrong?

Option 1: First locate the Ethereum network, and then locate the account address. Requires 2 Junction.

let eth_net:Junction = NetworkId::EthereumFoundation.into();
let address:Junction = account_key_20.into();
let location1:MultiLocation = X2(eth_net, address).into();

Option 2: Directly locate the account address in the Ethereum network with 1 Junction

let location2:MultiLocation = X1(Junction::AccountKey20 {
    network: Option::from(EthereumFoundation),
    key: account_key_20
}).into();

When I print location1 and location2 they look like this. Which way should I use? Why?

location1: MultiLocation { parents: 0, interior: X2(GlobalConsensus(EthereumFoundation), AccountKey20 { network: None, key: [...] }) }

location2: MultiLocation { parents: 0, interior: X1(AccountKey20 { network: Some(EthereumFoundation), key: [...] }) }

2 Answers 2

1

It is still too early to know how exactly we should specify an Ethereum account in a MultiLocation in XCM, since we still don't have a Polkadot-Ethereum bridge yet (or a Kusama-Ethereum bridge for the matter), because whichever choice you make to specify the location of an Ethereum account is entirely dependent on how the bridge is configured to interpret the MultiLocation.

That said, given what we already know with the format of MultiLocations sent to bridges, there are a couple of things that we need to know first before we can specify the MultiLocation of an Ethereum account -- firstly, what is the MultiLocation of your consensus system with respect to the relay chain? Assuming you are a parachain, then the MultiLocation of an Ethereum account could be specified with (Parent, Parent, EthereumFoundation, AccountKey20 { network: None, key: [..] }).into().

Again I must stress, we currently do not have a bridge to Ethereum, so anything MultiLocation we specify now is subject to change. Perhaps it's actually better if you tell us why you absolutely need to specify an Ethereum account right now for your application?

2
  • I see, thank you. This question should be discussed after we have the ethereum bridge. Right now I'm just learning, not in production yet.
    – Guantong
    Commented Apr 9, 2022 at 4:25
  • I also want to know the difference between them, please see here bro
    – Guantong
    Commented Apr 9, 2022 at 7:21
0

AFAIK xcm applies only to substrate based chains with same/similar consensus, for ethereum or btc bridge you may consider different solutions mentioned here

2
  • 1
    This is incorrect, the full form of XCM is Cross Consensus Messaging, which means it doesn't really matter which consensus system that the sender or receiver is in, as long as they understand the SCALE-encoded XCMs, then interoperability between consensus system is possible. Commented Apr 11, 2022 at 17:33
  • thanks for the clarification @KeithYeung
    – Ron
    Commented Apr 13, 2022 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.