4

My aim is to teleport an asset on parachain1 to parachain2. But I saw in parachain code, that teleport is disable. How do I enable it? I am confused about Teleport in XCM.

Basically, how do I make it work?

what is the path of teleport; (para->relay->para) or (para<->para)?

Does HRMP Channel opened between parachains works for teleport or something else should be done? How does HRMP channel affect teleportation of asset?

Does teleport works using Xtoken?

Please guide me through teleportation of asset between two parachains using XCM.

2 Answers 2

4

First check this old answer in StackExchange to see the difference between Asset Teleportation and via Reserve Asset Transfers.

You will be able to teleport between parachains, as long as they have a trusted relationship. If we take a look at Kusama runtime in the config of xcm_executor we see this line.

type IsTeleporter = TrustedTeleporters;

Where it specifices the parachains that have a trusted relationship (Statemine and Encointer):

    parameter_types! {
      pub const Ksm: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
      pub const Statemine: MultiLocation = Parachain(1000).into_location();
      pub const Encointer: MultiLocation = Parachain(1001).into_location();
      pub const KsmForStatemine: (MultiAssetFilter, MultiLocation) = (Ksm::get(), Statemine::get());
      pub const KsmForEncointer: (MultiAssetFilter, MultiLocation) = (Ksm::get(), Encointer::get());
      pub const MaxAssetsIntoHolding: u32 = 64;
  }
  pub type TrustedTeleporters =
    (xcm_builder::Case<KsmForStatemine>, xcm_builder::Case<KsmForEncointer>);

About the channels currently you need them. Check this old response in StackExchange.

All messages currently go through the Relay Chain using XCMP-lite (aka HRMP). Once XCMP is fully implemented, channels will indeed be directly between parachains, and they would use teleportation or reserve backed transfer depending on their trust relationship.

To teleport the asset, I recommend you to first check the tutorial Transfer assets with XCM to know how to set up the environment, is using Zombinet to set up a local test network to simulate a relay chain with validators and parachain collator nodes.

When you have it all running you have to execute the extrinsic limitedTeleportAsset from the pallet xcmPallet. In this extrinsic you have to specify the destination parachain, the beneficiary account (Account ID of the account you are teleporting the asset), the asset that is going to be teleported, the feeAssetItem and the weightLimit for the XCM fee purchase.

For a more detail guide check this workshop on Youtube Parity Technologies: XCM Workshop | Polkadot Decoded 2022 where it performs an asset teleportation and a reserve assettTransfer.

6
  • 2
    I have implemented this thing but in the second parachain, I got an event of untrusted teleport location. So, how should the untrusted teleport location be resolved? Jan 31, 2023 at 4:49
  • 1
    Do you have this line type IsTeleporter = TrustedTeleporters; where you define your parachain as one of the trusted teleports?
    – Alex Bean
    Jan 31, 2023 at 8:24
  • yes, I have this line Jan 31, 2023 at 10:14
  • with your Parachain defined there too? pub const Statemine: MultiLocation = Parachain(1000).into_location();
    – Alex Bean
    Jan 31, 2023 at 11:18
  • 3
    yes, I`ve defined it. It is showing UNTRUSTED TELEPORT LOCATION Feb 1, 2023 at 10:59
2

By default, Para-chains don't trust each other.But there are two ways that u can teleport the assets.

First, You need a sovereign account of your parachain in the relay chain and you need to use Transfer asset instruction in the fn send message .

Secondly, You can even send the assets through the fn teleport-assets, but parachains only trust the assets from sovereign account. You need to change the ensure here.

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.