Cross-chain assets are native substrate assets that can be transferred between a parachain and a relay chain or between other parachains connected to the same relay chain. The first cross-chain asset supported on Moonbeam is DOT (Polkadot).
To differentiate cross-chain assets, Moonbeam came up with the concept of XC-20s. XC-20s is a cross-chain asset with an ERC-20 token interface. As a result, users can interact with XC-20s the same way they would with other fungible tokens, such as adding them to MetaMask and creating liquidity pools in a DEX. All XC-20s will have xc added to their name. For example, Polkadot’s DOT representation on Moonbeam is called xcDOT.
This tutorial will show you how to use Moonbeam dApp to transfer xcDOT between Moonbeam and Polkadot relay chains. This guide can be adapted for other XC-20s as they are integrated into the network.
Get started with the Dashboard
To get started with Dashboard, visit apps.moonbeam.network/moonbeam. You can choose to connect your wallet via MetaMask or WalletConnect. This tutorial will use MetaMask. After you select MetaMask, the extension will pop up and ask you to sign in. Once logged in, you will be prompted to select an account to connect to the dApp and accept permissions.
You will also need to connect MetaMask to Moonbeam. The DApp will help you switch to the right network, or you can refer to this article for instructions on adding the Moonbeam network to Metamask wallet.
After accepting permission and switching to the Moonbeam network, you will be redirected to the Dashboard, where you will find information about your account balance, most recent transaction, crowdloan reward data, cross-chain assets (XC-20s), and staking data.
Adding XC-20s to MetaMask
In this tutorial, you will interact with the xcDOT token, but you can follow the same steps for any other supported XC-20. Make sure you are connected to the MetaMask account where you want to receive the xcDOT tokens. If so, the first step would be to add the token to your MetaMask:
- In the section for xcDOT, click Add to Metamask.
- MetaMask will pop up and prompt you to add the token. Click “Add Token.”
To verify that the token has been successfully added, you can open MetaMask and switch to the Assets tab. From there, you should see xcDOT in the list of assets.
Deposit XC-20s
To transfer assets from the native network to Moonbeam, you can use the deposit feature on the Moonbeam dApp.
To deposit some xcDOT tokens, make sure your Polkadot account is connected to Polkadot.js and has some DOT tokens available to transfer to Moonbeam. The transaction fee will be paid on the destination chain and deducted from the total amount transferred. In this case, the fee is paid on Moonbeam using xcDOT.
In the row for xcDOT, click deposit. You will be prompted to connect the dApp with the Polkadot.js extension:
- Click Connect.
- Polkadot.js will pop up and request access to the site. Make sure that the URL requesting access is https://apps.moonbeam.network/moonbeam. If so, click Yes, allow this application access.
After you have connected Polkadot.js to the dApp, open MetaMask and make sure you are connected to the Moonbeam account where you want to receive the xcDOT tokens.
Next, you can start filling in your deposit information to transfer KSM to Moonbeam:
- Make sure Polkadot is selected as the root chain.
- Select the Polkadot Address to transfer the DOTs.
- In the Amount field, enter the amount of DOT you want to transfer. Note that the deposit amount must be higher than the minimum transfer amount.
- Verify that the account is your Moonbeam account where you want to receive xcDOT tokens.
- Review the transaction details and if everything is correct, click Send.
Polkadot.js 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 xcDOT balance will be displayed in the dApp. Remember that transaction fees will be deducted from your xcDOT balance.
Congratulations! You have successfully sent DOT to Moonbeam and can now interact with xcDOT tokens just like you normally would with ERC-20 tokens on Moonbeam.
Sending XC-20s on Moonbeam
Once you’ve added the xcDOT token to MetaMask, you can start interacting with it as you would with any ERC-20 token. For example, to send xcDOT to another Moonbeam account, you can follow these steps:
- Open MetaMask and from the Asset tab, click on the xcDOT asset.
- Click Send.
- Select an account to send xcDOT to.
- Enter the amount of xcDOT to send.
- Review the transaction details and click Confirm to submit the transaction.
You should see that your xcDOT showing balance on the dApp has decreased and the transaction is listed under the Activity tab in MetaMask. Recipients will need to add xcDOT tokens to their MetaMask and then they can freely deposit xcDOT around the Moonbeam network or withdraw it and convert it back to DOT on Polkadot.
Withdraw XC-20s
To move assets out of Moonbeam and back to their native network, you can use the withdraw feature on the Moonbeam dApp.
To withdraw xcDOT tokens from Moonbeam back to Polkadot, make sure your MetaMask account containing xcDOT is connected. The transaction fee will be paid on the destination chain and deducted from the total amount transferred. In this case, the fee is paid on Polkadot in DOT.
In the section for xcDOT, click withdraw. Next, you can start filling out your withdrawal information to transfer and convert xcDOT to Polkadot:
- Select Polkadot as the destination chain.
- In the Amount field, enter the number of xcDOTs you want to transfer. Note that the deposit amount must be higher than the minimum transfer amount. Tip: if you want to deposit the maximum amount of xcDOT back, you can enter an arbitrary amount that you know is greater than your balance and it will automatically default to the maximum.
- Verify that the account shown is your Moonbeam account where you are transferring the xcDOT tokens.
- Enter the destination address you want to send the DOT to on Polkadot.
- Review the transaction details and if everything is correct, click Send.
The MetaMask will pop up and you can review the transaction details and click Confirm.
Your balance shown on the dApp for xcDOT will decrease. You can also check if the DOT balance for the destination address has increased using Polkadot.js or Subscan applications.
And that’s it! Congratulations! You have successfully sent DOT to Moonbeam in exchange for xcDOT and xcDOT back to Polkadot in exchange for DOT.
See ya in the next article !
Don’t forget to follow useful articles about Crypto Market from team Holding B !!!
- Telegram Channel: https://t.me/HoldingBcom
- Telegram Group: https://t.me/HoldingB
- Website: https://holdingb.com/
- Twitter: https://twitter.com/HoldingBcom
- Facebook: https://www.facebook.com/holdingbcom