Moonbeam Integrates Layer Zero

Published on: 25.11.2022
Moonbeam Integrates Layer Zero

Moonbeam integrates Layer Zero. Moonbeam has extended the built-in interoperability of parachains on Polkadot to remote blockchains with connected contracts, which have been further boosted with a new protocol, LayerZero.

Connected contracts allow smart contracts to communicate with each other across chains, opening the possibility for multichain-aware dApps. Moonbeam’s first integration for connected contracts was Axelar.

LayerZero is designed to be a lightweight interoperability protocol for cross-chain message passing. Benefits of LayerZero’s connected contract design include nonce-ordered messages and configurable trustlessness. In addition, by using LayerZero’s connected contracts solution, developers can build dApps that can tap into functionality from Polkadot, Ethereum, Avalanche, Swimmer, and beyond.

Multichain dApps are currently unified interfaces for protocols duplicated across multiple EVMs. Protocols will be able to connect their contracts cross-chain using LayerZero’s message passing to become multichain-aware, allowing for advanced interoperability and functionality between what would otherwise be isolated ecosystems.

Intro to LayerZero

LayerZero is a trust-configurable protocol that provides secure cross-chain communication. Ultra-light nodes (ULN) in the form of smart contracts. Provide chains with the block headers of other bridged chains, but only on-demand for efficiency purposes. The LayerZero endpoint, which is a smart contract that houses the ULN, communicates with an oracle and a relayer.

Furthermore, the Oracle component provides and receives block headers. Applications can select from a marketplace of oracles, including Chainlink, and design the oracle component to require agreement from multiple entities.

Furthermore, block headers are published to destination chains, which allow for the on-chain verification of messages. The Relayer receives and provides proofs of cross-chain messages, which can be verified by block headers. Allowing for messages to be completed on destination chains. Relayers can be maintained by anyone. In practice, however, LayerZero manages a relayer service that applications can leverage today.

Over the next few months, an open-source implementation of the relayer will create a marketplace of relayers for applications to select from and design further decentralized relayer systems similar to that of the Oracle component. The safety of the system relies on the separation between the oracle and relayer systems, and thus the trustlessness of the system is inherited from how much trust is required from the relayer and oracle actors.

This simple smart contract example will only be concerned with one smart contract, NonblockingLzApp. This smart contract will interact with the LayerZero endpoint to receive and send messages, and also stops failed transactions from blocking future messages from being received.

Connected SimpleGeneralMessage Contract

Notice that NonblockingLzApp inherits from LzApp. To understand the difference between these two contracts, first know that if any connected contract receives a message from LayerZero, and when receiving that message, an uncaught exception occurs, no other messages can be received from LayerZero.

In such an instance, the message that causes the exception is blocking other messages from being received, and will not stop blocking until the message stops causing an exception. Failed messages are blocked when inheriting from LzApp, but by using NonblockingLzApp, all exception-causing messages are elegantly caught automatically.

ABOUT Moonbeam

Moonbeam simplifies the developer experience by combining full Ethereum compatibility with the power of Polkadot, including scalability, cross-chain integrations, and on-chain governance.

Website | Twitter

ABOUT Layer Zero

Layer Zero is a user application configurable on-chain endpoint that runs a ULN.  The platform relies on two parties to transfer messages between onchain endpoints. The Oracle and the Relayer.

Website | Twitter

RESOURCES

Moonbeam Network

REQUEST AN ARTICLE
Market Stats:
BTC Dominance: 60.71%(+0.21%/24h)
ETH Dominance: 13.09%(-0.10%/24h)
Defi Market Cap: $65.9B(+2.82%/24h)
Total Market Cap: $2244.34B(+0.08%/24h)
Total Trading Volume 24h: $79.45B(+13.02%/24h)
ETH Market Cap: $293.72B
Defi to ETH Ratio: 22.44%
Defi Dominance: 2.75%
Altcoin Market Cap: $881.74B
Altcoin Volume 24h: $37.75B
Total Cryptocurrencies: 32042
Active Cryptocurrencies: 9931
Active Market Pairs: 87472
Active Exchanges: 761
Total Exchanges: 9516
BTC: 68880.65$(0.3%/1H)
ETH: 2440.31$(0.58%/1H)
AVAX: 23.18$(0.33%/1H)
BNB: 560.31$(0.38%/1H)
MATIC: 0.3$(0.21%/1H)
FTM: 0.57$(0.1%/1H)
ADA: 0.33$(0.19%/1H)
DOT: 3.83$(0.44%/1H)
UNI: 6.93$(0.56%/1H)
CAKE: 1.61$(0.09%/1H)
SUSHI: 0.62$(0.33%/1H)
ONE: 0.01$(0.15%/1H)