Introduction to Moonbeam
At its core, Moonbeam is a smart-contract platform on Polkadot that serves as a developer-focused bridge to and from other blockchain ecosystems — most notably Ethereum, but also Cosmos, Solana, Avalanche and others — and provides a channel into the Polkadot network for applications based in other connected ecosystems. It also operates a Kusama equivalent platform known as Moonriver.
As an Ethereum Virtual Machine (EVM) compatible Substrate chain, Moonbeam can execute Ethereum-based smart contracts and decentralised applications (dApps) natively; meaning Ethereum projects can be migrated to Polkadot and interact with the ecosystem’s parachains and more with minimal modification.
The remainder of this article explores Moonbeam’s role as a cross-chain hub for Polkadot, spotlighting its functionality as a gateway for applications from various ecosystems into the Polkadot network. Readers will gain insights into how Moonbeam facilitates cross-chain interoperability, and the benefits it delivers for developers, users as well as parachains and the Polkadot ecosystem as a whole.
What Are Cross-Chain Connected Applications?
In essence, being cross-chain connected means that dApps can utilise smart contracts to interact and exchange data or assets with each other, without the need to first bridge assets over. These cross-chain smart contracts communicate behind the scenes to enable applications to track resources (data, assets, etc.) and users to access and utilise functionalities across the connected ecosystem. In other words, this means that users can play around with applications built on Moonbeam and at the same time work with any of the assets made available from the cross-connected blockchains.
For example, instead of bridging tokens from one chain to another for use in DeFi applications, the smart contract could lock tokens on one chain and allow their use on another from where they are (no bridging or moving the tokens). Rather than needing multiple isolated protocols, a cross-connected lending and borrowing application would instead allow smart contracts to access collateral on any chain, because it would be visible and usable through the cross-chain connection.
The importance of cross-chain connected applications lies in their ability to broaden the scope of blockchain applications, making them more versatile and accessible. By allowing assets and data to move freely between chains, they address critical challenges like liquidity fragmentation and the complex user experience of operating in multiple blockchain environments. This might seem like an obvious necessity, but interoperability has remained one of the fundamental challenges in the blockchain space, where siloed networks have long operated more or less independently of each other, limiting the flow of information and value. Much progress has been made in this area, and Moonbeam has arguably remained Polkadot’s most important piece thus far for channelling outside liquidity and applications into the Polkadot ecosystem.
Moonbeam’s Role in Cross-Chain Applications
Moonbeam continues to be instrumental to the development and operation of cross-chain connected applications in Polkadot and has remained the main channel for external liquidity and applications coming into the ecosystem. Moonbeam’s value provision can be said to rest on three fundamental pillars in particular:
- EVM Compatibility: Allows Ethereum-based dApps to run on the Polkadot network without major modifications, bridging the largest smart contract community with Polkadot’s multi-chain environment.
- Polkadot’s Cross-Consensus Messaging (XCM): Enables Moonbeam to communicate with other parachains in the Polkadot network to facilitate data and asset transfers.
- External Cross-Chain Protocols: Beyond Polkadot’s native capabilities, integrating with other cross-chain messaging systems like Axelar, LayerZero, deBridge and Wormhole provides extended reach to other major blockchains.
For Ethereum developers, the process of creating cross-chain connected applications on Moonbeam offers not only a familiar development environment with a reduced (re-)learning curve and quicker deployment; but, importantly, a practical entry point into the Polkadot ecosystem and beyond. By setting up “outposts” on Moonbeam, Ethereum dApps can extend their product and service offerings to Polkadot users while leveraging the existing Ethereum development toolkit.
Being able to tap into different features and utilities from across other chains and dApps also encourages developers to let their creativity flow when thinking about their project’s functionalities; and in so doing, promote a richer, more innovative ecosystem of user dApps operating and benefiting from cross-chain symbiosis. By unifying fragmented blockchains, there are three major benefits coming from Moonbeam:
As a case in point, the world’s largest decentralised exchange (DEX) by trading volume, Uniswap, was plugged into Moonbeam in May last year (Cointelegraph, 2023), allowing both Pölkadot’s parachains and users to benefit from Uniswap’s financial products and services.
XC-20 Tokens and Moonbeam Routed Liquidity
To facilitate the transfer of assets between Ethereum and Substrate-based blockchains like those in the Polkadot and Kusama ecosystems, Moonbeam has developed a unique asset type, XC-20s, which are fungible tokens that are compatible with both the EVM and Substrate environments. XC-20s are minted directly on Moonbeam or Moonriver through smart contracts and function like regular ERC-20 tokens on Ethereum yet are enhanced with Polkadot’s XCM functionality, which means they can be seamlessly moved and utilised within the Polkadot and Kusama networks.
When ERC-20 tokens are brought onto Moonbeam, they’re not locked or wrapped in the traditional sense. Instead, through Moonbeam’s infrastructure, these tokens are directly recognised and usable within the Polkadot ecosystem as XC-20 tokens — bypassing the need for creating wrapped versions of the token on the new network. In doing so, Moonbeam is able to remove the common risk vector of wrapped assets in cross-chain transfers.
As such, instead of complex and custom bridge integrations, developers can deploy tokens on Moonbeam or Moonriver using familiar ERC-20 standards, and these tokens automatically acquire the ability to interact with other parachains through XCM. Using bridges to wrap tokens also introduces additional security considerations, as it relies on the bridge’s security, where vulnerabilities in the bridge’s smart contracts or infrastructure can potentially jeopardise the wrapped assets. XC-20 tokens, by leveraging the inherent security features of the Polkadot network, reduce the attack surface and the associated risks of token bridging.
As such, XC-20 tokens bring several advantages to cross-chain assets:
- Native Cross-Chain Functionality Without Wrapping
- Simplified Developer and User Experience
- Enhanced Security
- Direct Interoperability within Polkadot
Utilising technologies like the XCM protocol and XC-20 tokens in conjunction with other bridge protocols, Moonbeam can route liquidity via its platform to and from any of the chains connected to its ecosystem — referred to as Moonbeam Routed Liquidity (MRL). Importantly, MRL helps address one of the core problems in the crypto space thus far: liquidity fragmentation, which happens when assets are spread out across different chains, making them less useful because they can’t easily interact with each other.
Transferring native assets between parachains, such as Moonbeam and HydraDX, a communication channel known as HRMP (Horizontal Relay-routed Message Passing) needs to be established to enable the transfer of XCM assets. When the native tokens are sent to HydraDX, it’s received in Moonbeam’s dedicated account on HydraDX, where a corresponding token is then minted for the user. This same method applies universally across parachains.
Similarly, to enable cross-chain transfers from ecosystems outside of Polkadot, parachains are required to have a so-called sovereign account on Moonbeam, where the XC-20 tokens coming through the bridging protocol (like Wormhole) can be stored (locked). Once tokens have been locked on Moonbeam and the transfer message has been sent to the destination parachain, the same parachain then mints a corresponding XC-20 token. This minting process is seamlessly integrated into the execution of the XCM message within the destination parachain, ensuring the tokens’ functionality is preserved in their new blockchain environment.
When sending ERC-20 tokens from Ethereum to parachains via Moonbeam, the tokens are initially directed to Moonbeam and subsequently routed to the target parachain using Moonbeam’s Routed Liquidity feature. On Moonbeam, ERC-20 tokens are inherently equipped for XCM, making them convertible to XC-20s on any parachain they’re registered with, thereby appearing as XC-20 tokens under HydraDX’s sovereign account.
For users, this means that in practice they can move, as if directly connected, any supported tokens to and from protocols that leverage MRL, with HydraDX being the first Polkadot parachain to utilise MRL. For example, ERC-20 assets sitting on Ethereum can seamlessly be transferred onto HydraDX (or any other parachain or Moonbeam-connected ecosystem for that matter) via Wormhole. Vice versa, Polkadot-native tokens can also be moved to Ethereum. A simplified outline of this process would roughly unfold as follows:
- Initiate Transfer: Users start the process by deciding to move assets from Ethereum to a Polkadot network destination, such as HydraDX.
- Bridge Approval: The chosen bridge protocol, initially Wormhole, reviews and approves the asset transfer request from Ethereum to Moonbeam.
- Locking and Minting XC-20 Tokens: Upon approval, the ERC-20 assets are transferred to Moonbeam, where they are locked in a dedicated account for the destination parachain. Subsequently, the destination parachain mints a representative XC-20 token, signifying the successful transfer.
- Asset Movement via XCM: The newly minted XC-20 tokens can then navigate the Polkadot ecosystem, reaching their intended parachain destination.
While Wormhole was the first major cross-chain bridge protocol to integrate with MRL, the technical configuration on Moonbeam’s side means that any external bridge system or ecosystem could, in theory, connect as long as there is so-called “General Message Passing” compatibility. Hence, MRL provides a bridge between Polkadot’s non-EVM parachains and those externally connected via third-party bridges.
And so, we can summarise the key benefits of MRL in three simple points:
Conclusion
Moonbeam has established itself as a vital entry point into the Polkadot ecosystem, enabling seamless interaction to and from various blockchain ecosystems such as Ethereum, Cosmos, Solana, Avalanche, and others. Its EVM compatibility facilitates direct migration and operation of Ethereum-based dApps on Polkadot, offering developers and projects a pathway to engage with Polkadot’s multi-chain environment with minimal adjustments.
This article has delved into the mechanics and advantages of cross-chain connected applications, highlighting Moonbeam’s essential role in broadening the accessibility and functionality to and from these highlighted blockchains. By supporting cross-chain interoperability, Moonbeam not only addresses challenges like liquidity fragmentation and the complexity of operating across diverse blockchain environments but also unlocks innovative possibilities for dApps by leveraging the unique features of multiple blockchains.
By streamlining the movement of assets across different blockchains through the implementation of XC-20 tokens and the development of Moonbeam Routed Liquidity, Moonbeam will continue to play an important role in addressing the challenges of cross-chain liquidity and interoperability in the Polkadot ecosystem, enhancing the utility and efficiency of the broader network.