Bridges
Moving DFI and tokenized crypto across networks
Moving DFI and tokenized crypto across networks
Past tutorials only cover topics that are solely based on DeFiChain and its blockchain. In this tutorial, we'll go over bridging, which permits creating DeFiChain-based ecosystems on other networks, which has huge implications for DeFiChain. For example, bridges create a fast, easy, and decentralized way to purchase native DFI with tokens from other networks, like ETH or wBTC, removing exchange barriers for investors. Also, it enables DFI to be traded on DEXes in other networks including Uniswap or KyberSwap, opening opportunities for new investors to begin investing or advanced users to take advantage of new LPs or arbitrage. With new innovations can also come unforeseen problems or learning barriers, and this article will help resolve those.
There are six categories of bridges, sorted by three parameters.
Trust
Trusted
Trustless
Direction
Uni-directional
Bi-directional
Funds
Mint/Burn
Pooled
Bridges have three categories, one from each parameter. For example, the Quantum bridge, which connects DeFiChain to Ethereum, is trusted, bi-directional, and pooled
Trusted bridges are managed by a central party. Another example of this would be the Binance bridge. Users must trust the operator that they hold the appropriate funds when a user wants the party to return the funds, as the operator holds all funds.
Trustless bridges do not rely on any third-party to carry out transfers. In general, they use smart contracts to manage and oversee funds. One downside to trustless bridges is that smart contracts are prone to errors, which can cause them to be hacked and their funds stolen. Over time, developers are improving the security of these bridges and the ultimate goal would be to have all trustless bridges between blockchains.
Uni-directional bridges only allow a user to bridge funds in one direction. If the Quantum bridge was uni-directional, it would only permit the transfer of, for example, native DFI to ERC-20 DFI or ERC-20 DFI back to native DFI, not both. If a user bridges their funds, they cannot reverse the process, so they must make sure that they have a way to bridge back or that they are confident in their decision.
In contrast, bi-directional bridges permit bridging back and forth between chains. Most bridges are bi-directional, because funds do not flow in one direction only.
Some bridges mint and burn assets when they are bridged. For example, the bridge from native Bitcoin to wrapped Bitcoin on Ethereum uses this method. Certain addresses can send BTC to the custodian address (which holds native BTC to back wBTC), minting wBTC. In reverse, these addresses can request the BTC back by sending the wBTC back and burning it.
Bridges with pooled assets facilitate transfers like an exchange. If the BTC↔wBTC bridge operated this way, there would be a pool of BTC and wBTC on the bridge, and when users deposit one asset they can specify the address on the other chain to which they want to receive the other asset. In general, pools will take a very small percentage as fees for providing the liquidity. On the other hand, users who want to earn some rewards on their assets can take advantage of this and deposit assets to the bridge's pools.
Regardless of how a bridge functions, the work for the user to use the bridge is still quite similar.
The user chooses the token or coin that they have and want to send, as well as the network it is on.
The user double-checks they chose the correct token/coin and network.
The user chooses the network they would like to receive the new tokens/coins.
The user checks their transaction information again (networks, tokens/coins, amount)
Here is a tutorial to bridge funds on Quantum Bridge.
1. Check the amount of liquidity for the bridge. There must be enough liquidity for the destination network and token to complete a transfer. The amount of liquidity can be viewed on this site: https://quantumbridge.app/liquidity.
For example, if I have 1 dETH in my DeFiChain wallet and I would like 1 ETH in my Ethereum wallet instead, I would check to see how much ETH is available from the bridge on the Ethereum blockchain. Fortunately, there is enough liquidity. If I had wanted to bridge 2 dETH to ETH, there would not be enough liquidity for me.
2. Return to the bridge page and select the initial network, destination network, token/coin, and amount.
For my transaction, the initial network is DeFiChain, the destination network is Ethereum, and the token and amount I want to bridge is 1 ETH.
Note that the bridge will automatically take care of fees, and will display the net amount of tokens received after the transfer.
3. Connect the MetaMask wallet to the bridge.
As of April 2022, the Quantum bridge only supports the DeFiChain and Ethereum networks and the MetaMask wallet, which is represented by this tutorial.
After connecting your wallet, the bridge will allow you to paste an address or automatically use the one associated with your MetaMask.
Users must connect your wallet regardless of which direction they are transferring funds.
Double check the address is correct! Never assume that the bridge is free from errors or that malware may have changed the address.
4. Click "Review transaction" and follow the instructions.
Enter a proper recovery address. In this case, I need to enter a DeFiChain recovery address because I am transacted from the DeFiChain blockchain.
The bridge will ask for the deposit, users are allowed 24 hours to send the funds to the address that is seen in step 2 on the website. When the user has sent the funds, they can proceed to step 3. Quantum Bridge will check if it has received funds, and then in step 4 those funds can be released.
On our next tutorial, check out DeFiChain's Governance!