Make sure to read the following sections as a preparation:
In this section you will learn more about bridges in the Interchain Ecosystem, including the Gravity Bridge that connects the Interchain with Ethereum.
The Gravity Bridge (opens new window) is an on-going project currently being built by Althea with the goal to facilitate the transfer of ERC-20 tokens to Interchain-based blockchains and back.
The Gravity Bridge allows for novel applications that combine the power of the Interchain with the value of assets from Ethereum.
Developers can use a Cosmos chain for computation that is expensive or impossible to perform with Ethereum smart contracts. Developers could accept Ethereum ERC-20 tokens as payment, or build an entire Interchain application around Ethereum tokens.
The Gravity Bridge consists of several components:
Gravity.sol
: an Ethereum smart contract on the Ethereum blockchain.Tokens are locked on the Ethereum side by sending them to the Gravity.sol
smart contract. This emits an event that is observable to validators running the orchestrator. When a quorum of validators agrees that tokens have been locked on Ethereum, including the requisite confirmation blocks, a relayer is selected to send an instruction to the Gravity module, which issues new tokens. This is non-dilutive - it does not increase the circulating supply because an equal number of tokens is locked on the Ethereum side.
To transfer tokens from the Cosmos Hub to the Ethereum blockchain, tokens on the Interchain network are destroyed and an equal number is released (they were previously deposited) from the Gravity.sol
smart contract.
The Gravity Bridge is designed to run on the Cosmos Hub. It focuses on maximum design simplicity and efficiency. The bridge can transfer ERC-20 assets originating on Ethereum to a Cosmos-based chain and back to Ethereum. Transactions are batched, with transfers netted out. This creates efficiency at scale and lowers the transaction cost for each transfer.
The signing of fraudulent validator set updates and transaction batches meant for the Ethereum smart contract is punished on the Cosmos chain by slashing. If the Cosmos chain is trustworthy, you can trust the Gravity Bridge operated by it as long as it operates within certain parameters.
Slashing is done to penalize validators. When a validator loses a percentage of its staked tokens, the tokens were slashed as a penalty. Thus, penalties for validators can include (but are not limited to):
Bridges to Cosmos chains derive their trustworthiness from the degree of trust associated with the Cosmos chain to which they bridge. Peg-zone validators must maintain a trusted Ethereum node. This is mandatory. This removes all trust and game theory issues that usually arise when involving independent relayers. This once again dramatically simplifies the design.
Verifying the votes of the validator set is the most expensive on-chain operation Gravity has to perform. Existing bridges incur more than double the gas costs for signature sets as small as eight signers.
The bridge requires a validator set update on the Ethereum smart contract by calling the updateValset
method at least once every unbonding period, usually every two weeks. Why is this necessary? Without an update every unbonding period, the validator set stored by the Ethereum smart contract could contain fraudulent/malicious validators who then cannot be slashed for misbehavior.
Full nodes do not verify events coming from Ethereum, as events are validated into the Cosmos chain's state based purely on the signatures of the current validator set.
If validators represent more than 2/3 of the stake, an event could be added to the state even without a corresponding event on Ethereum. In this case, observers of both the Cosmos and Ethereum chains will need to "raise the alarm" on the issue. This functionality is built into the relayer.
Further readings
Do you want to dive deeper when it comes to bridges? Here are some helpful resources:
To summarize, this section has explored: