Introducing the dBridge Testnet

DAFI Protocol
DAFI Protocol
Published in
5 min readOct 29, 2021
Bringing liquidity to Super Staking on multiple chains

After months of research, we’re very excited to announce that the dBridge is now live on testnet. This is a fast, secure cross-chain bridge that can support DAFI & dTokens on multiple chains.

This enables users to bring their ERC-20 $DAFI tokens across from the Ethereum network to Binance Smart Chain, and vice versa, in a staging environment. The goal is to collect feedback from users about dBridge before we launch it on mainnet, making $DAFI available on multiple high-speed and low-cost networks. As we aim to support every token on most chains, to launch their own dToken, it’s important that our protocol is cross-chain.

We will be adding bug patches & upgrades every few days, so there may be occasional downtime. To report a bug and help us improve the testnet, we welcome submissions here.

One for all and all for one

Now that the blockchain universe has witnessed the true power of Super Staking, it is time to bring our protocol to other networks. We want to reinvent every decentralized economy by maximizing incentives and kick-start a new era of Staking 2.0.

dBridge can get us closer to our mission as it facilitates the bi-directional transfer of $DAFI between other blockchains.

Users can now test the full capabilities of dBridge on testnet and understand the advantages of having DAFI running on top of Ethereum and ​​Binance Smart Chain. Although dBridge testnet currently supports these two chains, we’re planning to add more in the future for fast and cheap transactions.

dBridge was built by taking a security & speed focused approach. The architectue involves using Merkle-proofs and roots in order to validate transfers on more than one Blockchain. Two bridge contracts are in place on the sending and receiving chain, with a listener watching over the events on both chains.

Whilst multiple auditors ​​review and verify dBridge’s code is ready for mainnet, you can also contribute by playing around with dBridge on testnet and adding your opinion & findings via this form.

Using dBridge on Testnet

dBridge on testnet couldn’t be more simple to use. Still, we’ve created this quick guide to help you understand how you can easily transfer your ERC-20 $DAFI from the Ethereum network to Binance Smart Chain, and vice versa, in a staging environment.

Here’s a step-by-step guide to using dBridge on testnet:

  1. Visit bridge.dafiprotocol.io and select your main chain. Note: for now you will have to use testnet-DAFI tokens. You can claim them here.

2. You will be requested for approval via Metamask. Once granted your DAFI tokens will start bridging automatically.

3. Your DAFI tokens are now securely locked within the bridge and will show up in the Claims tab in <2–3 minutes.

Visit claim tab to see the list of your bridged tokens.

4. Claim your DAFI tokens on the final chain. You will require testnet BNB to do the claim step for gas, you can do this here.

To view your tokens, you can add them to your wallet using the header button with our logo. You’ve bridged!

The technical architecture

A bridge is supposed to move your assets from Chain A to Chain B. Let’s use an example.

Alice wishes to bridge her DAFI tokens from Ethereum to Binance, she first approves the bridge request of the said tokens and then confirms locking those tokens in the dBridge on Ethereum. Once Alice’s transaction gets confirmed, an event is emitted containing, the Receiving Chain Address and Amount.

Using these details a merkle tree is generated for all locking transactions that happened within the same block as Alice. The root of this specific Merkle Tree is stored in the opposing chain’s rootHeader mapping.

When a user comes to claim/mint their tokens on the receiving chain, the smart contract expects:

  • a proof of the user’s claim
  • the root of the merkle tree the users transaction was included in
  • the encoded transaction data which was emitted in the event,

It checks the provided root against the its root storage to see if the provided root is among the roots of the merkle trees generated by locking tokens on the preceding chain.

The dBridge then checks that the encoded leaf which we class a TX is not already claimed. It then verifies that the provided tx (leaf) & proof match the root provided. If all of these checks are passed, The user can mint or claim their tokens.

If the user wishes to bridge their assets back to Ethereum, he has to once again approve the dBridge on the Binance side of the said tokens, after his tokens are burned, an event is generated containing his tx details. Again a merkle tree is generated, this time the root is stored on the Ethereum side. To unlock his tokens the user provides a proof of his transaction, merkle root of the three his transaction was included in and his encoded tx (leaf).

If all of this checks out and merkle proof is verified he is able to claim/unlock his tokens back on the Ethereum side.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in DAFI Protocol

Every decentralized network can now maximize reward distributions based on their demand. Creating limitless applications that support reduced inflation & user growth.

Responses (3)

What are your thoughts?