open-runtime-module-library
open-runtime-module-library copied to clipboard
Transfer KSM from Parachain A to Statemine
I have been wondering if we can use XTokens to transfer assets to Statemine directly assuming the channel is open, this will save on transfer fees
At the moment I was able to transfer KSM to the relay chain using XTransfer to the Parent/Relay chain and then teleport the KSM to Statemine
I wonder if it's possible to simplify that by sending a message to the relay chain to teleport the asset and then burn the asset on chain?
Obviously this only works if teleport works between the chains and a level of trust is already established. But since its already there for Statemine, It should be possible right?
Current using XToken to transfer KSM from parachain to Statemine, is like the kind of NonReserve case, and it works already, I add a testcase in: https://github.com/AcalaNetwork/Acala/pull/2097
Although the xcm send from parachain first go to relaychain, then to Statemine, but the second xcm is use reserve instead of teleport.
Thanks I'll have a look at your test
That said, using teleport is going to be far more cost effective than relay to statemine right?
Can we perhaps change the logic in Xtokens so that we
- Withdraw/burn asset from reserve account
- Notify relay to teleport assets to relay instead of reserve?
I think it'll be better to add a new dispatch call for this case which use teleport. All the XTokens currently is using reserve model.
No worries it sounds like you are supportive of the idea?
As soon as I have some time I'll start with a failing test so we define the interface and then we can go from there
@zqhxuyuan doesn't this PR https://github.com/paritytech/cumulus/pull/1318 mean that the dispatchable with teleport is really needed now ?
@zqhxuyuan doesn't this PR paritytech/cumulus#1318 mean that the dispatchable with teleport is really needed now ?
Yes, Indeed! This PR https://github.com/open-web3-stack/open-runtime-module-library/pull/785 support teleport but only for NonReserve case.