This is an updated version of the article that was originally published on January 14, 2022 and updated on March 9th, 2023. This new update includes changes to the Moonbeam dApp.
Cross chain assets are native Substrate assets that can be transferred between a parachainGo to page https://moonbeam.network/education/what-is-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 assetsGo to page https://moonbeam.network/blog/introducing-xc-20s/, Moonbeam has introduced the concept of XC-20s.Go to page https://moonbeam.network/blog/introducing-xc-20s/
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 XCMGo to page https://docs.moonbeam.network/builders/interoperability/xcm/overview/ and XC-20sGo to page https://docs.moonbeam.network/builders/interoperability/xcm/xc20/.
This guide will show you how to use the Moonbeam dAppGo to page https://apps.moonbeam.network/moonriver to transfer xcKSMs between Moonriver and the Kusama Relay Chain. This guide can be adapted for other XC-20s as they are onboarded to the network.
Get Started with the Dashboard
To get started with the dashboard, navigate to apps.moonbeam.network/moonriverGo to page https://apps.moonbeam.network/moonriver. Press Connect Wallet in the upper right corner. Click on your desired network if it isn’t already selected. Then click on the EVM wallet you’d like to use with the Moonbeam dApp. For the purposes of this guide, MetaMaskGo to page https://metamask.io/ will be used.
Your preferred EVM wallet 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 MoonriverGo to page https://docs.moonbeam.network/builders/get-started/networks/moonriver/#connect-metamask.
Upon accepting permissions and changing the network to Moonriver, you will be redirected to the main dashboard where you’ll find details about your accounts balance, last transactions, cross chain assets (XC-20s), and staking data.
Add XC-20s to your EVM Wallet
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 EVM account account where you want to receive xcKSM tokens. If so, the first step will be to add the token to your EVM wallet:
- Look for the asset labeled KSM. It may not be located on the first page
- Click on the kebab dropdown next to the KSM asset
- Press Add to Wallet
- Your EVM wallet will prompt you with a pop-up that you’ll need to confirm
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 Parachain Bridges feature on the Moonbeam dApp.
Prior to transferring assets from the Kusama Relay Chain, you’ll need to connect the account that holds your KSM to the Moonbeam dApp. To do so, take the following steps:
- Click the caret in the upper right corner
- Click Substrate wallet
- Click on the wallet that holds your KSM tokens
- Select the account that holds your KSM tokens from the dropdown
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.
Navigate to the Parachain Bridges page under Cross-Chain if you haven’t already, and take the following steps:
- Select the token you’d like to transfer. In this case, we’ve selected KSM
- Select the origin network, in this case it is Kusama
- Select the origin account that holds your KSM. The dApp indicates the sending account’s current balance of KSM
- Select the destination chain. In this case, we’ve selected Moonriver
- Select the recipient account. For your convenience, the dApp will indicate the receiving account’s current balance of xcKSM
- Enter the amount to send. There are minimum and maximum buttons to the right which will autofill the relevant amounts accounting for all fees
- Review the estimated amount that will be received and the corresponding fees. You do not need to enter anything here
- If everything looks good, press Send
The wallet that holds your KSM 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.
The Moonbeam dApp will let you know the status of the transaction and will display relevant metrics such as time to finality and overall cost. If you haven’t already added xcKSM to your EVM wallet you can do so now by clicking on the + icon next to MetaMask.
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 your EVM wallet, you can start interacting with it as you would with any ERC-20 token. For example, to send xcKSM using MetaMask to another Moonriver account, you can follow these steps:
- Open MetaMask and from the Assets tab click on the xcKSM asset
- Click on Send
- Choose an account to send the xcKSM to
- Enter the amount of xcKSM to send
- 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 Parachain Bridges feature on the Moonbeam dApp.
To withdraw xcKSM tokens from Moonriver back to Kusama, make sure that your EVM 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.
Navigate to the Parachain Bridges page under Cross-Chain if you haven’t already, and take the following steps:
- Select the token you’d like to transfer. In this case, we’ve selected KSM
- Select the origin network, in this case it is Moonriver
- Select the Moonriver account that holds your xcKSM. The dApp indicates the sending account’s current balance of xcKSM
- Select the destination chain. In this case, we’ve selected Kusama
- Select the recipient account. For your convenience, the dApp will indicate the receiving account’s current balance of KSM
- Enter the amount to send. There are minimum and maximum buttons to the right which will autofill the relevant amounts accounting for all fees
- Review the estimated receive amount and corresponding fees. You do not need to enter anything here
- If everything looks good, press Send
- Confirm the transaction in your EVM wallet
The Moonbeam dApp will let you know the status of the transaction and will display relevant metrics such as time to finality and overall cost. 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 appsGo to page https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/accounts or a block explorer such as SubscanGo to page https://kusama.subscan.io/.
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.