Introduce Tinkernet multisig XCM configs to Kintsugi #1120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the XCM configs necessary to allow Tinkernet multisigs to transact on Kintsugi.
Tinkernet multisigs have the following MultiLocation pattern:
The following are the configs added by this PR to give the multisigs accounts and origins in Kintsugi:
In Barrier
This is a barrier from the official xcm-builder crate that computes descended origins and by using
AllowTopLevelPaidExecution<TinkernetMultisigMultiLocation>>
within it allows for our multisig XCM messages to pass through. This is added outside of theTransactless
set of barriers, as the goal is to allow these multisigs to transact within the runtime (when properly paying for the transaction fee).In LocationToAccountId
This MultiLocation converter derives an AccountId for locations matching the one described above, it does so by using the same exact derivation function used in Tinkernet, this is important to make sure the multisigs maintain the same address across all chains, providing the best UX possible.
Because this derivation happens in Kintsugi, it means the whole process is trustless and removes any possibility of account impersonation!
In XcmOriginToTransactDispatchOrigin
Same as explained above, except here we need to derive the AccountId and wrap it with a RawOrigin::Signed origin so this account can use the
Transact
XCM instruction and thus call extrinsics in the Kintsugi runtime's pallets.