Introduce Tinkernet multisig XCM configs to Kintsugi#1120
Introduce Tinkernet multisig XCM configs to Kintsugi#1120arrudagates wants to merge 4 commits intointerlay:masterfrom
Conversation
|
I'm reluctant to introduce another third-party dependency, @arrudagates is there anyway to accomplish what you want without adding |
Yes, these are very simple MultiLocation to AccountId and MultiLocation to Origin converters, they can be directly added to the runtime in less than 100 lines. I'll proceed that way if you prefer, just let me know where you would rather the configs live, if at a specific primitives crate, a specific file/module in the runtime, or directly in the xcm_config.rs file. |
|
I think |
Done! Please let me know if you have any suggestions for changes. |
|
Hey @gregdhill, any update on this? |
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 theTransactlessset 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
TransactXCM instruction and thus call extrinsics in the Kintsugi runtime's pallets.