Sitemap
Tipbro

Tipbro

How does the Umee 🌊 bridge work?

7 min readDec 22, 2022

--

Press enter or click to view image in full size

You have probably already heard that Umee is “a cross-chain DeFi Hub that connects blockchains together.” You may also be wondering how the hell does this work? Let’s dive into the basics of how Umee uses Gravity Bridge to make this possible.

What’s the best thing about Umee’s Bridge?

For us, its best feature is security and decentralization .

When an asset is transferred across the bridge in either direction UMEE <-> ETH , the original assets are guarded by the decentralized set of Umee blockchain validators without permission through the multi-signature function process. Absolutely no centralized third party can take control of the funds transferred across the bridge, the security of the funds is guaranteed by the Umee Tendermint BFT consensus mechanism. There is no risk of compromising the centralized wallet or centrally stored private keys. The Umee Gravity Bridge module has been designed to provide the best cross-chain security on the market and aims to be fully interoperable with any EVM compatible networks using Gravity Bridge and ultimately provide additional interoperability with more blockchains.

What is a Gravity Bridge?

The Gravity Bridge is exactly what it sounds like, it’s a bridge ! However, this is not the half-ruined bridge on the outskirts of the city that you are afraid to cross. Umee’s Gravity Bridge is a “blockchain bridge” that runs through the security of the Umee blockchain and ultimately allows Umee to secure the flow of transactions between Umee and the Ethereum blockchain.

Umee uses Gravity Bridge as a base module and refines it to provide a custom implementation with a repeater called Peggo . If this is rocket science for you, that’s fine. You can think of Peggo (which is used by all Umee validators) as an “engine” that synchronizes, validates, and relays asset transfers across the Umee bridge. The Umee bridge uses the Gravity smart contract , which provides two-way transfer of transactions between UMEE <-> ETH and plays an integral role in allowing users to mint their tokens on different chains.

Bidirectional bridge transactions

There are two main pillars that ultimately power the Umi Bridge:

  1. Gravity Bridge smart contract
  2. Umee Gravity Bridge Module

Ethereum → Umee Bridge Transactions

The Gravity smart contract ensures the successful minting of assets on different chains, from Ethereum to Umee.

To understand how this works, let’s look at the following example:

Let’s say Alice has 100 USDC tokens on Ethereum and she wants to transfer her holdings to Umee to make them IBC compatible. Alice will complete this transaction using the Umee bridge through a simple user interface and confirm her $100 transaction by clicking the Bridge button. After a short wait, her USDC arrives in her Keplr wallet and can now be used on all Cosmos chains.

Invisibly, as soon as Alice confirmed her transaction, the sendToCosmos function of the Gravity smart contract was executed. The sendToCosmos function tied Alice’s 100 USDC to the Gravity smart contract, which created an “event”. When this event happened, validators running on the Gravity smart contract ( using Peggo ) intercepted Alice’s $100 transaction.

A validator is a node that validates and verifies network transactions.

To complete a transaction, validators must come to an agreement that an event has occurred. Once >66% of Gravity contract validators confirm that they see Alice’s funds securely locked in the Gravity contract, equivalent tokens have been transferred and successfully minted on the Umee blockchain to Alice’s Keplr address she requested.

As for Alice’s original USDC on the Ethereum blockchain, the validators “ locked “ these assets in Gravity’s smart contract as a form of backing for her assets on Umee .

  • For Ethereum-created denomies (common ERC20 tokens like Alice’s case), the assets are locked in the Gravity smart contract to serve as a form of support for the funds that are now available on the Umee blockchain. IBC compliant tokens are minted on Umee with a special denomination consisting of gravity + {ERC20 address}.
  • For Cosmos Originated denomies (Umee or IBC token), tokens locked in the Gravity smart contract as ERC20 tokens are unlocked and minted to the destination address on the Umee side as IBC tokens.

Umee → Ethereum Bridge Transactions

The Umee Gravity Bridge module ensures successful issuance of assets across different chains, from Umee to Ethereum.

Let’s look at another example to see how it works the other way:

Get Tipbro’s stories in your inbox

Join Medium for free to get updates from this writer.

Bob has 50 ATOM tokens on Umee and wants to transfer his holdings to Ethereum to participate in Ethereum DeFi. Bob completed this transaction using the Umee Gravity Bridge module, as well as through the user interface in the Umee DeFi Hub, and confirmed his transaction in 50 ATOM by pressing the “Bridge” button. If enough gas fees are paid, after a short waiting period, Bob’s ATOM will go to his Metamask wallet and can now be used on all Ethereum chains as an ERC20 token.

Behind the scenes, once Bob confirmed his transaction, it was sent through the Umee Gravity Bridge module . Bob’s pending transaction will be added to a batch of pending transactions of the same asset, ordered by fee, as an economic approach so that a group of transactions of the same type can divide the cost of expensive gas per transaction in Ethereum . After >66% of the validators ( using Peggo ) running on the Umee Gravity Bridge module sign a batch of transactions, the batch is transferred to Ethereum, and denominated to Bob’s tokens, successfully issuing his tokens on the Ethereum blockchain to Bob’s metamask address.

As for Bob’s original ATOMs on the Umee blockchain, the validators “ locked” these assets in the Umee Gravity Bridge module as a form of backing for his Ethereum holdings.

  • Cosmos-created assets (Umee or IBC token in Bob’s case) must have an ERC20 token representation. Tokens locked in the Umee Gravity Bridge module as IBC tokens are unlocked and minted to the destination address on the Ethereum side as ERC20 tokens.
  • For Ethereum-based assets ( regular ERC20 tokens), tokens that were previously locked in the Gravity smart contract to support IBC tokens on the Umee blockchain are unlocked and sent to the Ethereum destination address. The representation of ERC20 tokens as IBC tokens is burned.

Key Differences in Bridge Transaction Flow

We learned that Umee uses Gravity Bridge to mint assets on-chain in both directions from Umee <-> Ethereum, but what are the main differences?

Ethereum → Umee transactions

Transactions are processed individually on chains through the Gravity Bridge smart contract. The transaction will trigger an event that will be seen by validators running orchestrators on nodes. Orchestrators are responsible for monitoring Ethereum events and passing events to the Umee chain. Once >66% of organizers see the event, the transaction will be confirmed and (virtually minted) on the Umee blockchain.

Umee → Ethereum transactions

Transactions are processed in batches, which are ordered for a fee, on chains through the Umee Gravity Bridge module, rather than individual transactions. This allows orchestrators to send and process multiple transactions on Ethereum at the same time. In this case, the organizers are responsible for signing the transaction batches from Umee and transferring them to Ethereum. These transactions are processed and minted on Ethereum via the Gravity Bridge smart contract after >66% of the organizers sign the transaction.

Why is Peggo so important?

Peggo is a requirement to work as a Umee validator — if a validator does not use Peggo, it will result in jail time for that validator (the validator cannot participate in block proposals). Validators use Peggo to finalize all transactions across the Umee bridge. When an ETH → UMEE transaction is sent to a Gravity Bridge smart contract, Peggo scans the events of the contract deployed on Ethereum (Gravity) and sends the events as messages to the Umee chain. In addition, in the UMEE → ETH direction, validators launch Peggo relay transactions in batches from Umee to Ethereum using the same Gravity smart contract.

Peggo is also used to keep the registry of the Umee validator installed on Ethereum up to date. This is done using the update function valset , which is created immediately after changing the cardinality in the Umee validator set. When a power change occurs, a new valset update is created, which must be signed by the Umee validators to guarantee the event. The update can then be pushed via Peggo to Ethereum by any member of the network to secure the set of validators.

Peggo is used by validators to:

  1. Maintain an up-to-date registry of Umee Chain Validator installed on Ethereum.
  2. Transfer of ERC-20 tokens from Ethereum to the Umee network
  3. Migrate the IBC representation of ERC-20 tokens from Umee to Ethereum.
  4. Migrate UMEE and any IBC tokens present on the Umee chain to Ethereum.

Final Thoughts

We hope that in terms of a brief overview, you have learned a little more about how Umee’s Bridge works with validators to validate transactions on chains. This is not an easy thing to understand, and for all you tech junkies, we’ll be providing more information soon in our Umee Documentation .

What you really need to know is that the implementation of Umee Gravity Bridge is as sophisticated as possible in design and security , and has gone through an intensive security audit to make sure we provide the best services in the market. If you’re interested in learning more about the bridge, check out the Gravity and Peggo FAQ, or always feel free to ask questions on the Umee Discord!

Umee

Umee is a DeFi gateway that connects blockchains.

As a base level blockchain, applications and lego money primitives can be built on top of Umee to access leverage and liquidity between chains. The Umee blockchain facilitates interoperability between the Cosmos ecosystem, the Ethereum network, side chain architectures, layer 2 scaling solutions, and alternative core layer protocols. As a blockchain, the Cosmos SDK Umee Network is compatible with blockchains including Terra, Crypto.com, Binance Chain, Osmosis, Secret Network and over 30 other chains, as well as Ethereum, from day one.

Learn more about Umee and the UMEE token here .

Twitter | Telegram | Discord | Github | Blog |Reddit | Docs | Whitepaper

--

--