xDai Stable Chain xDai Stable Chain BlockScout BlockScout TokenBridge TokenBridge

How to relay DAI Stablecoins without usage of the Bridge UI

There is no need to use the Bridge UI if you want transfer your DAI through the bridge. You can use the instruction below and the bridge will relay your asset to another network.

  1. Transfer from the ETH Mainnet to the xDai chain

    • Make a usual transfer of DAI tokens (0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359) on the ETH Mainnet by any software that is able to do ERC20 transfers (e.g. NiftyWallet, MyEtherWallet.com, TrustWallet). Use the Token Bridge address 0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016 as the recipient of the payment.
    • Wait for the transaction confirmation in the ETH Mainnet (depends on the gas price you setup for the transfer transaction and the network throughput).
    • Wait for the relay confirmation by the bridge validators (depends on the number of blocks that the bridge validators wait for to consider the chain finalized, for now it is 8).
    • Check your balance on the xDai chain
  2. Transfer from the xDai chain to the ETH Mainnet

    • Send xDai coins to the Token Bridge address 0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6 on the xDai chain by any wallet software.
    • Wait for the transaction confirmation in the xDai chain (5 seconds).
    • Wait for relay confirmation by the bridge validators (depends on number of validators and the ETH Mainnet network throughput)
    • Check your balance on the ETH Mainnet
3 Likes

Is this possible for a testnet as well, eg. Sokol? Of course, DAI wouldn’t make sense, but it could just be “some” ERC-20 token then?

It’s possible to setup a bridge like this for a testnet but we don’t have it. There are no limitations on xDai bridge at the moment and you can relay fractions of Dai and xDai.

Are there any events that are fired once stuff arrives on the other side of the bridge?

Hi!

RelayedMessage will be raised at the end of transfer from the Home side to the Foreign side.

AffirmationCompleted will be raised at the end of transfer from the Foreign side to the Home side.

Just wondering why none of the attributes are indexed?

Because it is not needed for the token bridge oracle functionality. You can open PRs against develop branch to address this.

1 Like

Ok, thanks. Didn’t know if there was some performance consideration or something.

Nifty be delisted by Chrome

Yeah… My conspiracy theory is that Google is cleaning suspicious application related to crypto from their store.

What POA team is doing now to mitigate the problem:

a. We are working on getting NiftyWallet back to Chrome store by communicating with Google

b. We fixed three issues raised by Google already.
Two of them were related to minimization aka obfuscation and one related to absence of privacy policy. The current reason by Google is Products must not contain false or misleading information in any content, title, icon, description, or screenshots.. We are trying to figure out what do they want to change.

c. Luckily you still can download NiftyWallet from the Releases page on GitHub https://github.com/poanetwork/nifty-wallet/releases/tag/v4.11.5

1 Like

I guess I should rephrase… what’s the best way to figure out when a transfer from xdai to dai is complete?

As I mentioned earlier the event RelayedMessage can be used for this.

Is this what you are looking for?

Can the receiver xDai address be different than the sender?
Ex: I want to send Dai to the xDai Bridge, but the recipient should be another address

It is not possible to do in one transaction due to legal limitations: the bridge does not perfrom the money transfer, this is the way to move an user’s assets from one chain to another

No, we designed not to allow it for purpose.
Rationale:
a. we use the same key derivation on xDai and on Mainnet so a user move coins between his wallets.
b. we don’t want the bridge to be money transmitter and require KYC/AML for transfers. You can read in legal opinion of the bridge here https://forum.poa.network/uploads/short-url/jm5ndHjTeFcV5Mx2sCk2U6yWVbC.pdf

It’s possible to have bridge working in Alice to Bob mode. E…g. in a fork by Peppersec for Thunderella bridge operates in such mode https://github.com/PepperSecDev/thunder_bridge

I would like to know more about your use case. Why do you need Alice-to-Bob mode?

Thanks for the concise answer.

I’m trying to build a use case where users can on-ramp directly to xdai from fiat.

Is there anything stopping from Fiat <> xDai without Dai?

Trying to use sendwyre as the onramp. Sendwyre are the custodians of the keys, so sending directly to xdai would have sendwyre receive the xdai coins.
So, i’ll have to circumvent this somehow.