Wormhole-Everything you need to know about xApps

Raunak Raj Rauniyar
14 min readDec 28, 2023

--

Wormhole:

Wormhole is a generic message-passing protocol that enables communication between blockchains. The simple message-passing protocol enables developers and users of cross-chain applications to leverage the advantages of multiple ecosystems. With a single SDK integration, Wormhole allows cross-chain movement in terms of Apps, Data, and Assets across 25+ blockchains.

The problem with crypto

There are too many blockchains already and there are many more to come. With that, each blockchain is fully independent of itself. They can't interact with the off-chain world, nor with other blockchains. They are islands unto themselves. This is a blockchain's fundamental property, making it secure and reliable. It’s great on some dimensions but also comes at a price.

The User Experience is Awful

Because blockchains are like independent islands, a user acts like a person stuck there with nowhere else to go. You’ll get bored pretty quickly, right? Just like that, assets, identity, and liquidity are soiled to one chain. So, navigating multiple chains, each with its own wallets, tools, and protocols is annoying and lengthy.

Builders get handicapped by the chain

The hardest problem a builder faces is to choose the ‘perfect’ chain to build on. Any dApps are capped by the ecosystem they are in — in terms of the number of users in the chain, the liquidity in the chain, other projects being built, the support and development resources, etc. Additionally, liquidity (and users) are fragmented across chains. This handicaps us builders in the projects we want to deploy and the kind of users we want to cater to.

A Possible Solution

Bridges:

It serves as a gateway linking multiple separate blockchains, allowing for the transfer of data and assets between them. It follows a ‘lock and mint’ mechanism to perform transactions. A user locks tokens in a smart contract on the source chain, and then wrapped versions of those locked tokens are minted on the destination chain as a form of IOU. So consider you have USDT on the Ethereum chain that you want on Solana to perform tasks. So the bridge takes your USDT tokens, locks them in a smart contract, and mints an IOU token(a wrapped token) on the Solana side of the bridge. That wrapped token represents a claim on the USDT that exists in the Ethereum world. That wrapped token can be swapped for native USDT, SOL, or anything. This mostly works. However, it has some problems.

Representation of Lock and Mint in Bridges.

Why not Bridges:

Security:

Bridges are constantly targeted by hackers. At some point five of the top ten biggest hacks in the crypto had to do with bridges. The reason is obvious when all of the assets are locked up in one place, it's like one attractive vault that every robber would want to try on. The lock and mint’s mechanism works in a way that all the assets that need to be transferred are stored in a specific account owned by the smart contract making the transaction. So just by accessing a single vault, all assets can be hacked.

Centralization:

So I speak for everyone in crypto when we are not a fan of centralization. The whole purpose of blockchain is to establish decentralization in how we function. Partcillary more when you are responsible for moving assets across chains. It is primarily because when things go south the centralized people are going to look out for themselves first before they look out for anyone else. Having so much control over all the assets being transferred is scary.

Asset transfer is basic:

Bridges can do this lock and mint with all tokens, but one thing to consider is does it really solves the problem. Transferring assets is good, but it is basic. It doesn’t really unlock the full value of crypto. By communicating with chains we want to deploy cross-chain dApps, cater to a bigger user base, embrace faster technologies, and just transferring tokens won’t do that.

Building and community:

Another big problem for developers is that building on top of these bridges is really hard. To take our dApps cross-chain we’ll have to build on top of bridges which can be hard as not many resources are available and the community is tiny. Not many people are building that, ideas and help can be tricky to find.

Wormhole for the rescue.

Now comes wormhole. It is more than a bridge, less than a full layer 1. What makes it better is it's generalized for messaging. That means Wormhole can send over assets as well as information.

Why Wormhole:

Decentralized with 19 guardians

Wormhole is the most decentralized form of bridge and something called Guardians makes that happen. Guardian is a large crypto institution that monitors the core contracts for Wormhole in each of the different chains. It is the guardians’ role to observe messages and sign the corresponding payloads. Each guardian performs this step in isolation, later combining the resulting signatures with other guardians as a final step. The resulting collection of independent observations forms a multisig which represents proof that a state has been observed and agreed upon by a majority of the wormhole network. These multisigs are referred to as VAAs in Wormhole.

A simple analogy to understand guardians is that they’re like the border agents you’d have when you're trying to go to different countries who will stamp the visa saying this is legit and this is not. The current guardian set can be seen here. The key insight here is that these 19 companies are putting out ‘proof of reputation’ as guardians and if it comes out that they’ve not been honorable their whole business suffers.

Source: The Wormhole Blog

Transfers Assets and Information

The ability to send just not assets but information is what makes Wormhole superior to other bridges. This information is called messages. Cross-chain messaging means the ability to call a contract on another chain. It’s so much more than just the asset transfer. Think of being able to use Serum from Ethereum, or being able to create multisig on Squads from any chain.

When enough guardians agree that an observation has been made, the message is put into a structure called a VAA, which combines the message with the guardian’s signatures to create proof. In the end, a smart contract on a receiving chain has to process these VAAs to receive a wormhole message.

Here comes Relayer!

The thing which acts as a middleman between the wormhole and the target chain is called a ‘Relayer’. A Relayer picks up signed VAAs from the wormhole network and sends it to the target chain.

But why they are important?

To understand why they are needed, let’s remove them from this situation. If there were no relayer, you would need to get the VAA from the network, submit it to the target chain, and pay the gas fees using the tokens of the target chain, which would not be an out-of-the-world experience for sure (get it?)

Security

Most likely you heard about Wormhole from the infamous $350 Million Wormhole hack. Bridges are the most vulnerable point in a network so they often become the obvious targets of these hacks.

To understand how Wormhole solves the security risks, let's explore what risks are present in bridges.

If we start from the high-level overview, the first thing that comes is the risk with the Network.

  • When a chain gets compromised, let’s suppose in a 51% attack the intruder can make random transactions on that chain.
  • Then when you go one step deeper the next thing that can happen is when the validators get compromised.
  • And at the core, there always exists a Smart contract that can get compromised and the attacker can get away with the available funds.

Bridges can transfer as many tokens as much value as you want. Being fully limitless is an appealing quality, but it can smoothly backfire if the security of the bridge gets compromised draining the whole token bridge in an instant time.

That’s where Wormhole did something. Since they’ve already been hacked once they built a solution for it.

Core Security Assumptions

At the core, Wormhole is secured by a network of Guardians nodes that validate and sign messages. If a super majority (e.g. 13 out of 19) Guardians sign the same message, it can be considered valid. A smart contract on the target chain will verify the signatures and format of the message before approving any transaction.

  • Wormhole’s core security primitive is its signed messages (signed VAAs).
  • The Guardian network is currently secured by a collection of 19 of the world’s top validator companies.
  • Guardians produce signed state attestations (signed VAAs) when requested by a Core Contract integrator.
  • Every Guardian runs full nodes (rather than light nodes) of every blockchain in the Wormhole network. This means that if a blockchain suffers a consensus attack or hard fork, the blockchain will disconnect from the network, rather than potentially produce invalid signed VAAs.
  • Any Signed VAA can be verified as authentic by the Core Contract of any other chain.
  • Relayers are considered untrusted in the Wormhole ecosystem.

Global Accountant

One of the most powerful aspects of the Wormhole ecosystem is that Guardians effectively have the entire state of DeFi available to them. The global accountant tracks the total circulating supply of all Wormhole assets across all chains and prevents any blockchain from bridging assets that would violate the supply invariant.

Simply put, it reduces the blast radius of the attack. When there is a problem with the near two avalanche bridges the most the hacker can take out is the value capped by that bridge. The problem with other bridges and also what happened to the wormhole previously was that by attacking once, all the liquidity everywhere could be accessed.

Wormhole didn’t become one of the longest-standing interoperability protocols without experiencing setbacks. That’s the expected cost of trailblazing. It’s how you react to those setbacks that matter. The hack of early 2022 propelled Wormhole forward, unlocking a flurry of innovation to fortify the protocol. Today, Wormhole has one of the best security programs in all of Web3.

A fun fact about the wormhole hack saga was that they managed to counter-exploit the hackers for $140 Million. Jump successfully counter-attacked the Wormhole Exploiter and retrieved the ETH that was stolen from it one year ago. After considering the DAI repayment to retrieve the collateral, the net return from the counter exploit was around $140M. More information here.

Vibrant Ecosystem:

Like other bridges wormhole is not lonely to build on. It gives you more composability, more liquidity, and more help.

Community is a MOAT in web3. As more and more people are getting involved with Wormhole, the community is continuously growing and will continue to do so. Currently, on their Discord server, there are already more than 218k+ members, and on Twitter more than 197k+ followers (!). What that means is, that a builder has better resources, more people to take inspiration from, and better help in terms of tools, documentation, and tutorials. The future scope is multi-chain composability and wormhole is the perfect place for builders to build with.

Tldr: All the cool kids are on Wormhole.

xDapps — The future of DApps

We talked about bridges and cross-chain building, but why does any of these matter? The real reason — xDapps.

Cross-chain functionality is made possible by this message-passing mechanism. To transfer the xAssets (cross-chain assets) between networks or access the xData (cross-chain data) to supply them with services on their present network, users interact with xDapps (cross-chain decentralized applications). xDapps are the type of chain-agnostic application that can take advantage of xAssets and xData — xDapps are any applications built using the prowess of Wormhole.

“Wormhole is a way for users to not care about developer choices.”

Consider you want to buy something on Amazon whose infra is built on AWS and your bank’s infrastructure is built on Google Cloud. It would be insane for you not to be able to buy from Amazon because you're bank used a different development infrastructure. That is the case currently, it is not easy to buy things on Solana with the money you have in Ethereum. xDapps — since it's cross-chain, solves this problem. In a nutshell, it makes the web3 UX feel like web2.

for example, an app running on Solana could accept direct Ethereum deposits! The developer only needs to integrate the Wormhole SDK into their front end, and the Portal Token Bridge will pick up the deposit and transfer it to the target chain, here Solana. So now you can buy this Amazon product from your Bank itself without having to care about what it's built on.

But, Why xDapps?

More chains, more users!

xDapps are built on top of Wormhole to function on multiple chains, simultaneously. The upshot for this is, that any user on any chain can use your product. We as developers just want users right, and bring the next billion people into crypto. So going into more chains is addressing more users, thus getting more users.

This is what we’ve seen from a bunch of projects. Sweat Economy (is a move-to-earn game) which now has over 140 Million users across web2 and web3. Their token SWEAT originally existed on the NEAR blockchain as a NEP-141 token. Since NEAR certainly doesn't have all the users, they used Wormhole to bridge over to Ethereum. It is now also accessible as a native ERC-20 token. That means people on Ethereum can directly use it and all the liquidity from Ethereum can be applied to Sweat Economy.

Sweat Economy

Use The Best Part Of Each Chain!

This is where Wormhole wins me. It sounds so cool and it's very practical, that you can use the best part of every chain and connect them across. Think of it like taking the culture and art from Europe, the diversity from the US, and the talent from India and building your perfect place.

In a practical sense, you can use Solana for execution as it is faster and cheaper, and then use Ethereum for settlements, use a different network for storage, and so on.

This is what Hashflow did. It’s a decentralized exchange designed for interoperability, zero slippage, and MEV production trades. They used the Wormhole core messaging layer in the backend to execute in different low-cost chains for swaps and Ethereum for finality. Doing this users on Hashlflow get a 50%+ reduction in fees.

All Chains, No pains!

Sticking to our analogy of building the perfect place with the best features of all over the world. In a regular setup, you would have to understand the culture and art of the UK and live in the US to identify the diversity and what to bring and work with Indians to acknowledge their talent. Similarly, if not wormhole you would have to know Rust for Solana, Solidity for Ethereum, and so on.

But Wormhole’s Ultralight Client allows you to write in your target chain language only, and then use TS/JS to work your way around other chains. So if you're base chain is Solana you will only have to know Rust.

Applications building on Wormhole:

The wormhole ecosystem is already pumping up with a plethora of applications, let’s discuss some of them one by one, category by category:

Core Layer

Allbridge:
Similar to the Portal bridge, Allbridge is a blockchain bridge that enables the transfer of tokens and/or arbitrary data between chains. Their other product, Allbridge Core, offers a one-click way to move native stable currency between chains without the need to wrap and unwrap the tokens first. Allbridge uses a cross-chain swap in the Wormhole core layer to carry out those “wrap-less” transfers.

xAssets

Friktion (a structured products platform on Solana) uses Wormhole’s Portal Bridge to enable its users to deposit assets from other chains like Avalanche and in the backend, it converts them to Solana Assets. It recently launched Volt#01 for APT bridged from Aptos to Solana via Wormhole.

Apart from friction, there are projects like Mango Markets, Solend, and Port Finance that also use the xAssets.

xChain

Sweat Economy:
It utilizes a variety of DeFi, NFT, on-chain, and off-chain incentives to reward people for their fitness activities. The simple model is to create value by rewarding good behavior — physical activity. Users of Sweat Wallet are rewarded with SWEAT tokens for every action they take. Only verified user movement is used to create SWEAT. The SWEAT coin becomes a true xChain asset thanks to Wormhole! While SWEAT originally existed as a NEP-141 token on the NEAR blockchain, it is now also accessible as a native ERC-20 token by using Wormhole.

Token Bridges:

  • Mayan Finance:
    A cross-chain exchange architecture allows EVM-based chains to access Solana protocols. The objective of Mayan is to make cross-chain swaps as simple as native swaps. Users can perform cross-chain swaps with a single click to execute this. Mayan built their own “Swap Bridge”, on Wormhole’s generic message-passing layer. While it uses the Serum order book to fulfill swap orders.
  • Nexa:
    A decentralized, cross-chain sale platform, to launch native, chain-agnostic assets. Nexa allows for xChain Token Sales (XTS) which is powered by Wormhole. Users from any chain can connect to their wallets and participate in an xChain Token Sale.

The Portal Bridge

The Wormhole Portal is the bridging application that is built upon Wormhole. In early 2022, the Wormhole team saw the necessity to have a clear distinction between the protocol itself (Wormhole) and a reference implementation for a native bridge built on top of it (Portal) — leading to the development of Portal. When you bridge tokens using Portal, the target chain creates a new Portal-wrapped token while locking the origin token in a smart contract (Mint and lock as we discussed earlier). On the target chain, you can exchange those for different or native tokens.

portal bridge powered by Wormhole
Portal TVL

On non-native chains, portal-wrapped assets have frequently gained canonical status. It is quite liquid to trade assets like wETH on Solana and wSOL on Ethereum, and these assets are fungible and exchangeable just like their native counterparts.

Closing Thoughts

A truly cross-chain universe enables a wider range of decentralized applications, assets, and composability across all dApps. Wormhole has the ability to Supercharge the user counts and protocol growth across the ecosystem.

Most people do not understand crypto tech, and we as developers shouldn’t need to care about that. We just need users, right? When a user doesn’t need to know the underlying tech while pressing the “Mint NFT’ button, then only a greater user base can enter crypto. If the experience is as seamless as using WhatsApp, and not like mining a bitcoin for normal people, we as crypto grow. With the siloed nations of the blockchain states coming together with bridges we need to make sure nothing gets lost in between, and everything is safe and secured. Because at the end of the day, if users lose money, that’s the ultimate bad user experience!

Just like globalization in the 1990s gave rise to the MNCs, we believe with cross-chain interoperability, cross-chain applications will enable anyone to experience the whole ascending Web3 world seamlessly with 100X better UX!

Thats it people!

This was a deep dive into the Wormhole and how we achieve the interconnected future. If you’ve read this far, thank you! And if it was helpful or want to suggest anything feel free to reach out to me at @Ronak0010 on Twitter.

Until then..

Resources:

  1. Wormhole docs
  2. What’s wrong with bridges?
  3. Wormhole Projects
  4. Wormhole Blog
  5. Wormhole Discord
  6. And a bunch of YouTube videos, Twitter accounts, and the fellowship program

--

--

No responses yet