How to use the xDai Bridge without the UI
Transfer Dai to xDai and back again, without the UI
There is no need to use the Bridge UI if you want transfer your DAI to xDai or xDai to DAI. The instructions below show how to relay your assets without the UI.
- Use the Token Bridge address
0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016as the recipient of the payment.
- Wait for transaction confirmation in the ETH Mainnet (transaction time depends on the gas price you setup for the transfer transaction and the network throughput).
- Wait for the relay confirmation by the bridge validators (time depends on the number of blocks the bridge validators wait for to consider the chain finalized, currently set at
- Check your balance on the xDai chain.
Sending Dai to xDai on Ethereum
The following demonstrates interaction with contract methods using BlockScout and Etherscan
1) Send xDai coins to the Token Bridge address
0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6on the xDai Сhain using any wallet software.
2) Wait for the transaction confirmation on the xDai chain (5 seconds).
3) Copy the transaction hash of the confirmation and connect to the Ethereum mainnet.
5) In the
getMessageHashmethod field add the following information from your originating transaction and press the Query button. The method will return a hashed message.
- DAI recipient (typically the transaction sender but may differ if the ‘relayTokens’ functionality is used)
- Originating transaction hash
6) Copy the message hash and paste into the
getMessagemethod. If you receive 0x0 it means either the bridge oracles did not send a confirmation for the withdrawal yet or the data entered in the step 3 is incorrect. Double check the info and if it is correct you will eventually receive the message.
7) Once you receive the message, use the message hash again this time with the
getSignaturesmethod. It will return a blob with packed signatures provided by the validator. The method could fail if not enough signatures are collected.
9) Enter the message (from
getMessagemethod above) and the signatures blob to the
executeSignaturesmethod, press the Write button and complete the transaction with a Web3 wallet. If the method reverts, the withdrawal was likely already executed. You can check all input for the recipient here: https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f?a=0x..., where the recipient's address follows after “a=“.
Once you have written to the contract method, a View your transaction button will appear. Click to view the pending transaction.
A completed transaction