Gravis Finance & Cross-chain Revolution

Gravis.Finance
4 min readMay 17, 2021

Introduction

Blockchain technology was born in 2009 and can make a very strong impact on people’s lives. The development of various protocols spawned a great number of possibilities and also a great number of challenges. Ethereum, being such a popular protocol, suffers from scalability and transaction fees problems. Cosmos and Polka Dot designed for cross-chain exchange are still not fully developed yet. Existing protocols can be compared to a group of computers not connected to each other. Each of them has its own activity, but they don’t know about their neighbors.

Further evolution of blockchain depends highly on the creation and development of decentralized applications which will enable cross-chain swaps.

Gravis Finance, being a multi-chain platform, allows users not only to make swaps inside each of several networks but between the networks as well.

Gravis Heco-BSC Simple Bridge

The most simple implementation of cross-chain exchange is a bridge between Huobi Eco Chain and Binance Smart Chain networks. It is built on stablecoin pairs, namely Heco-Peg USDT vs USDT (bep-20).

A user sends some amount of stablecoins on the Huobi Eco Chain network to Gravis Planck Hub. The Hub sees this transaction, freezes the user’s tokens on the Huobi Eco Chain network, and sends an adequate amount of stablecoins to the user on the Binance Smart Chain network.

The bridge also works vice-versa, i.e. from the BSC network to the Heco network.

You can see a schematic in picture 1.

Poly Network Bridge inside-the-box

Here is how it works:

• RELAYER is the relayer.

• POLY_CHAIN is Poly Chain

• DST_CHAIN_1 is the first destination chain

• DST_CHAIN_2 is the second destination chain

1. An atomic cross-chain transaction Xato is initiated on source chain Msrc, which calls the cross-chain management contract on source chain.

2. RELAYER sends a transaction on DST_CHAIN_1 to execute the preparation phase

of Q1 through write operation. Then the cross-chain management

contract on DST_CHAIN_1 will validate the atomic cross transaction and execute it.

3. The execution in DST_CHAIN_1 is successful, and the two-phase contract’s prepare function locks all related resources and returns success. The success of the preparation phase of Q1 is synchronized to Poly Chain, which means all related resources are locked, and the commit/rollback phase will never fail.

4. RELAYER sends a transaction on DST_CHAIN_2 to execute the preparation phase

of Q2 through write operation. Then the cross-chain management contract on DST_CHAIN_2 will validate the atomic cross transaction and execute it.

5. The execution in DST_CHAIN_2 is successful, and the two-phase contract’s prepare function locks all related resources and returns success. The success of the preparation phase of Q2 is synchronized to Poly Chain, which means all related resources are locked, and the commit/rollback phase will never fail.

6. On Poly Chain, RELAYER can get proof that the preparation phases on all destination chains are successful.

7. RELAYER sends a transaction with the previous proof on DST_CHAIN_1 to execute the commit phase of Q1.

8. RELAYER sends a transaction with the previous proof on DST_CHAIN_2 to execute the commit phase of Q2.

Gravis Cross-chain Swap

A user can make a cross-chain swap not only between stablecoins, but between any tokens listed on Gravis Finance Exchange (Gswap).

You can see how it works in the picture below.

  1. A user goes to the cross-chain swap interface.
  2. The user selects a token to give and a token to get and confirms the transaction.
  3. The Exchange automatically makes all required actions and sends the required token to the user as a result.

Conclusion and Future Challenges

At the first stage, Gravis Finance creates a cross-chain exchange possibility between Huobi Eco Chain and Binance Smart Chain, the most popular networks after Ethereum.

We will extend this functionality after we add the support of different networks.

One of the challenges is the creation of a hub that holds stablecoins from many networks, another challenge is to maintain sufficient liquidity levels.

We continue to explore different approaches to building bridges between blockchains and we may create a composite way to do it.

References:

[1] PolyNetwork: An Interoperability Protocol for Heterogeneous Blockchains [Poly Team 2020–05–15] Source

--

--

Gravis.Finance

🎮Gamified🕹 DeFi ecosystem. 🚀Evervoid Game🎴Smart NFT assests. Multichain. Cross-chain. 💸💸💸High profit yield farming .