Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method in xcm pallet to transfer DOT/KSM from system parachain to other parachain #676

Closed
xlc opened this issue Mar 29, 2023 · 8 comments
Closed

Comments

@xlc
Copy link
Contributor

xlc commented Mar 29, 2023

To correctly transfer DOT on Statemint to other parachain, it needs to teleport the DOT to relay and reserve transfer to dest chain.
We should have a method to do that.
There should also be a method to do the reverse direction. Reserve transfer DOT back to relay and teleport to Statemint.

@KiChjang
Copy link
Contributor

KiChjang commented Mar 29, 2023

AIUI reserve transfer back to the reserve is not quite possible, as we can't predict exactly how a chain decides to execute InitiateReserveWithdraw, in particular how exactly they perform bookkeeping of their reserve assets in their own chain. I suppose we could accept an extra config item in the XCM pallet that details exactly how reserve asset transfers back to the reserve should work.
Also, I believe the relay chain is not meant to be the reserve in the long run -- ideally the asset parachains will be the place where all asset-related stuff will be handled.

@xlc
Copy link
Contributor Author

xlc commented Mar 29, 2023

I guess we don't have to have those logics in xcmPallet but Statemint/e will need the logic to transfer relay token to other parachains. The transfer to Statemint/e could be implemented in xtokens.

I don't know what's the timeframe you have in mind to make the asset parachain to be the reserve of DOT/KSM but there are a lot of work needs to be done first. e.g. move mint/burn logic off relaychain

Without a migration plan, I will simply assume this won't happen in the next 6 months.

@joepetrowski
Copy link
Contributor

I don't know what's the timeframe you have in mind to make the asset parachain to be the reserve of DOT/KSM but there are a lot of work needs to be done first. e.g. move mint/burn logic off relaychain

It requires the ability to do governance and staking from the assets parachain first, but we are starting work specifically on that. I doubt it will be in production in 6 months but probably 12.

@joepetrowski
Copy link
Contributor

I don't agree that this should have a specific method. XCM doesn't know how each parachain handles reserve transfers or the Relay token. But XCM is a scripting language so you can write your own scripts and put them behind an extrinsic on your chain.

I do agree that we should have more documentation, tutorials, and examples about how to write small scripts like this, but its up to parachain developers to learn XCM and use it correctly in the context of their chains.

@xlc
Copy link
Contributor Author

xlc commented Mar 29, 2023

Ok. I guess let’s make this a documentation/example/integration test issue. Feel free to move this to the right repo if this isn’t the one.

@KiChjang
Copy link
Contributor

Sorry, I've misread the issue details -- I thought that we wanted to have an extrinsic for a parachain to reserve transfer any token to any non-reserve, non-relay chain. This is already solved by xTokens in fact, via the transfer_to_non_reserve function.

I agree with Joe here. We shouldn't need an extrinsic for the use case mentioned in the issue description, especially when we want to discourage using the relay chain as the reserve for DOT/KSM. In general, the workflow is also quite customized (reserve transfer -> teleport, or teleport -> reserve transfer), so it really should be left for parachain developers to write the XCM correctly for their use cases.

@xlc
Copy link
Contributor Author

xlc commented Mar 29, 2023

This isn't had much to do with other parachains. I am asking have this extrinsic in Statemint.

Apparently paritytech/cumulus#2398 works but it ain't making sense to me.

I can see why you want to discourage using the relay chain as the reserve. But you can't do it without a proper plan. It is a huge footgun for anyone thinking about doing it at this stage.

@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
claravanstaden pushed a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
@xlc
Copy link
Contributor Author

xlc commented Feb 28, 2024

I think this is fixed

@xlc xlc closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants