How does the bridge work?

ERC-20 TRANSFER TO NEAR

The process includes 2 steps: approve and transfer. The first step transfers ERC-20 tokens to a ‘token locker’ (the token allowance transaction where you allow the bridge to use your tokens). The ‘token locker’ contract is not going to spend them until they are unlocked when someone sends them back across the bridge from NEAR to Ethereum.

The second step is your transaction confirmation. If you don’t see the confirmation, make sure to use the internal browser of that wallet. Wallet connection may have some issues.

Each ERC-20 in Ethereum corresponds to a separate token on the NEAR side, i.e. this token gets aligned to the NEP-141 standard. For DAI, this is nDAI; for USDT it is nUSDT and so on. Each n*** token is fully managed by the bridge smart contract. These tokens have a function to “create new tokens” and “burn” them. The function “create new tokens” can only be called by the main bridge contract, and it does this if there is evidence that the tokens were locked on the Ethereum side. If the user calls the “burn” function, its execution can be proven on the Ethereum side, and then the bridge contract unlocks the locked tokens.

ETH TRANSFER TO NEAR

When we transfer ETH to NEAR, we block ETH in the network and issue a certificate to the NEAR network that the tokens are locked. On the NEAR blockchain, an equal number of tokens is created. ETH is locked in the bridge smart contract in the Ethereum network. Proof of this is passed on to the NEAR network, where the bridge's smart contract issues new tokens, e.g., nETH. Each nETH token is a commitment from the bridge to return ETH to you in the Ethereum network, if you want.

More technical details can be found at https://aurora.dev/blog/2021-how-the-rainbow-bridge-works.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us