7

Gavin Wood mentioned it here, assets are destroyed before the xcm message is sent.

Statemint trusts the Polkadot Relay Chain to have destroyed the 1 DOT on its side prior to sending the message. (It does!)

When teleporting assets from chain A to chain B, chain A destroyed the assets, but the XCM instructions execution failed

  1. Can the destroyed assets be recovered?

  2. If yes, how to recover? Is it by recasting?

  3. If it is by recasting, can NFT be recasted with the original ID?

Some documentation I've found (not related to XCM) shows that assets are locked when transferred across chains, not destroyed. I think if it is a locked asset, it is very easy to recover by unlocking, but here, it is destroyed rather than locked, destroyed and locked are not equal, right?

1
  • In some cases it's not possible to return the assets and rather than burning you can choose to do something else wtih them: github.com/paritytech/cumulus/blob/… - if you look at the last type here in statemine we are sending unreturnable funds to the staking pot ToStakingPot<Runtime>.
    – Squirrel
    Mar 31, 2022 at 16:20

1 Answer 1

13

In general, destroyed assets cannot be recovered, so it's crucial to preplan your XCM to actually work.

However there are two main fail-safe mechanisms that were introduced in XCMv2 which can help you to reduce the chance of asset loss.

Error handling

There is a new instruction SetErrorHandler which allows you to nominate a piece of code to execute if and only if an error occurs. This could be used to refund any unused assets sitting in the Holding Register, in case, e.g. a TeleportAssets instruction failed on the sending side.

Asset Trapping

Sometimes when an error happens, there is no obvious way to handle it and refund the assets safely. This might be for example because your code is executing on a remote chain and you lack the resources to teleport them back again.

For this we have Asset Traps. Asset Traps are a feature which the executing chain itself can enable for certain assets (via the XcmConfig::AssetTrap type item) it believes valuable enough. It ensures assets which are left in the Holding Register after execution is over are retained on-chain for some later time when they can be claimed by the origin of the message.

1
  • Thanks, this is very helpful!
    – Guantong
    Apr 1, 2022 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.