How do I withdraw tokens to my on-chain account?
Withdrawal without closing
The ideal scenario is to withdraw without closing, in which case both parties need to be online to sign the withdrawal request in the backend. The withdrawal happens in a 3-step on-chain process.
Alice has an open Raiden channel with Bob on the Raiden Light Client dApp, which is connected to her Metamask account. Her token balance is 55 DAI. The value she holds based on the current token price is approximately $55. The gas price used throughout this example is 85 gwei at an ETH price of $3,400.
1. Initial withdrawal from the channel into the Raiden account
The first step is to withdraw the tokens from your channel into your Raiden account using the upward arrow in the respective channel. The withdrawal tx is happening on-chain to verify the accuracy of the channel balance. This requires a rough 104,000 gas, which at the current price of 85 gwei, represents an amount of approximately $30.
These tx costs are directly deducted from Alice’s Metamask account. At this stage, the tokens are withdrawn from her channel into her Raiden account.
2. Send ETH to the Raiden account to cover the token transfer fees
Before initiating the transfer of her tokens from the Raiden account into her Metamask account, she needs to send some ETH to her Raiden account to fuel the token transfer happening on-chain. Transferring DAI requires 36,000 gas. Therefore, she needs to transfer 0.00306 ETH (roughly $11) to her Raiden account.
Additionally, sending ETH to has a standard tx cost of 21,000 gas. It represents around $6 automatically deducted from her Metamask account.
3. Transfer tokens from the Raiden account into the Metamask account
Alice can now finally transfer her DAI to her Metamask account by clicking on the ‘Withdraw Tokens’ section in her ‘Account’ settings.
This tx will use up the previously transferred 0.00306 ETH and after validation, she will now be able to see her DAI in on Metamask.
All in all, transferring her DAI from Raiden to her Metamask account has cost Alice roughly 47$. If she was holding a total value of DAI equal or lower than $47 she would have refrained from any action as the withdrawal would not be worth it.
If you are using the Raiden Python client with the WebUI
In this case, you can click on the menu of your channel, which will show you the withdrawal and closing options. The total withdrawal would directly transfer your tokens to your on-chain account.
If you still want to close and settle your channel, you simply select ‘Close Channel’, which closes, and initiates the settlement and token transfer to your wallet after the maximum 3 hour time-out.
Withdrawing RDN tokens from the UDC into your Metamask account
If you have RDN tokens in the UDC contract, you can withdraw them in a similar 3-step process, as described above or via Etherscan. Make sure the value of the withdrawn token is higher than the on-chain transaction costs before proceeding.
- Clicking on the ‘Manage UDC Token’ section in your ‘Account’ settings will initiate the process and communicate to the network that you plan on withdrawing those RDN tokens. This is an on-chain tx (#27), which needs a certain amount of gas fees deducted from your Metamask account.
After this tx is complete, you will be able to see your remaining unused RDN tokens in your Raiden account.
2. Before transferring the RDN tokens to your Metamask account, make sure you have enough ETH in your Raiden account to cover the tx costs of sending RDN to your Metamask account. (approximately 36,000 gas)
3. Once you have the ETH in your account, initiate the withdrawal (#28). The related tx fees will be deducted from your Metamask account.
We know the process is not straightforward yet, but it is going to improve in the near future. Do not hesitate to reach out for any support or remaining questions. We’re happy to help!
Do you need more information?
Here’s the documentation about the Python client and the Light Client.
Do you need additional support?
Contact us via Gitter!
Do not forget to join our communities on Twitter and Telegram.
The Raiden project is led by brainbot labs Est.
Disclaimer: Please note, that even though we do our best to ensure the quality and accuracy of the information provided, this publication may contain views and opinions, errors and omissions for which the content creator(s) and any represented organization cannot be held liable. The wording and concepts regarding financial terminology (e.g. “payments”, “checks”, “currency”, “transfer” [of value]) are exclusively used in an exemplary way to describe technological principles and do not necessarily conform to the real world or legal equivalents of these terms and concepts.