Let's look at these three MultiLocation
values, assuming we have a 32-byte account ID id
:
1. (Parent, AccountId32 { network: None, id }).into()
This is more idiomatic, but otherwise exactly equal to the first suggestion you made:
ParentThen(X1(AccountId32 { network: None, id })).into()
It means "the 32-byte account of identity id
as interpreted within the context of the parent's consensus system", with an extra note that id
(i.e. that 32-byte value) should not be considered associated with a particular network.
An example of using this would be when referring to a Relay-chain account from within a parachain's logic. The Parent
would take it "up" into the Relay-chain location and then the AccountId32
would bring it "down" into an account on it.
2. (Polkadot, AccountId32 { network: None, id }).into()
This is more idiomatic, but otherwise exactly equal to the second suggestion you made:
MultiLocation {
parents: 0,
interior: X2(
GlobalConsensus(Polkadot),
AccountId32 { network: None, id }
)
}
It means "the 32-byte account of identity id
as interpreted within the context of the Polkadot network which itself should be found within the local consensus system", with an extra note that id
(i.e. that 32-byte value) should not be considered associated with a particular network.
Since no real consensus system contains the Polkadot network, this location doesn't make any sense.
The corresponding value of type InteriorMultiLocation
is:
MultiLocation::from((Polkadot, AccountId32 { network: None, id }))
This does have a meaning: being an InteriorMultiLocation
it never contains Parent
s and thus is used to represent Universal locations, i.e. locations to be interpreted within the hypothetical Universal Consensus defined as the parent of all top-level consensus systems.
Used in this way, the value would refer to the account id
on the Polkadot Relay-chain, much like in the example for (1).
3. AccountId32 { network: Some(Polkadot), id }.into()
This is more idiomatic, but otherwise exactly equal to the third suggestion you made:
MultiLocation {
parents: 0,
interior: X1(
AccountId32 { network: Some(Polkadot), id }
)
}
This means "the 32-byte account of identity id
as interpreted within the context of the local consensus system", with an extra note that id
(i.e. that 32-byte value) should be considered strictly associated with the Polkadot network, as opposed to e.g. Kusama.
In general, specifying the network
in an AccountId32
is not done since there is rarely a need to make a strict association between a particular account and a network. Generally an account is considered "compatible" if the public key (i.e. id
) is the same length as account IDs on the local chain.