Function X July Hash Out

f(x)Core Gravity Bridge

Gravity is the force by which a body draws objects toward its center. Much like gravity, the f(x)Core Gravity Bridge is designed to pull liquidity from the Ethereum ecosystem into the Cosmos ecosystem in a trustless, decentralized and secure manner.

What Is f(x)Core Gravity Bridge?

The f(x)Core Gravity Bridge is a trustless, secure and decentralized bridge between Ethereum and the Cosmos ecosystems. Powered by a Cosmos SDK with the aid of smart contracts, the bridge uses a validator set to sign transactions, instead of a multi-sig account or an authorized group of actors.

The bridge allows the seamless addition of ERC20 tokens to the bridge, and thereafter the free movement of ERC20 tokens between the Ethereum and Cosmos ecosystems.

For example, a user wants to participate in a yield farming protocol on f(x)EVM and he/she needs USDT. They can bridge the USDT from Ethereum (or other EVM compatible chain) to f(x)EVM by using the f(x)Core Gravity Bridge. The bridge will lock the token transferred from the sender chain (we are using the Ethereum chain as an example) and mint the representation of that token on the receiver chain (in this example, it is f(x)EVM). More technical details will be explained below.

Features:

The f(x)Core Gravity Bridge is simple by design and is easy to use, also offering greater security. It does away with long lines of code, and harnesses the existing consensus engines of both EVM chains and f(x)Core.

Highly decentralized:

  • Movement of funds are controlled by validators
  • The addition and removal of validators in the group are controlled by the validators
  • The addition of new types of tokens to the bridge can be done through governance
  • Unified token: The unification of the same token from different chains to form a single unified token on f(x)Core that is chain-agnostic

Secure: Validators cannot sign or submit bridge messages not agreed upon by consensus

Gas Efficient: Rollup-style batch transactions reduce individual users’ gas costs

The Building Blocks of the f(x)Core Gravity Bridge

The Gravity Bridge has three defined components:

1) A Solidity contract on Ethereum

2) A Cosmos SDK module on the Gravity Bridge blockchain

3) A Cosmos SDK module: fxcore-ERC20

How does it work?

Like most cross-chain bridges, the Gravity Bridge involves locking up a native token/coin on one side of the bridge and then minting a representation of that token on the other side of the bridge. On the way back, the representation of the token is burnt and then unlocked on the native chain.

When a representation of the token is minted on the f(x)Core chain, it will form a unified token which is chain agnostic. Example: ETH-USDT, Polygon-USDT, Tron-USDT cross-chain through the Gravity Cross-Chain Bridge, then converted by the fx-ERC20 module and unified into a FX-USDT ERC20 Token upon entering the f(x)EVM. Below is a diagram to show how the bridge works.

Deposits:

Depositing assets into f(x)Core Gravity Bridge from Ethereum is permissionless and secure. Every time a user deposits assets into the bridge from Ethereum, the event will be verified by each validator. When an event is attested by more than ⅔ of the validator set, representative tokens are minted. Validators must submit all attestations in order.

  1. The user calls the sendToFx method of the bridge contract of an EVM-chain through f(x)wallet to lock the USDT in the bridge contract
  2. The validator(s) listens to the sendToFx event in the bridge contract, then signs the event, and then submits the signed event to f(x)Core through a transaction. After the f(x)Core link is signed by at least ⅔ of the validators, it will automatically be signed by the user. The corresponding USDT is minted on the account

Withdrawals:

Gravity Bridge batches withdrawal transactions, collecting multiple sendToEth transactions together in a single batch. This works like a rollup: Executing many transactions in a single batch order, reducing the gas amount of each user.

  1. Users call the sendToEth transaction of the fxCore chain through f(x)wallet and apply for withdrawal
  2. One of the arbitrage relays will monitor the transactions that apply for withdrawal on the f(x)Core chain. When the bridgeFee paid by all withdrawal transactions is enough to offset the transaction fee of sending submitBatch on the Ethereum chain, it will send requestBatch transactions to the f(x)Core chain to package all sendToEth transactions
  3. When other relayers listen to the requestBatch transaction on the f(x)Core chain, they will sign the packaged transaction, and then the confirmBatch transaction will occur on the f(x)Core chain
  4. The arbitrage relay will then collect the withdrawal package signature information of all relays from the f(x)Core chain, and call the submitBatch method of the Ethereum contract. The submitBatch method will check the signature information of the relay, and verify that the signatures collected are greater than ⅔. Once verified, the contract will unlock USDT and transfer it to the user account, completing the withdrawal. The remaining bridge fee will be transferred to the arbitrage relay

How to Use Gravity Bridge

For users: f(x)Wallet will soon be able to support the Gravity Bridge

For developers: You may refer to this document to learn how to add your token to the Gravity Bridge

We hope the points above can help you to understand more about the f(x)Core Gravity Bridge and why we have confidence in our innovative solutions.

Thank you for reading the July Hash Out and we look forward to sharing more exciting updates and progress in the future. If you have any questions regarding the Function X blockchain, you can always reach our support team on the Function X Forum.

Leave a comment