Cross chain assets are native Substrate assets that can be transferred between a parachain and the relay chain, or other parachains that are connected to the same relay chain. The first cross chain asset supported on Moonriver is KSM (Kusama). To differentiate cross chain assets, Moonbeam has introduced the concept of XC-20s. This tutorial covers the handling of XC-20 cross chanin assets on Moonriver testnet.

This article was originally published by Moonbeam.


XC-20s are cross chain assets that have an ERC-20 token interface. Consequently, users can interact with XC-20s as they would with other fungible tokens, for example, add them to MetaMask and create liquidity pools in DEXs. All XC-20s will have xc prepended to their name. For example, Kusama’s KSM representation on Moonriver is known as xcKSM.

For more information you can check out the Moonbeam documentation pages on XCM and XC-20s.

Get Started with the Dashboard

To get started with the dashboard, navigate to apps.moonbeam.network/moonriver. MetaMask will pop up and ask you to sign in. Once signed in, you will be prompted to select the account to connect to the dApp and accept permissions.

You will also need to connect MetaMask to Moonriver. The dApp will help you switch to the right network, but if you need help, please check out our documentation on connecting MetaMask to Moonriver.

Upon accepting permissions and changing the network to Moonbeam, you will be redirected to the main dashboard where you’ll find details about your accounts balance, last transactions, crowdloan rewards data, cross chain assets (XC-20s), and staking data.

Add XC-20s to MetaMask

Throughout this guide you’ll be interacting with the xcKSM token, but you can follow the same steps for any other XC-20 that is supported. Make sure you are connected to the MetaMask account where you want to receive xcKSM tokens. If so, the first step will be to add the token to your MetaMask:

  1. In the row for xcKSM, click on add to metamask.
  2. MetaMask will pop-up and prompt you to add the token. Click on Add Token.

To verify that the token was added successfully, you can open up MetaMask and switch to the Assets tab. From there you should see xcKSM in the list of assets.

Deposit XC-20s

To transfer assets from their origin network to Moonriver, you can use the deposit feature on the Moonbeam dApp.

In order to deposit some xcKSM tokens, make sure that your Kusama account is connected to the Polkadot.js extension and has some KSM tokens available to transfer to Moonriver. Transaction fees will be paid on the destination chain and deducted from the total amount transferred. In this case the fees are paid on Moonriver in xcKSM.

In the row for xcKSM, click on deposit. You will be prompted to connect the dApp to the Polkadot.js extension:

  1. Click Connect.
  2. The Polkadot.js extension will pop-up and request access to the site. Make sure that the URL requesting access is https://apps.moonbeam.network/moonriver. If so, click on Yes, allow this application access.

Once you’ve connected the Polkadot.js extension to the dApp, open up the MetaMask extension and make sure you’re connected to the Moonriver account where you would like to receive the xcKSM tokens.

Next, you can start to fill out the deposit information to transfer KSM to Moonriver:

  1. Make sure the Kusama Relay chain is selected.
  2. Select the Kusama Relay Address to transfer KSMs from.
  3. In the Amount field, enter the amount of KSMs you would like to transfer. Please note that there is a minimum amount listed.
  4. Verify that the account listed is your Moonriver account where you would like to receive the xcKSM tokens.
  5. Review the transaction details and if everything looks correct, click Send.

The Polkadot.js extension will pop-up and ask you to confirm the transaction. Enter your password and click Sign the transaction. The transaction will be sent and your xcKSM balance will be displayed in the dApp. Keep in mind that the transaction fees will be deducted from your xcKSM balance.

You can check that your KSM balance has decreased by using Polkadot.js apps or a block explorer such as Subscan.

Congratulations! You have successfully sent KSM to Moonriver and can now interact with the xcKSM tokens like you typically would with ERC-20 tokens on Moonriver.

Send XC-20s within Moonriver

Since you have already added the xcKSM token to MetaMask, you can start interacting with it as you would with any ERC-20 token. For example, to send xcKSM to another Moonriver account, you can follow these steps:

  1. Open MetaMask and from the Assets tab click on the xcKSM asset.
  2. Click on Send.
  3. Choose an account to send the xcKSM to.=
  4. Enter the amount of xcKSM to send.
  5. Review the transaction details and click Confirm to send the transaction.

You should see that your xcKSM displayed balance on the dApp has decreased and the transaction is listed under the Activity tab in MetaMask. The recipient will need to add the xcKSM token to their MetaMask and then they can feel free to send xcKSM around the Moonriver network, or withdraw it and convert it back to KSM on the Kusama Relay Chain.

Withdraw XC-20s

To transfer assets out of Moonriver and back to their origin network, you can use the withdraw feature on the Moonbeam dApp.

To withdraw xcKSM tokens from Moonriver back to Kusama, make sure that your MetaMask account that holds the xcKSM is connected. Transaction fees will be paid on the destination chain and deducted from the total amount transferred. In this case the fees are paid on Kusama in KSM.

In the row for xcKSM, click on withdraw. Next, you can start to fill out the withdrawal information to transfer and convert the xcKSM to Kusama:

  1. Select Kusama as the Destination Chain.
  2. In the Amount field, enter the amount of xcKSMs you would like to transfer. Please note that there is a minimum amount listed. Tip: if you would like to send the max amount of xcKSMs back, you can enter an arbitrary amount that you know is larger than your balance and it will automatically default to the max.
  3. Verify that the account listed is your Moonriver account where you are transferring the xcKSM tokens from.
  4. Enter the destination address where you would like to send the KSM to on Kusama.
  5. Review the transaction details and if everything looks correct, click Send.

MetaMask will pop-up and you can review the transaction details and click Confirm.

Your balance displayed on the dApp for xcKSM will decrease. You can also check that the KSM balance for the destination address has increased by using Polkadot.js apps or a block explorer such as Subscan.

And that’s it! Congratulations! You have successfully sent KSM to Moonriver in exchange for xcKSM, and xcKSM back to Kusama in exchange for KSM.

About the author 

Radiostud.io Staff

Showcasing and curating a knowledge base of tech use cases from across the web.

TechForCXO Weekly Newsletter
TechForCXO Weekly Newsletter

TechForCXO - Our Newsletter Delivering Technology Use Case Insights Every Two Weeks

>