NAVIGATING THE WORMHOLE: A Developers Intro To The Interoperability Realm and Product Ideas To Build

Harvesto Orlando
Coinmonks
7 min readMar 22, 2024

--

Not all crypto projects meet expectations and keep their promises, especially in the cross-chain ecosystem. That said, Wormhole has succeeded in cementing itself as the crème de la crème of the interoperability industry. Like a literal wormhole, its powerful gravitational force effortlessly attracts the best projects and groundbreaking technologies into its vast cosmos.

What started in 2020 as a bidirectional, decentralized ERC-20 ⇄ SPL token bridge between Ethereum and Solana has today grown to support $40B+ worth of value transfer, 1B+ cross-chain messages, 200+ dapps utilizing the messaging daily, six runtimes and 30+ blockchains supported.

Now, Wormhole’s feats are super impressive, especially in a span of four years. Of course, there are other interoperable protocols like Moonbeam and Hyperlane. That said, Wormhole is miles apart from them, in my opinion. Before we learn how to build on Wormhole, let us look at why Wormhole exists.

Why Wormhole? The Interoperability Problem Solved

Firstly, I want to debunk users’ and developers’ misconceptions about Wormhole.

Wormhole is not a bridge…

I know many people believe “Wormhole is just a bridge.”

But its purpose is more than that of a bridge. In fact, if you have never used the Wormhole bridge but use dapps, I bet you have used Wormhole before now.

How so?

Apart from the projects in the Wormhole ecosystem, many projects integrate Wormhole regardless of their chain.

Think of Wormhole as the ferry that can take you through the canal to your destination.

Only there are many destinations and, therefore, many canals in the blockchain world…

There are even rivers, seas, and oceans. But don’t worry. Wormhole, just like the phenomenon it derives its name from — the Wormhole — is a shortcut that connects distant blockchains efficiently.

From here, developer-specific concepts take over. 👇🏼

As you know, there are a plethora of dapps on many blockchains: NFT protocols, DEXes, DAOs, borrow-lend platforms, Web3 games, metaverse platforms, etc. You may have built one or more of the above in any available blockchains.

Since you have, you understand the need for cross-chain communication and assets. You also know that native dapps and assets are siloed away and can only be used in the blockchain’s ecosystem. They are locked in and unable to communicate with other assets of their kind. This reminds me of Rapunzel locked up in the tower, waiting for her knight in shining armour to rescue her.

While Wormhole isn’t a knight in shining armour, it still aids developers in transferring value and information across multiple chains.

Wormhole ultimately wants to achieve cross-chain singularity. This communication system allows developers like you to enjoy the unique benefits of as many blockchains as possible, making your creation process richer, more scalable, flexible, and user-friendly.

Might I add: Wormhole eliminates the need to rely on a single point of failure.

How Wormhole does that ⬇️

On the surface level, Wormhole leverages its guardians to validate each cross-chain message, ensuring the communication is accurate and secure.

Why does Wormhole need Guardians, and what do they do?

Firstly, Wormhole 19 guardians achieve a cross-chain settlement, eliminating third-party/centralized interference. Secondly, they serve as validators of messages they observe on each connected chain by running a full node for each chain to monitor the Wormhole Core contracts. A message could be from the Portal token bridge or any app integrated with Wormhole on their source chain.

For a message to be valid, ⅔ of the Guardians need to sign it, which produces a VAA (Validator Action Approval) — a combo of the message and signatures. Each legitimate message is then sent to the destination chain, where they facilitate the app’s intended action (wrap a token, count a vote, update a price, etc.).

Apart from the noble guardians, Wormhole also leverages smart contracts (of course), oracles, and cross-chain message passing (XCMP) like Solana’s XCMP.

Getting Started with Wormhole for Developers

Now, say you are raring and ready to start building cross-chain dapps…

What do you do? Where do you start from?

Well, there is a basket of options to get started.

You can start from Wormhole SDKs, the cross-chain set of tools, libraries, and documentation provided by Wormhole. I like Wormhole SDK because it easily integrates and supports various programming languages. Additionally, it has extensive documentation that anyone can easily understand and build on Wormhole.

If you’re a builder who likes to build with the community, it is a perfect fit for you as you can build while engaging with them through the forum, discord chat channels, and developer meetups where you can get valuable insights, support, and collaboration opportunities during development.

Moving on, the documentation page has more developer resources (off-chain and on-chain message-passing tutorials and guides).

Beginner’s Guide to Cross-Chain Development

Step 1: Set up your development environment

Before you start, you will need Node.js and npm installed on your computer. Then, a code editor like Visual Studio Code to write your javascript code.

Step 2: SDK Installation:

After setting up your environment, Open your terminal and go to its project directory. Use npm to install the SDK with this command:

npm install @certusone/wormhole-sdk

Step 3: Import the SDK module

In your Javascript file for Wormhole, import the SDK module by using the require function:

const Wormhole = require('@certusone/wormhole-sdk');

Step 4: Establish Wormhole

In your terminal, create a new instance of the Wormhole SDK and configure it with the correct network settings. You can choose between working on the testnet or mainnet. For testnet:

const wormhole = new Wormhole({

network: 'testnet', // or 'mainnet'

rpcURL: 'https://api.testnet.wormholescan.io',

});

For mainnet, replace ‘testnet’ with ‘mainnet’.

Step 5: Implement Token Transfer Functionality on your dapp

Now, let’s create a function that allows your users to transfer tokens. This functions involves parameters like the sender’s address, recipient address and tokens to transfer.

async function transferTokens(senderAddress, recipientAddress, amount) {
try {
// Specify the token contract address
const tokenAddress = 'YOUR_TOKEN_ADDRESS';
// Provide the private key of the sender's wallet
const senderPrivateKey = 'SENDER_PRIVATE_KEY';
// Initiate the token transfer using Wormhole
const result = await wormhole.transfer({
tokenAddress,
senderPrivateKey,
recipientAddress,
amount,
});
console.log('Token transfer successful:', result);
} catch (error) {
console.error('Error transferring tokens:', error);
}
}

Make sure to replace ‘YOUR_TOKEN_ADDRESS’ with the actual token contract address and ‘SENDER_PRIVATE_KEY’ with the correct private key.

Step 6: Call the Transfer Function

After that, call the transferTokens function with the appropriate parameters.

const senderAddress = 'SENDER_WALLET_ADDRESS';
const recipientAddress = 'RECIPIENT_WALLET_ADDRESS';
const amount = 100; // Specify the amount of tokens to transfer

transferTokens(senderAddress, recipientAddress, amount);

Replace ‘SENDER_WALLET_ADDRESS’ and ‘RECIPIENT_WALLET_ADDRESS’ with the respective wallet addresses of the sender and recipient.

Voila!

After you have set up the SDK, it’s time to explore additional features and integrations to enhance your dapp in the Wormhole documentation.

Note: Now that you have set up the Wormhole SDK, you can build and do many things apart from normal cross-chain messaging and transfers.

For example, if you’re building a DeFi project that relies on stables like USDC, you can use Wormhole Connect or the Wormhole Connect SDK. Wormhole Connect supports fast, cheap, native USDC bridging between all networks supported by Circle’s Cross-chain Transfer Protocol — Circle’s native USDC attestation service. The CCTP protocol is separate from Wormhole, but Wormhole added features to make it simpler. This includes automated relaying, gas payment on the destination chain, gas drop-off, etc.

You can use Wormhole’s CCTP-Powered USDC bridging by embedding the Connect Widget or integrating the Connect SDK directly.

Building on Wormhole is a rich experience. Apart from the SDK, community support, and developer resources, I want to highlight another benefit accrued to devs who build on Wormhole:

Wormhole Foundation’s xGrants Program.

The xGrants program is a grant for projects and communities broadly working on taking crypto cross-chain. Whether you want to develop xdapps, integrate Wormhole, contribute technical content, or build dev tooling and community initiatives, Wormhole welcomes you and promises to support your hard work.

What you can build with Wormhole technology (Innovative product ideas)

  • Multi-chain yield aggregator: Leveraging the Wormhole framework, users can maximize their returns by automatically moving assets to where the best yields are. This product benefits the Wormhole ecosystem by providing users with a seamless cross-chain yield optimization solution, meaning they can access and capitalize on lucrative yields.
  • Interoperable gaming platform: Create a gaming metaverse that spans multiple blockchain networks, allowing players to interact with their favourite virtual assets and environments across different chains. This product bridges gaming experiences and economies by leveraging Wormhole, creating an interconnected experience that didn’t exist before.
  • Cross-chain NFT bridge and marketplace: Imagine Magic Eden or Opensea but cross-chain. Users can mint, trade, and transfer their NFTs across multiple networks. Doing so expands the reach and liquidity of NFTs, creating a more vibrant NFT ecosystem.
  • Cross-chain synthetic assets protocol: This one is a no-brainer as users can create and trade synthetic assets across blockchains. For example, I can mint synthetic assets pegged to real-world assets on one chain and trade them on another, providing exposure to diverse assets and markets.
  • Cross-Chain borrowing/lending DEX: Users can borrow assets from one chain to another, collateralizing assets on one chain and borrowing assets on another, with interest rates and loan terms enforced by smart contracts.

For more ideas on what the ecosystem needs, you can check this Github repo.

Final Words

The concept of interoperability has the potential to redefine how we use and interact with blockchain technology while shaping its future. By leveraging interconnectedness, digital ecosystems can collaborate to drive blockchain innovation, efficiency, and growth.

Wormhole technology enables seamless integration and interaction between entities, bridging gaps and solving existing interoperability problems. This problem-solving can take different forms, such as a single project integrating and offering a suite of interconnected products or multi-project ecosystems where projects collaborate to offer more blockchain services. In both cases, the focus should be on creating a network where all participants contribute and benefit from mutual success.

So, dear Devs, let us keep journeying through the Wormhole and exploring the infinite possibilities of building a more interconnected and vibrant blockchain ecosystem!

--

--

Harvesto Orlando
Coinmonks

I write well-researched, engaging, opinionated articles on the applications of blockchain and crypto... Open to Copywriting opportunities.