Shielding & Unshielding
Send tokens in and out of a 0zk address
The first step in using the RAILGUN privacy system is the Shielding of funds from a public 0x address to a private 0zk address.
Once in a 0zk address, your funds are completely sealed from public view and no one can see what you do or what you hold. To read more about how RAILGUN privacy works, check out this article.
From a 0zk address, users can send, swap, and interact with DeFi privately. Further, any ERC-20 token can be Shielded into a 0zk address.
- 1.Click the token you would like to Shield. It's recommended to first Shield the networks base token or stablecoins like DAI or USDC to pay Relayer fees for private transactions.
- 2.From here you can easily send Public transactions, view your address/receive QR code, and Shield tokens into Railgun. Click "Shield" to continue.
- 3.RAILGUN supports Shielding to any 0zk address. Copy and paste a 0zk address into the highlighted box OR click "Select" to Shield to a saved address to continue.
- 4.We will shield tokens to the 0zk address associated with "My Wallet"
- 5.Enter the amount of tokens you want to Shield and click "Confirm amount".
- 6.Shielding the base token of a given network will auto-convert to the wrapped version, WMATIC for this example.
- 7.Click "Next" and enter your password.
- 8.Here you can view a summary of the Shielding transaction and fees paid (0.25%). To set a custom gas price click the "Network Fee" bar to see available options for fees. Click "Shield" to submit the transaction.
- 9.Navigate to your Private balance by clicking the "Private" button in the top right to view your freshly Shielded tokens.
- 1.Click the token you would like to Unshield. For this example, we will use WMATIC. Click "Unshield" to continue.
- 2.Paste the 0x address into the recipient box. Click "Select" to see list of saved/associated addresses. You can Unshield tokens to any 0x address.
- 3.Next, enter the quantity of tokens you want to Unshield and click "Confirm amount".
- 4.If, Unshielding a network's base token, select how you want to receive the token, either wrapped (WETH, WBNB, or WMATIC) or native (ETH, BNB, or MATIC). If Unshielding to a new wallet, select native to pay for gas on the other side.
- 5.Enter your password.
- 6.Here you can view a summary of the Unshielding transaction and fees paid (0.25%). See the Self-Relaying section on how to Self-Relay a transaction. Click the Relayer Fee box to select Fee Token or select a higher or lower fee amount.
- 7.Click "Generate Proof" to prepare the transaction. Generated proofs are valid for about 3 minutes.
- 8.Click "Unshield" to submit the transaction to the selected Relayer.
- 9.If you wish to use a different Relayer or pay the transaction fee with a different token or amount, click the "Relayer Fee" box to see available options.
Optional to change Relayer, fee token, and fee amount
Once the transaction is confirmed by the blockchain, your tokens will be available in the destination 0x address.
All RAILGUN fees can be paid with wrapped base network tokens or stablecoins, so you do not need to keep a private balance of ETH, BNB or MATIC for transactions from your 0zk address.
If this is your first time using Railway Wallet, it's a good idea to Unshield some of the base network token (ETH/BNB/MATIC) to a fresh 0x address to assist with Self-Relaying as a backup to the Relayer network.
Last modified 2mo ago