In blockchain technology, interoperability is the key to maximizing decentralized networks. One project that stands out in tackling the blockchain's interoperability challenge is Wormhole, a protocol for cross-chain communication and asset transfer. While protocols like Axelar, LayerZero, and Hyperlane have revolutionized how smart contracts and dapps interact, their confinement to EVM chains is a notable drawback. In contrast, Wormhole breaks new ground by enabling communication with both EVM chains and non-EVM chains like Solana, Near, Algorand, and Cardano. This blog explores how Wormhole shares data with other blockchains, how dapps communicate through Wormhole, and the innovative solutions driving the next generation of decentralized applications.
For smart contracts and dapps from different blockchains to communicate, they need to exchange information and value. This is where Wormhole comes in. But how does it allow for that seamless interaction between native smart contracts and dapps? Through its token bridge and standardized protocols:
The Token Bridge is a crucial feature in Wormhole's cross-chain functionality, responsible for creating, wrapping, and transferring assets across different blockchains. Developers can interact with cross-chain smart contracts using the Wormhole Bridge API, while the Messaging protocol ensures secure communication between dapps and blockchain networks, safeguarding the integrity of exchanged messages.
As the intro mentions, Wormhole is designed to support cross-chain communication and asset transfers between different blockchains. To do so, smart contracts on the source blockchain, which also define how to use them across chains, lock the tokens you're sending. Wormhole employs asset wrapping for the transfer to work, which mints a wrapped equivalent of the locked tokens representing the assets on the target blockchain, e.g., WETH. Asset wrapping ensures you can securely transfer tokens across different chains without losing value. Conversely, asset wrapping allows you to redeem the wrapped tokens and unlock your original asset on the source blockchain. For example, you wrap ETH on Solana to trade or deposit into a pool. When unwrapping the ETH, the protocol returns your ETH on the Ethereum blockchain.
Since the original asset backs all tokens managed by the Token Bridge, assets are transferred path-independent. Regardless of what chain the assets go to, there will never be a 'double-wrapped' asset for a single backing asset. Additionally, the holder has no liquidity limitations.
Code for wrapping tokens:
function transferTokens(
address token,
uint256 amount,
uint16 recipientChain,
bytes32 recipient,
uint256 arbiterFee,
uint32 nonce) returns (uint64 sequence)
Code for wrapping NFTs
function transferNFT(
address token,
uint256 tokenID,
uint16 recipientChain,
bytes32 recipient,
uint32 nonce) returns (uint64 sequence)
)
By establishing robust communication channels among its interconnected chains, Wormhole ensures the seamless transmission of transaction data, asset metadata, and verification proofs—essential elements for enabling simultaneous data exchange between chains.
Now, how does Wormhole achieve consensus and confirm transactions when it's connected to multiple blockchains? One of Wormhole's core objectives is to establish a high level of confidence in recording transactions, ensuring that only messages that have been finalized and approved are recorded. Different chains utilize different consensus mechanisms, so there are different finality assumptions.
That said, the protocol relies on the connected chains' underlying consensus mechanisms, enabling transactions within the Wormhole ecosystem to be validated and confirmed by the respective blockchains involved. And so, by combining the token bridge, smart contracts, nodes, asset wrapping, communication channels, and underlying consensus mechanisms, Wormhole seamlessly communicates with other blockchains and their dapps.
To ensure a comprehensive understanding, let's begin by defining key terms that will be instrumental in building context as we delve deeper into the topic.
xData: Data in a layer outside L1 blockchains, accessible by all chains.
xAsset: Chain and path agnostic token which can be used to transact on any blockchain
xDapp: Decentralized application that enables users to create or use xData.
Moving on, we need a one-stop solution for interoperability challenges. Additionally, high on the blockchain's wishlist is the ability to detach tokens from their native chains. It is a pity that ETH only exists on Ethereum, MATIC only on Polygon, and SOL on Solana. It would be far more helpful if those assets were independent of their native chains. In comes the concept of an xAsset. xAssets maintain fungibility and can move fluidly around blockchains without ever becoming double-wrapped. Now, you may think xAssets are the solution to the interoperability problem. However, they are just one step short as they require something else.
Traditionally, blockchains were designed to store and validate financial transaction data. However, modern blockchains have evolved and can process other forms of data beyond just transactions through smart contracts. Some of that data represent assets, hence the concept of xData - a much better solution. In Wormhole, xData is a shared data repository the entire ecosystem can access. And apart from being shared across the ecosystem, xData allows developers to build from a top-down, message-passing approach. The solutions are called xDapps, which possess the functionality of traditional dApps while utilizing xData and xAssets. An xDapp example is a native Solana app that can accept direct Ethereum deposits. This is possible because the developer integrates the Wormhole SDK into their front end, and the Portal Token Bridge receives the deposit and transfers it to the target chain.
Furthermore, multichain dapps serve as consolidated gateways providing a unified platform to interact with various EVM networks without needing multiple interfaces or specific network knowledge. However, using Wormhole's verifiable action approval (VAA) messaging system, dapps take it one step further - multi and cross-chain - giving users more functionality than is possible in an isolated ecosystem. VAA bridges the gap between blockchain networks, enabling dApps to communicate and coordinate actions across chains.
To explain the communication process between Wormhole and a dapp, let's simulate a scenario. Orlando wants to swap his ETH to USDC on the Polygon network to deposit into a liquidity pool. The dapp being used is XDEFI, a non-custodial wallet that supports 20+ blockchains powered by its Wormhole connection. Here's what will happen in the process:
Orlando wants to swap 10 ETH to USDC on Polygon. Orlando opens his XDEFI wallet on his mobile phone or computer extension. He navigates to the swap section in the wallet interface. Orlando selects Ethereum as the source network in the swap form and Polygon as the target chain. He enters the amount - 10 ETH - to be swapped. XDEFI wallet utilizes Wormhole's Token Bridge to wrap the 10 ETH into a xAsset of the same value on Polygon. Orlando then confirms the swap request, authorizing the transaction. Beneath the hood, the wallet communicates with Wormhole through the Wormhole Connect API - the API receives the swap request and validates it. The Bridge API then processes the transfer of the wrapped ETH from Ethereum to Polygon in a matter of seconds or minutes, depending on network activity at the time. Once the transaction is confirmed, the bridge unlocks the wrapped ETH, converted as ETH on Polygon. Orlando can now swap the received ETH tokens for USDC by specifying the amount of ETH to swap and selecting USDC as the token being received. The swap is executed, converting the ETH to the corresponding amount of Polygon USDC. There's more: with the USDC, Orlando can trade, provide liquidity, and even stake.
Note that when Orlando initiates a cross-chain swap from Ethereum to Polygon, the gas fees for the Ethereum transaction are paid in ETH. And once the wrapped ETH tokens are transferred to Polygon plus the subsequent swap from ETH to USDC, the gas is paid in MATIC.
Through the detailed transaction described above, we witness Orlando initiating a cross-chain swap, leveraging Wormhole and an xDapp, to seamlessly convert his 10 ETH into USDC on Polygon. But then, what are the other advantages and use cases for xdapps in the blockchain ecosystem for devs and users alike? Let's find out:
Unified Liquidity: As a DeFi user, liquidity is spread out across multiple DEXs, potentially impacting the price discovery and execution of trades. Xdapps give users access to more liquidity, with xassets taking it one step forward - they can be used on multiple blockchains.
Decentralization: Bridging and cross-chain solutions usually involve some form of centralization - some wrapped token bridges rely on centralized custodianship of the wrapped tokens. These custodians hold the original token on one chain while issuing the wrapped version of the token on the other chain. In contrast, transactions and activity on the Wormhole protocol are decentralized and trustless.
A broader user base: Because xdapps live on multiple chains, their functionality is not limited to the users of one blockchain. Instead, any user on any blockchain can use the application at their convenience.
Optimized, better performance: xDapps rely on the strength of each blockchain they are connected to. That is unsurprising as their connections ensure they can access the same features as native dapps. Additionally, expensive computations get offloaded to networks with high TPS; final settlement happens, gas is paid on the user's preferred chain, and storing data in the cheapest place.
Increased composability: Composability combines or interoperates different smart contracts and protocols to create new functionalities or services. xDapps embrace composability on a fundamental level. This allows developers to integrate various building blocks or modules to create innovative and interconnected applications.
Extensibility: xDapps can leverage the features provided by the underlying blockchain network and tap into the functionalities offered by other xDapps. This extensibility allows developers to enhance their dApps by incorporating existing solutions, libraries, or modules, reducing development time and effort.
Embracing New Environments and Protocols: The decentralized ecosystem constantly evolves, with new blockchain networks, protocols, and environments emerging. Wormhole xDapps are designed to be adaptable and flexible, enabling them to integrate with and support these new environments as they join the ecosystem.
Interoperability is gaining prominence as blockchain networks increase, each with unique features, use cases, and user bases. However, many of these networks remain isolated, hindering efficient collaboration and the movement of assets across more chains. Interoperability solutions like Wormhole address this issue by facilitating cross-chain communication and asset transfer.
Wormhole's unparalleled protocol sets it apart as a game-changer in the realm of interoperability. Facilitating seamless cross-chain transfers of assets, data, and smart contract interactions, lays the foundation for a truly interconnected and decentralized future. By connecting various blockchain networks, Wormhole enhances liquidity, expands access to diverse markets, and encourages collaboration between different projects and communities.
As the blockchain industry continues to evolve, several potential developments could shape the future of Wormhole and interoperability:
Expansion to New Networks: Wormhole is currently connected to ~ 23 blockchains. Soon, Wormhole will undoubtedly expand its support to additional blockchains beyond its existing integrations. This would increase the reach and accessibility of the protocol, fostering greater interoperability across a broader range of chains.
Integration with Layer 2 Solutions: Wormhole could explore integration with layer two scaling solutions, such as Ethereum's Optimism or Arbitrum. By leveraging layer two networks, Wormhole could enhance scalability and reduce transaction costs, making cross-chain interactions more accessible and cost-effective.
Standardization and Interoperability Frameworks: Wormhole might actively participate in standardization efforts and collaborate with other interoperability projects to establish common frameworks and protocols. This would promote seamless communication between different interoperability solutions, further advancing the overall interoperability landscape.
In conclusion, Wormhole's current position as a leading interoperability solution, combined with potential future developments, holds the promise of advancing cross-chain communication and asset transfer capabilities. As the industry evolves and by bridging disparate blockchain networks, Wormhole will shape the future of interoperability by creating a more interconnected and cohesive blockchain ecosystem.
Looking for a detailed breakdown and introduction to Wormhole? Check out my past article.
Thanks for reading through.