Building Multi-Chain Decentralized Apps: What’s the Diversifi Protocol? Part 3

Building Multi-Chain Decentralized Apps: What’s the Diversifi Protocol? Part 3

In Part 2 (Blockchain Bridges: The Concept and Current Issues), we talked about blockchain bridges — dapps that enable the swapping of tokens and/or arbitrary data, from one chain to another.

In this article, we’re going to discuss an alternative solution to blockchain bridges built by our team — the Diversifi protocol — and how it works.

Why Bridges Fail

Bridges are not native citizens to the blockchains world. They’re an external construct, built out of necessity — allow people to transfer assets from one liquidity island to another.

Rather than try to shoehorn a solution that comes with inherent security and technology issues, we elect to look at the problem holistically.

What’s So Special about the Diversifi Protocol?

The Diversifi protocol is being built to enable blockchain-agnostic web3 apps. Specifically, it allows users to look at all liquidity islands — whether they’re held in traditional, centralized, or decentralized finance — as a single liquidity pool.

The Diversifi protocol communicates with:

• Fiat accounts — to bring in TradFi assets

• CeFi services — using the user’s credentials to access their exchange-held funds

• Smart contracts on every supported blockchain — to provide a way for transaction settlements and liquidity reconciliation

In order to “transfer” assets across blockchains, we manage the debit/credit accounting rather than the usual lock/mint bridge approach.

A Bit of History of the Settlement Method

In the 12th century AD, the commerce world expanded greatly. Following the crusades, a secure base of operations in the Holy Land was established, allowing traders to branch from Europe to the Middle East, Africa, and beyond. But those were not safe trails to travel: bandits and pirates could steal a trader’s hard-earned gold and silver, ships could easily drown — along with all the wealth accumulated, and wars that broke in the region could hinder safe passage.

The Knights Templar was one of the most well-established orders of warrior monks. They built offices all over Europe and the Middle East (including one on Temple Mount in Jerusalem — hence the name), and accumulated tremendous wealth, kept in forts and fortified churches. Since they were known and trusted worldwide (at the time), having been blessed by the Pope (think of it as a middle-aged SSL certificate), they provided monetary services to traders and travelers, as well as paid protection along the dangerous routes.

But then one of them came up with the brilliant idea: since they have gold/silver/money (think coins/tokens) all over the world, why do people need to travel with money?

A French trader who successfully sold rare spices in Jerusalem, making a nice fortune, could walk into the nearest Templar bureau, deposit his gold, and receive a note, signed by the local “accountant.” He would then start his arduous trip back to France, where he’d walk into the Paris bureau, present his note, and receive a sack of gold (minus a fee, of course) from the local accountant.

And thus, the Templars invented international banking and the settlement method. Today, it’s being used globally, with technological advances replacing written notes, actual travels, or the need for a blessing from the Pope.

• Diversifi maintains stablecoins liquidity pools, across multiple chains.

• These pools can only be accessed by native smart contracts.

• Those smart contracts will only respond to commands coming from the Diversifi blockchain (meaning they cannot be manipulated locally on-chain).

• The Diversifi blockchain validates the transactions and is the ultimate single source of truth for the pools’ state.

1. A user indicates (through a wallet, a dApp, or API) they want to transfer $v from BC1 to BC2 (where $v represents a nominal value which is natively held on the corresponding network)

2. A Diversifi smart contract checks that:

• The user has $v on BC1

• $v are available on the BC2 pool

3. If the answer to both questions is “yes” the following set of transactions are executed and recorded on the Diversifi blockchain as a single atomic operation (see below):

• A smart contract on BC1 debits $v from the user’s account

• Once the contract approves that $v have been added to the BC1 pool from the user’s account, an order is sent to the smart contract on BC2

• The Smart contract on BC2 credits $v to the user’s account

As we can see, no new token is minted in this process. The funds necessary for the procedure exist prior to the transaction taking place, and the whole process turns from a complex transfer to a simple account settlement — which results in a safer, faster, and cheaper solution.

A cross-chain transaction is considered an atomic operation for smart contracts running on the Diversifi blockchain. The operation will not succeed if funds are not available, or if, for any reason, the credit or debit operations fail. The operation is predictable and reversible (dependent on the user having the right funds). A clear transaction record appears on the blockchain.

We saw that “transferring” stablecoins is a simple and predictable operation on the Diversifi protocol. But some bridges provide swap functionality (i.e., from token A on BC1 to token B on BC2).

When looking at swaps, we decided to break the problem into 3 subproblems:

  1. Converting token A to $v stablecoin on BC1
  2. Transferring $v from BC1 to BC2
  3. Converting $v to token B on BC2

If a failure or a major delay occurs during step 2, the whole swap operation will fail, or worse — yield unwanted results where major value is lost. Rather than risk loss of value, the Diversifi protocol will:

• Use a DEX with the best rates on BC1 to get the most $ for the token A amount provided

• Lose no value on step 2, since it’s a stable settlement

• Use a DEX with the best rates on BC2 to get the most token B for $ A amount provided

• In many cases, the user may elect to forgo step 1 or step 3, and the Diversifi protocol will accommodate. It all depends on the dApp the user interacts with and their final target.

• Due to the composability of the Diversifi protocol’s components, a user may want to take funds from BC1 and invest them in a supported DeFi protocol on BC2. In this case, step 4 would invest/stake token B into the protocol, etc.

Thus, we can see that the Diversifi protocol is much more secure and profitable than other solutions currently existing in the DeFi landscape.

Learn more about us and start building dapps upon the Diversifi protocol here.


Top News