A Developer’s Intro to Wormhole and Product Ideas
Building with Wormhole
Table of contents
· Background
· What is Wormhole?
∘ Into the Wormhole
· The Wormhole SDK
∘ Brief Exploration of Wormhole SDK
· Product Ideas to Consider
· Conclusion
Welcome! If you’re reading this, chances are you fit into one of these categories:
1. You’re a seasoned blockchain developer, someone who devours code day and night, building Dapps and products that potentially impact millions of users.
2. You’re a mid-level blockchain developer, comfortable with coding but always looking to expand your knowledge and skills.
3. You’re a beginner in blockchain development, You have some non-blockchain programming experience and you’re fresh off maybe a 5-hour YouTube tutorial on blockchain development, proud of your “hello world” program and a few hands-on practices and eager to dive deeper into blockchain development.
4. You’re a blockchain enthusiast, constantly seeking the latest in blockchain tech to stay ahead of the curve or impress your friends.
5. You stumbled upon this article, intrigued by the promise of learning something new and maybe sparking some creative inspiration.
No matter which group you belong to, or even if you don’t fit neatly into any of these categories, you’re in the right place! This article is your seamless introductory guide as a developer to getting started on Wormhole — a powerful open-source platform that enables developers to build multi-chain apps. We’ll dive deeper into wormhole later on. This article also offers exciting product ideas that can be explored and experimented with.
So, let’s get right into it, together!
Background
With each passing day, new blockchains are being created, each blockchain having their own unique ecosystem and assets that exist within them. These blockchains, while innovative, operate in isolation, unable to directly communicate with each other.
This isolation creates some limitations:
- Fragmented Innovation: some amazing applications (DApps) on one blockchain can’t interact with those on another, hindering the overall potential of the blockchain ecosystem.
- Inconvenient for Users: Moving valuable tokens (digital assets) between blockchains becomes a tedious task, requiring users to jump through hoops.
This is where Wormhole comes into play!
What is Wormhole?
Wormhole is a decentralized and open-source blockchain protocol that fosters interoperability by enabling blockchains to communicate with each other. It is a comprehensive message-passing protocol for blockchains. You can view Wormhole like the magic tool-kit that can be utilized to enable isolated blockchains work together. Developers can utilize Wormhole to build multichain apps.
But how does Wormhole do all of this anyway?
Into the Wormhole
Wormhole facilitates cross-chain communication by continuously observing various blockchains for messages originating from deployed smart contracts. This functionality is achieved through the Wormhole Core Layer, a fundamental smart contract present on each chain. This core layer acts as a message router, forwarding the received messages to their designated target chains. Explore more here.
The generic message-passing protocol of Wormhole, allows developers to send arbitrary data cross-chain, including tokens, NFTs, oracle data, governance decisions, and more. It is secured by the guardians, which ensures the security and reliability of the data being transferred across different blockchains. You can read extensively about the guardians here
It is important to note that Wormhole is not a blockchain itself, but it provides a means of communication between blockchains. It is designed to be easily extensible and upgradable, which allows for quick consensus, connects more chains, and enables developers to build on top of Wormhole easily.
Wormhole has been implemented in various ways, such as the Portal bridge and NFT bridge, which allow for seamless asset transfers across supported chains. It is currently connected to several high-value blockchains including Solana, Ethereum, Binance Smart Chain, Polygon, Avalanche, and Oasis.
Moreover, Wormhole provides developers with tools like Wormhole Connect, an in-app bridging widget that can be integrated in as few as 3 lines of code. This makes it easier for developers to build applications that can interact with multiple blockchains.
In the video below we see how drift protocol and Wormhole connect integrates in just a minute!
Wormhole has enabled dozens of projects to go interoperable, including PancakeSwap, SushiSwap, and Aave.
In terms of usage, the Wormhole network is trusted and used by teams like Circle and Uniswap, and to date, the platform has facilitated the transfer of over 35 billion dollars through hundreds of millions of cross-chain messages.
If you want to know and explore more, you can watch the video below!
Wormhole gives more:
- The Wormhole Fellowship Program: Wormhole empowers developers to contribute to the Wormhole ecosystem, promoting further development on the platform. Learn more
- The Wormhole Gateway: A specialized blockchain solution built using Cosmos SDK to connect blockchains supported by Wormhole with the broader Cosmos network. Learn more
So, now that we know what Wormhole is all about, it is time to utilize its power to do great things!. Let’s talk about the Wormhole Software Development Kit (SDK).
The Wormhole SDK
Wormhole offers an SDK for developers to build applications interacting with their protocol. This SDK simplifies interaction with Wormhole’s core functionality, which enables secure data transfer across various blockchains.
The SDK provides tools to interact with Wormhole smart contracts deployed on supported blockchains. Developers can leverage these contracts to send messages containing specific information: the originating blockchain (emitterChain), the originating address (emitterAddress), a designated level of data consistency (consistencyLevel), a timestamp, a unique message sequence number (sequence), and the actual data being transferred (payload).
When a message signifying a transaction is processed by a wormhole contract, the Guardians monitor the process. Once the transaction reaches the designated confirmation time on the originating blockchain (emitter chain), the Guardians generate a Signed Verifiable Action Approval (SignedVAA).
Verifiable Action Approvals (VAAs) serve as the foundation of the Wormhole ecosystem. They encapsulate messages generated by xDapps, along with details like the originating contract. Here, “xDapp” refers to a Decentralized Application that empowers users to interact with and potentially create “xData.” “xData,” on the other hand, signifies data residing on a layer outside of standard Layer 1 blockchains, accessible across all chains.
It is worthy of note that the prefix “x” consistently denotes key aspects within the Wormhole ecosystem. For instance, xChain signifies comprehensive cross-blockchain interoperability, while xAssets denote blockchain-agnostic tokens operating outside the blockchain framework. These tokens facilitate transactions across diverse blockchain platforms.
This extensive video below is a friendly guide on xDapp Development.
Brief Exploration of Wormhole SDK
Before we begin, It is important to be up to speed on some blockchain concepts, if you are not, you can visit here for an extensive and friendly guide!
- Installation
Let’s start by installing the Wormhole SDK. Follow these steps:
- Open your terminal or command prompt.
- Run the following command to install the SDK using npm:
npm i @certusone/wormhole-sdk
2. Configuration
Now that we have the SDK installed, let’s configure it. The Wormhole SDK relies on Remote Procedure call (RPC) nodes to communicate with the Wormhole network. Here’s how to set it up:
Mainnet Guardian RPC Nodes
const MAINNET_GUARDIAN_RPC: string[] = [
"", // WormholeScan explorer's guardian endpoint
"",
"",
];
Testnet Guardian RPC Nodes
const TESTNET_GUARDIAN_RPC: string[] = [
"", // WormholeScan explorer's guardian endpoint for testnet
];
Testnet Guardian Public Key
const TESTNET_GUARDIAN_PUBKEY: string = "0x13947Bd48b18E53fdAeEe77F3473391aC727C638";
3. Interacting with Wormhole
Let’s explore some common tasks using the SDK:
- Parsing VAAs (Verified Arbitrary Messages)
import { parseVAA } from "@certusone/wormhole-sdk";
const vaa = "0x…"; // Replace with an actual VAA
const parsedVAA = parseVAA(vaa);
console.log("Parsed VAA:", parsedVAA);
- Interacting with the Token Bridge
import { TokenBridge } from "@certusone/wormhole-sdk";
const tokenBridge = new TokenBridge(MAINNET_GUARDIAN_RPC);
const balance = await tokenBridge.getBalance("0x…"); // Replace with an address
console.log("Token balance:", balance);
- Submitting Messages
import { submitMessage } from "@certusone/wormhole-sdk";
const message = "Hello, Wormhole!";
const txHash = await submitMessage(message, TESTNET_GUARDIAN_PUBKEY);
console.log("Transaction hash:", txHash);
4. Example using the SDK
Here we explore using the SDK to communicate with different blockchain platforms and perform tasks like getting the balance of a token we have used (Evm, Solana and Algorand):
import { Wormhole, Signer } from "@wormhole-foundation/connect-sdk";
import { EvmPlatform } from "@wormhole-foundation/connect-sdk-evm";
import { SolanaPlatform } from "@wormhole-foundation/connect-sdk-solana";
import { AlgorandPlatform } from "@wormhole-foundation/connect-sdk-algorand";
// Include the protocols you wish to use
import "@wormhole-foundation/connect-sdk-evm-tokenbridge";
import "@wormhole-foundation/connect-sdk-solana-tokenbridge";
import "@wormhole-foundation/connect-sdk-algorand-tokenbridge";
const network = "Mainnet"; // Or "Testnet"
const wh = new Wormhole(network, [EvmPlatform, SolanaPlatform, AlgorandPlatform]);
// Get a ChainContext object for a specific chain
const srcChain = wh.getChain("Ethereum");
// Get the balance of a token
const balance = await srcChain.getBalance( "0xdeadbeef…", "native" ) // => BigInt
// Get a TokenBridge client for `srcChain`
await srcChain.getTokenBridge(); // => TokenBridge<'Evm'>
// Get an RPC client
srcChain.getRpc(); // => RpcConnection<'Evm'>
This is just a general overview, for more detailed information, Kindly refer to the Wormhole SDK documentation. Happy Coding!
Product Ideas to Consider
1. Automated Cross-chain arbitrage Platform
As the blockchain ecosystem continues to grow with multiple chains springing forth, so do the DEXs that exist within them grow too. This gives room for broader asset accessibility and diversity. Arbitrage opportunities also arise based on this expansion.
This empirical study highlights in detail the potentials that exist from cross-chain arbitrage.
Based on this discovery, what if we built an extensive automated arbitrage platform that is highly user-friendly and allows users to take advantage of arbitrage opportunities that could exist across multiple chains?
How would it work?
On the platform:
- User selects token/s to automate
- User Selects the chains and DEXs
- User selects other parameters such as the duration of the automation.
- The token is locked in a smart contract
- The platform takes care of the rest based on defined user input
- The token is unlocked to the user
- The user receives profit
2. Wormhole + DePIN solutions
Decentralized Physical Infrastructure Network (DePIN) has been on the rise recently. DePIN is a peer-to-peer network that utilizes blockchain technology and cryptocurrency incentives to build, maintain, and operate real-world physical infrastructure in a distributed and open manner. DePINs connect users with service providers offering resources like data storage, computing power, wireless connectivity, and more.
DePINs are categorized into two groups; Physical Resource Networks (PRNs) which focus on location-specific infrastructure like energy grids or wireless networks and Digital Resource Networks (DRNs) which provide location-independent resources like cloud storage or bandwidth. You can read more on DePIN here.
Many DePIN innovations are isolated on specific blockchains and combining Wormhole’s interoperability powers with DePIN infrastructures could break this “isolation” and give room for further innovations. Here are some ideas that could explored:
- DePIN Interoperability Suite: This suite would offer developers tools and functionalities to build multichain DePIN applications. It would leverage Wormhole’s interoperability features and integrate with various DePIN protocols. Developers could use the suite to create dApps for resource management, tokenization of physical assets, and reputation systems for DePIN service providers.
- Tokenized Connectivity Marketplace: This product would focus on DePINs offering internet connectivity. Users could purchase mobile data, broadband access, or other connectivity services from various DePIN providers. Wormhole would enable tokenized payments and secure service provisioning across different blockchain networks used by these providers.
3. Cross-chain fractionalization [ Focus: Real estate ]
Real estate traditionally has low liquidity. By enabling tokens representing fractional ownership to move across different blockchains or be represented across different blockchains, you can tap into a wider pool of investors, improving liquidity for both the property and the tokens themselves.
How would it Work?
- Tokenization on Issuing Chain: The real estate asset is tokenized on a blockchain (e.g., Ethereum) suitable for the issuance and management of the fractional tokens.
- Wormhole Bridge Integration: A Wormhole bridge is deployed on the issuing chain and the target chain (where the fractional tokens will be traded).
- Fractional Ownership Representation: Smart contracts manage the fractional ownership on the issuing chain. Each token represents a specific percentage ownership stake in the real estate. This percentage can even be tokens on different chains i.e. A single property is owned in specific percentages across different blockchains. [ For example; 50% ownership with Ethereum based token, 50% ownership with Solana based token, by two different owners ].
- Cross-chain Movement: Wormhole’s SDK is used to develop a bridge application that allows users to securely transfer their fractional ownership tokens between the issuing chain and the target chain.
4. Interoperable prediction markets
Many prediction markets are often limited to a single blockchain, hindering user participation and potential market size.
What to do?
Develop a prediction market platform that leverages Wormhole for cross-chain participation. Users could wager on events using tokens from their preferred blockchain, while the platform ensures secure settlement regardless of the chosen chain.
5. Cross-Chain Credential Wallet with Gamification
Build a gamified, cross-chain credential wallet that allows users to collect, manage, and showcase achievements (NFTs) earned across various blockchain ecosystems.
By integrating Wormhole, the app can enable users to:
- Collect and manage NFTs representing achievements (e.g., badges, loyalty points) earned on different blockchains.
- Display a unified profile showcasing their overall accomplishments across various ecosystems.
Gamification Elements:
- Cross-chain Leaderboard: Earn points for completing tasks and collecting NFTs across different blockchains. Climb the leaderboard to compete with others and gain recognition.
- Challenge Quests: Participate in multi-chain challenge quests that involve completing tasks on different blockchains. Earning NFTs for completing these quests can enhance your profile and unlock special features.
- Interoperable Reputation System: Build a reputation score based on your cross-chain achievements. This score can be used to gain access to exclusive communities, discounts, or airdrops across various blockchain platforms.
Technical Implementation with Wormhole:
- Utilize Wormhole SDK to enable:
— Secure transfer of achievement NFTs between blockchains.
— Verification of the authenticity and ownership of these NFTs across different ecosystems.
- Develop a reputation scoring system that considers the value and rarity of cross-chain achievements.
Think of Galxe, but slightly enhanced.
Conclusion
Wormhole presents a powerful solution for developers to break down blockchain isolation and build innovative multi-chain applications. This article provided a comprehensive introduction to Wormhole, its functionalities, and its potential. We also explored exciting product ideas that leverage Wormhole’s interoperability features. With Wormhole’s capabilities at your fingertips, the possibilities for creating groundbreaking blockchain applications are limitless. So, what will you build first?
Keep up with wormhole: Twitter, Youtube, Discord, Blog
Notes: This write-up offers compelling insights to building with Wormhole. It is not to be taken as financial advice.
References: All sources consulted are duly hyperlinked.