Traversing the ETH<>Polygon<>xDAI<>BSC Cross-Chain Bridges

Infographic illustrating cross-chain bridges covered in this article. The Xpollinate Bridge from Connext is illustrated by a dock attached to each chain, and a boat carrying the three transferrable tokens.

Article Last Updated: May 1, 2021

Recent Updates

  1. Omni bridges connecting both Ethereum and BSC to xDAI STAKE can both be accessed at the same URL: https://omni.xdaichain.com/

Introduction

Cross-chain interoperability refers to the ability of a token to exist on more than one blockchain. Since a token can never actually leave its native network (chain), this must be done by locking a token on one chain and creating a wrapped (synthetic) version of it on another chain. When the wrapped version of a token is brought back to it’s native chain, it is burned (destroyed) and the original token is released.

Token cross-chain interoperability can become more complicated when a token crosses into a network from more than one other network. This is the case with xDAI STAKE (xDAI). Tokens can cross into xDAI STAKE from both Ethereum Mainnet and Binance Smart Chain (BSC).

This article walks through the process of transferring tokens between Ethereum and BSC using the xDAI STAKE network and bridges. This is followed by a walk through of an xDAI STAKE to Polygon (Matic) token transfer using the Xpolinate Bridge; and a Polygon (Matic) to Ethereum token transfer using the Matic Bridge v2.

It is intended for anyone to use to better navigate these networks and cross-chain bridges, however, as an active member of the SURF Finance community, it is geared to the most novice SURF Finance user. SURF Finance is expanding its ecosystem to multiple blockchains, including xDAI STAKE (xDAI), Binance Smart Chain (BSC), and Polygon (formerly Matic). This article is intended as an aide to our community and its members in this endeavor.

* Note: Matic network was rebranded to Polygon. The terms Matic, Polygon, and Polygon (formerly Matic) all reference the same network, and are used interchangeably within this article.

Adding Networks (Chains) to Metamask

The first thing a user will need to do is add the ability for Metamask to interact with BSC, Polygon, and xDAI STAKE. To do this, add a Custom RPC for each additional chain as shown below.

Here is the information that needs to be entered to interact with Binance Smart Chain (BSC):

Network Name: Binance Smart Chain
New RPC URL: https://bsc-dataseed.binance.org/
Chain ID: 56
Symbol: BNB
Block Explorer URL: https://bscscan.com

Here is the information that needs to be entered to interact with Polygon (formerly Matic):

Network Name: Polygon (formerly Matic)
New RPC URL: https://rpc-mainnet.matic.network
Chain ID: 137
Symbol: MATIC
Block Explorer URL: https://explorer.matic.network

Alternative Polygon RPC: https://rpc-mainnet.maticvigil.com/

Here is the information that needs to be entered to interact with xDAI STAKE (xDAI):

Network Name: xDai STAKE
New RPC URL: https://rpc.xdaichain.com/
Chain ID: 100
Symbol: xDai
Block Explorer URL: https://blockscout.com/poa/xdai

Alternative xDAI STAKE RPCs: 1) https://xdai.poanetwork.dev/
2) https://xdai.1hive.org/

There and Back Again

To better demonstrate a variety of the potential processes of using the xDAI cross-chain bridges, I will transfer both SURF and DAI from Ethereum to BSC, where I will sell my SURF for DAI to be taken back to Ethereum Mainnet. Since I am starting with .2 ETH, I will only buy .05 ETH worth of DAI and .05 ETH worth of SURF. This way, there will (hopefully) be enough to cover all transaction fees.

Important Notes:

  • It is not recommended to do all these transactions with such small amounts on Ethereum. It’s too expensive. This is being done for demonstrative purposes.

Trade ETH for DAI on Ethereum

  1. Go to the Uniswap swap here.

Trade ETH for SURF on Ethereum:

Trading ETH for SURF on Uniswap is slightly different because SURF is not automatically added to Uniswap the way DAI is. Uniswap makes it easy to add a new token to both Uniswap and MetaMask. Additional steps to swap ETH for SURF the first time are:

  1. Type in SURF.

Take SURF across the Ethereum bridge to xDAI STAKE

There are two protocols bridging Ethereum to xDAI STAKE :

  1. xDAI Bridge: The xDAI Bridge can only be used to send DAI to xDAI STAKE; converting it to xDAI STAKE’s native token, xDAI. Sending DAI via the xDAI Bridge has a lower gas cost than sending other tokens via the OmniBridge.

Sending SURF over the OmniBridge to xDAI STAKE: Once you arrive here, make sure Metamask is connected to the network (chain) tokens are being transferred from, and that the correct two chains are selected in the drop down at the top right of the webpage.

Metamask connected to Ethereum (Mainnet) & an Ethereum<>XDAI STAKE transfer is selected.

Once the correct network and bridge option are confirmed, take the following steps:

  1. Select the STAKE dropdown.

Once SURF is added and selected, enter the number of tokens to Unlock or just select Max and select the Unlock button. This will bring up the Metamask window and require a transaction be completed. Once this transaction is completed, verify the number of tokens to send, and select the Transfer button to bring up Metamask and complete the transfer.

When the transaction is completed, the sent SURF tokens will be parked in an Ethereum contract here, and an xDAI STAKE version of your tokens will appear in your wallet. To see the transferred tokens, change the Metamask network to the xDAI STAKE network added earlier.

xDAI Faucet

Since only SURF was sent to xDAI STAKE via the OmnBridge it won’t be possible to do any transactions on xDAI STAKE. Fortunately, there is a faucet to get .01 free xDAI, enough for several transaction.

To get the xDAI go here.

To receive xDAI:

  1. Open Metamask and click on the Account to copy the your address.

There is also a Bao-Community xDai Faucet, which can be accessed here.

Taking DAI across the Ethereum bridge to xDAI STAKE

Instead of using the xDAI Faucet, I could have sent DAI over the xDAI Bridge here, converting it into xDAI. To do this I need to:

  1. Switch back to Ethereum Network in Metamask.

While on xDAI STAKE, be sure to check out its primary DEX, Honeyswap. To add SURF to a Honeyswap swap, its xDAI STAKE address is 0xc12956b840B403b600014a3092f6EBD9259738fE which can be seen and copied here.

The BNB Conundrum

Now I am stuck. I can start the process of sending SURF to BSC using the OmniBridge, however, without BNB in my wallet, there will be no way to claim my bridged tokens. The BEP-20 (BSC) version of BNB is the native token of Binance Smart Chain (BSC), and is what is used to pay transaction fees. Without BNB in my wallet, there is no way to claim any transferred tokens.

Options for getting BEP-20 BNB into a wallet are:

  1. Receive BNB from another wallet on BSC.

There are likely other options, and hopefully something will be created to allow users to get BEP-20 BNB into their wallet directly from xDAI STAKE.

Take SURF Across the Bridge to Binance Smart Chain(BSC)

The xDAI bridge to BSC is that same OmniBridge used to to transfer SURF from Ethereum to xDAI STAKE located here. Again, make sure Metamask is connected to the correct network (chain), and that the correct two chains are selected in the drop down at the top right of the webpage.

Metamask connected to xDAI STAKE(xDAI) & an BSC<>XDAI STAKE transfer is selected.

Once the correct chain connection and bridge option is confirmed, take the same steps as described above for transferring SURF from Ethereum to xDAI STAKE. Two differences to keep in mind with the xDAI to BSC bridge versus the Ethereum to xDAI bridge are:

  1. The same token will have a different xDAI address. In the case of SURF, the xDAI token address is 0xc12956b840B403b600014a3092f6EBD9259738fE. When adding a custom token to your transfer, paste this address to add SURF.

Again, be sure to have some BNB in your wallet on Binance Smart Chain (BSC), otherwise you will not be able to claim your transfer.

SURF liquidity on Binance Smart Chain (BSC) is on the network’s biggest AMM DEX, Pancakeswap. To trade SURF for DAI on Pancakeswap, SURF will again have to be added as a custom token. SURF on BSC will have another new address, which is 0x0d1a15b277d25598144593836e5c6c20d427b61d and can be copied here.

You shouldn’t have to add DAI as a custom token, but just in case, the address for DAI on BSC can be found here.

After approving, I can now swap my 168 SURF for 78 DAI.

The DAI Journey back to Ethereum

To take 75 of my DAI back to Ethereum, I have to return to the same OmniBridge used to cross over to BSC here.

The process is similar to sending tokens from xDAI to BSC, except that when sending token from BSC to xDAI, you will not need to claim them on the xDAI side.

Unfortunately, not all DAIs are created the same. The 75 DAI I transferred over is DAI(BSC). I will need to convert it to xDAI before the final leg of our journey. To do this, first go to Component on xDai located here.

Swap DAI(BSC) for WXDAI. As illustrated above, it is not exactly a 1:1 ratio, but pretty close.

After the DAI(BSC) is converted into WXDAI, I will need to head over to the Honeyswap swap here, and unwrap it into xDAI.

We now come full circle by taking the 74.93 xDAI accross the xDAI Bridge.

To claim my DAI, I will have to switch to Ethereum Mainnet and pay Ethereum gas fees. This is not something I would normally do for a 75 DAI transaction, as Ethereum transaction fees make small transactions simply not worth it.

A Polygon Detour

Cross-Chain Bridge (Xpollinate Bridge): Another bridge option is the 3 chain — 3 token Cross-Chain Bridge at https://www.xpollinate.io/ by Connext. The Xpolinate Bridge allows users to transfer 3 tokens (DAI, USDC, and USDT) across 3 chains (xDAI STAKE, Polygon, and Binance Smart Chain).

I want to transfer xDAI from xDAI STAKE to Polygon using the Xpollinate Bridge. Once there, I will swap my xDAI (DAI on Polygon) for SURF, and then transfer the SURF, plus some previously purchased SURF, back to Ethereum using the Matic Bridge v2.

Sending xDAI over the Xpollinate Bridge to Polygon (formerly Matic): Once you arrive here, take the following steps to send xDAI over the bridge.

  1. Make sure Metamask is connected to the xDAI STAKE network.

Oh, wait!

What is this?

I’m getting the error message, “Router Has Insufficient Collateral. Please Try Again Later”.

I failed to notice that the Xpollinate UI indicated there was only 0.22 DAI Exit Liquidity on Matic. To complete this transaction I will have to wait until more DAI Exit Liquidity is available on Matic.

One Hour Later . . .

There is 93,348.33 Exit Liquidity DAI on Matic, more than enough to complete the transfer. After a repeat of the above process, my 50 DAI has successfully crossed the blockchain chasm from xDAI STAKE to Polygon (Matic).

SURF liquidity on Polygon (Matic) is on the network’s biggest AMM DEX, Quickswap. To trade DAI for SURF on Quickswap, SURF will again have to be added as a custom token. SURF on Polygon will have another new address, which is 0x1E42EDbe5376e717C1B22904C59e406426E8173F and can be copied here.

You shouldn’t have to add DAI as a custom token, but just in case, the address for DAI on Polygon can be found here.

After approving, I can now swap my 50 DAI for 98.7039 SURF.

The Matic Bridge v2 can now be used to transfer SURF from Polygon to Ethereum.

Matic Bridge v2: The Matic Bridge v2 can be used to send any token mapped to both networks back and forth between chains. Matic Bridge v2 offers two bridge options: the Plasma bridge, and the PoS Bridge (Proof of Stake Bridge). When transferring tokens between Ethereum and Polygon using the Matic Bridge v2, always be sure that you are using the PoS Bridge as the transfer mode. It should be the default. Transfers using the Plasma Bridge will take 7 days to process, whereas transfers across the PoS Bridge take about 3 hours.

Sending SURF over Matic Bridge v2 from Polygon to Ethereum: Once you arrive here, take the following steps to send SURF over the bridge:

  1. Click the Switch button to show Matic Network as the network you are sending tokens from. (Ethereum is the default.)

Success! Our tokens journeyed from Ethereum across two bridges to get to BSC (Binance Smart Chain). Came back across a bridge to xDAI STAKE. From there, some tokens crossed a bridge directly back to Ethereum, while others made a two bridge detour through Polygon to arrive at Ethereum. Best of all, this was all done on-chain, no CEX needed.

I hope you found this guide helpful. Token cross-chain interoperability is an exciting new piece of the crypto puzzle. It is important that any crypto user get comfortable utilizing cross-chain bridges to their fullest. They can create opportunities one might not otherwise realize.

To follow me on Twitter click here. I often post charts and and other information related to blockchain.

Avid Gamer | Economics Geek | Decentralization Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store