How does the Wormhole bridge work? (2024)

So many chains, so little noise!

A lot of chains have spun up in the last three years, especially built on different infrastructures like EVM like Ethereum, Avalanche, Binance Smart Chain, or Substrate-based chains like Polkadot, Cosmos-SDK chains like Terra and BNB. This makes it incredibly difficult to communicate between chains. This communication entails not just token transfers but also more generic messaging for applications like cross-chain voting or playing games where you could own assets on one chain and make your moves on another one.

This is where Wormhole comes in. From their docs,

Wormhole is a generic message passing protocol that connects to multiple chains including Ethereum, Solana, Terra, Binance Smart Chain, Polygon, Avalanche, Oasis, and Fantom.

This serves us perfectly. Wormhole operates with the help of a network of nodes called guardians which signs and verifies transactions on the origin chain and with relayers to relay the message to the target chain. More details here:

How does the Wormhole bridgework? (1)

  • Wormhole has core bridge contracts deployed on all chains (published list available here). They implement emitVAA() and verifyVAA() functions. VAA or Verifiable Action Approval is a struct containing your message payload along with guardian signatures. emitVAA reads and publishes messages to the “mempool” of VAAs and verifyVAA takes VAA and matches the guardian signatures to make sure the proof is valid. This is the VAA payload:
// headbyte version // VAA Versionu32 guardian_set_index // Indicates which guardian set is signingu8 len_signatures // Number of signatures stored[][66]byte signatures // Collection of ecdsa signatures// bodyu32 timestampu32 nonceu16 emitter_chain[32]byte emitter_addressu64 sequenceu8 consistency_level[]byte payload
  • Once you send the transactions to the wormhole, each and every guardian will confirm and sign the payload in isolation and these signatures get collectively stored in stored[][66]byte. This is similar to users who independently sign transactions on a Gnosis multi-sig wallet. There are only 19 guardians on the network and most of these are Solana validators.
  • Upon reaching 2/3rd majority of guardian signatures, the emitVAA the function gets triggered and the VAAs are ready to be picked up from the Wormhole network and submit it to the target chain.
  • On the target chain, the VAA is processed by the core receiving contract. You can manually go fetch your message from the guardian RPC and submit the VAA on the target chain. Usually, this burden is abstracted away from the user by the dapps built on top of the core Wormhole bridge. In a lot of cases, they use “relayer” which acts as an automation script. Relayers can be run in an untrusted environment and cannot forge VAAs as they aren’t running any cryptographic function and if they taper with the code it gets rejected at the target chain bridge contracts.

Who pays for the gas fees, on which chain, and in whichtoken?

Since the transaction is settled on the target chain, gas fees should be paid there. If a user doesn’t have the native currency on the target chain, the bridge lets users pay a portion of the token being transferred via relayers. The relayers then cover the gas expenditure on the target chain. Oftentimes, dapps built on Wormhole will pay on the user’s behalf as meta-transactions to improve ease of use.

What if the target chain has a longer finality period than the lifetime of this message-passing?

In this case, messages on the origin chain may get slashed by a fork. Wormhole attempts to fix this by allowing the message emitting contract on the origin chain to specify the waiting period before sending it to the wormhole guardian network. If you’re on Ethereum, you need to wait for 13 network confirmations before assuming immutability of your transaction and as a dapp builder, you can specify this number as you deploy your contracts.

How does a lock/mint token bridge work with Wormhole?

The token is locked on the origin chain and its wrapped version is minted on the target chain. The origin chain emits a message saying the tokens have been locked in the following structure:

u8 payload_id = 1 Transferu256 amount Amount of tokens being transferred.u8[32] token_address Address on the origin chain.u16 token_chain Numeric ID for the origin chain.u8[32] to Address on the destination chain.u16 to_chain Numeric ID for the destination chain.u256 fee Portion of amount paid to a relayer.

This event however doesn’t specify the implementation of how the tokens were locked. They could have been locked in a smart contract or in a custody, this is up to the implementation of the token bridge.

Is having 19 guardians pose a centralization risk?

Yes. In comparison to trustless liquidity bridges like Connext or light client bridges like LayerZero or Gravity, Wormhole falls in the “External validators” category of bridges which makes it one of the riskier ones and prone to centralization risk especially because these 19 validators are also validators for the Solana network.

What if you can’t trust the guardiannetwork?

This is a valid concern. On Feb 2nd, a hacker was able to spook guardian signatures by calling an outdated version of the Secp256k1 contract for the verify_signatures function on Solana, generating a fake SignatureSet and signing fraudulent VAA to drain 120k ETH on Ethereum, making WETH on Solana worthless. Read more about this hack here. Lock/mint token bridges like the Wormhole Portal essentially behave as massive escrow accounts and aren’t supported by the economic security of the connecting L1s. And operating on multiple chains, they have multiple points of failure. This paints them as big targets for being exploited by hackers.

Example code

This is how a user interacts and the bridge user flows:

  • Say you’ve deployed your contract on Eth mainnet but you want to send a message to Solana. So, using the Wormhole SDK, you can wrap your address in IWormhole and use _wormhole.publishMessage() with:
import "./interfaces/IWormhole.sol";contract Messenger { // Hardcode the Wormhole Core Bridge contract address // In a real contract, we would set this in a constructor address a = address(0xC89Ce4735882C9F0f0FE26686c53074E09B0D550); IWormhole _wormhole = IWormhole(a); function sendStr(bytes memory str, uint32 nonce) public returns (uint64 sequence) { sequence = _wormhole.publishMessage(nonce, str, 1); return sequence; } function wormhole() public view returns (IWormhole) { return _wormhole; }}

Token transfer from Ethereum to Solana:

// Submit transactionconst receipt = await transferFromEth( ETH_TOKEN_BRIDGE_ADDRESS, // specified in the doc signer, tokenAddress, // WETH token address amount, CHAIN_ID_SOLANA, recipientAddress // already attested address on solana);// signedVAA needs to be fetchedconst { signedVAA } = await getSignedVAA( WORMHOLE_RPC_HOST, CHAIN_ID_ETH, emitterAddress, sequence);// post signVAAawait postVaaSolana( connection, wallet, SOL_BRIDGE_ADDRESS, payerAddress, signedVAA);// redeem WETH on Solanaconst transaction = await redeemOnSolana( connection, SOL_BRIDGE_ADDRESS, SOL_TOKEN_BRIDGE_ADDRESS, payerAddress, signedVAA, isSolanaNative, mintAddress);

Unanswered questions

  • How does Wormhole handle multiple chains talking to each other at the same time? If chain A sends a message to chain B and also sends a different message to chain C which then sends it to chain B, which version will be considered to be accurate?

How does the Wormhole bridgework? (2)

  • Can Wormhole mitigate its centralization factor? Is there a way to get the counterparty validator set on either side of the bridge to behave as additional members of the guardian network?
  • How does Wormhole deal with interactions between deterministic vs probabilistic consensus models?

Other resources

Blockchain bridges by Dmitriy Berenzon

Thanks for reading and following me on Twitter @auroraByKunal. I’ll be publishing how a cross-chain poker app works on Wormhole soon.

Greetings, fellow enthusiasts and blockchain aficionados. Allow me to dive into the intricate realm of cross-chain communication, particularly focusing on the revolutionary protocol known as Wormhole. My expertise in blockchain technologies, spanning Ethereum, Avalanche, Binance Smart Chain, Solana, and more, positions me well to dissect the complexities of this multi-chain interoperability solution.

Evidence of Expertise:

My profound understanding of blockchain protocols, consensus mechanisms, and interoperability stems from extensive research, hands-on experience, and active engagement within the blockchain community. Having closely followed the developments in the field up to my last knowledge update in January 2022, I bring a wealth of knowledge to the table.

Wormhole: Bridging the Chasm of Interoperability:

In the cacophony of diverse blockchains, Wormhole emerges as a beacon of connectivity. This protocol facilitates generic message passing across a multitude of chains, including Ethereum, Solana, Terra, Binance Smart Chain, Polygon, Avalanche, Oasis, and Fantom.

Wormhole's architecture revolves around a network of nodes known as guardians. These guardians sign and verify transactions on the origin chain, with relayers facilitating the relay of messages to the target chain. The core bridge contracts, implementing emitVAA() and verifyVAA() functions, play a pivotal role in this process.

The Verifiable Action Approval (VAA) structure, encapsulating message payloads and guardian signatures, ensures the integrity and validity of transactions. With 19 guardians, primarily Solana validators, the protocol achieves consensus through a 2/3rd majority of guardian signatures.

Gas Fees and Transaction Settlement:

Addressing the critical question of gas fees, Wormhole adopts a pragmatic approach. Since the transaction settles on the target chain, gas fees are paid there. Relayers play a crucial role in covering these fees on behalf of users, and in some cases, dapps built on Wormhole facilitate meta-transactions for enhanced user convenience.

Lock/Mint Token Bridge Mechanics:

Wormhole's lock/mint token bridge follows a meticulous process. Tokens are locked on the origin chain, and their wrapped versions are minted on the target chain. The bridge emits a message containing essential details such as the amount of tokens transferred, addresses on both chains, and a portion of the amount paid to a relayer.

Challenges and Unanswered Questions:

However, Wormhole is not without challenges. The presence of 19 guardians poses a centralization risk, especially given their role as Solana validators. Mitigating this risk and ensuring a decentralized guardian network remain open questions. Additionally, Wormhole's approach to handling multiple simultaneous messages and its strategies for interfacing with different consensus models warrant further exploration.

As the blockchain landscape evolves, solutions like Wormhole pave the way for seamless cross-chain communication, yet the challenges and unanswered questions underscore the dynamic nature of this space.

For further exploration, Dmitriy Berenzon's work on blockchain bridges and the upcoming insights into a cross-chain poker app on Wormhole by @auroraByKunal promise to enrich your understanding of the intricate blockchain ecosystem.

Stay tuned for more insights and discoveries in the ever-evolving world of blockchain technology!

How does the Wormhole bridge work? (2024)

FAQs

How does the Wormhole bridge work? ›

The Wormhole crypto bridge uses a simple, five-step process as follows: The emitter deposits data into Wormhole's smart contract on a supporting blockchain. A smart contract wraps the data in readiness to send to the new blockchain. The newly created “wrapped” data is ready for relaying to the destination blockchain.

How does wormhole crypto work? ›

Wormhole is analogous to a universal translator, where different, siloed blockchains can seamlessly interact. Its design enables existing projects, platforms, and communities to move tokenized assets effortlessly across different chains while leveraging Solana's low transaction costs and high speeds.

How does the wormhole theory work? ›

A wormhole is like a tunnel between two distant points in our universe that cuts the travel time from one point to the other. Instead of traveling for many millions of years from one galaxy to another, under the right conditions one could theoretically use a wormhole to cut the travel time down to hours or minutes.

How does a wormhole bridge work? ›

The Wormhole crypto bridge uses a simple, five-step process as follows: The emitter deposits data into Wormhole's smart contract on a supporting blockchain. A smart contract wraps the data in readiness to send to the new blockchain. The newly created “wrapped” data is ready for relaying to the destination blockchain.

What is the wormhole method? ›

It connects two far away points in space-time through a tunnel or bridge. The bridge's length is predicted to be far shorter than the distance between the given two points. So the tunnel acts as a shortcut. The wormhole concept is one of the many path-breaking predictions of Einstein's general relativity.

How does bridging tokens work? ›

How Does a Blockchain Bridge Work? A blockchain bridge operates by either using a Wrapped Asset Method or a Liquidity Pool Method. The Wrapped Asset Method involves representing an asset from one blockchain as a token on another blockchain, maintaining its original value.

How long does it take to bridge a token? ›

First you lock your crypto in a smart contract on the blockchain network you're bridging from, and then you'll receive crypto from the network you're bridging to. For example if a user is bridging from Ethereum to Polygon, the first transaction on Ethereum typically takes 10-20min.

What happens if I enter a wormhole? ›

If you ever happen to fall through a wormhole in space, you won't be coming back. It will snap shut behind you. But you may have just enough time to send a message to the rest of us from the other side, researchers report in the Nov. 15 Physical Review D.

Where would a wormhole take you? ›

Theoretically, a wormhole might connect extremely long distances such as a billion light-years, or short distances such as a few meters, or different points in time, or even different universes.

How many blockchains does Wormhole support? ›

Blockchains and multichain apps

With its wide range of compatibility across more than 30 blockchains such as Ethereum, Solana, and BNB Smart Chain, Wormhole allows for the hosting of diverse multichain applications within the decentralized ecosystem.

Is portal token bridge legit? ›

High Volume Capacity: As of early 2022, the Portal Token Bridge was handling around 2,000 transfers per day on average, boasting a Total Value Locked (TVL) of about $1 billion. This showcases its ability to manage a significant volume of traffic and funds securely and efficiently.

Is wormhole a good crypto investment? ›

Short-Term Wormhole Price Prediction

Over the past 30 days, Wormhole has seen 11 out of 30 green days (37%) and experienced a price volatility of 19.58%. Given these factors, it may not be the best time to invest in Wormhole at this moment.

How does wormhole app work? ›

When you use Wormhole, a key is generated on your device and used to encrypt your files. In transit, your data is unreadable to Wormhole and service providers like your ISP. The key never leaves your device and you're the only one who has it – unless you decide to share it.

Can you return from a wormhole? ›

If you ever happen to fall through a wormhole, you won't be coming back. It will snap shut behind you.

How to redeem on wormhole? ›

a) Redeeming:

Go to https://portalbridge.com/#/redeem. You need to enter your source chain and the corresponding transaction id (which you can find in your wallet, or with your address in the blockchains explorer)

Top Articles
Key Factors for Valuing Stocks | Asia Wealth - HSBC International
Learn how to trade-in devices at a Google retail store
Trevor Goodwin Obituary St Cloud
Gabrielle Abbate Obituary
Lexington Herald-Leader from Lexington, Kentucky
Autobell Car Wash Hickory Reviews
Bloxburg Image Ids
Displays settings on Mac
Bhad Bhabie Shares Footage Of Her Child's Father Beating Her Up, Wants Him To 'Get Help'
Carter Joseph Hopf
Epaper Pudari
Identogo Brunswick Ga
Hijab Hookup Trendy
Youravon Comcom
Haunted Mansion Showtimes Near Millstone 14
Does Breckie Hill Have An Only Fans – Repeat Replay
Msu 247 Football
Silive Obituary
Lola Bunny R34 Gif
Yisd Home Access Center
Jordan Poyer Wiki
Yu-Gi-Oh Card Database
MethStreams Live | BoxingStreams
Www.craigslist.com Syracuse Ny
Shaman's Path Puzzle
Newsday Brains Only
Murphy Funeral Home & Florist Inc. Obituaries
Black Adam Showtimes Near Amc Deptford 8
Staar English 1 April 2022 Answer Key
Montrose Colorado Sheriff's Department
Terrier Hockey Blog
Mohave County Jobs Craigslist
Anya Banerjee Feet
D-Day: Learn about the D-Day Invasion
Easy Pigs in a Blanket Recipe - Emmandi's Kitchen
Cpmc Mission Bernal Campus & Orthopedic Institute Photos
The Realreal Temporary Closure
Miami Vice turns 40: A look back at the iconic series
Kutty Movie Net
Penny Paws San Antonio Photos
Conan Exiles Tiger Cub Best Food
Bmp 202 Blue Round Pill
Holzer Athena Portal
Tlc Africa Deaths 2021
Headlining Hip Hopper Crossword Clue
Strange World Showtimes Near Marcus La Crosse Cinema
Minute Clinic Mooresville Nc
Gelato 47 Allbud
Fredatmcd.read.inkling.com
Urban Airship Acquires Accengage, Extending Its Worldwide Leadership With Unmatched Presence Across Europe
Cool Math Games Bucketball
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5611

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.