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: 53.41%(+0.11%/24h)
ETH Dominance: 16.2%(+0.04%/24h)
Defi Market Cap: $88.85B(-6.36%/24h)
Total Market Cap: $2383.24B(+0.80%/24h)
Total Trading Volume 24h: $82.01B(-2.32%/24h)
ETH Market Cap: $386.07B
Defi to ETH Ratio: 23.01%
Defi Dominance: 3.54%
Altcoin Market Cap: $1110.28B
Altcoin Volume 24h: $49.31B
Total Cryptocurrencies: 29413
Active Cryptocurrencies: 9846
Active Market Pairs: 82422
Active Exchanges: 753
Total Exchanges: 8383
BTC: 64652.68$(-0.34%/1H)
ETH: 3162.71$(-0.59%/1H)
AVAX: 35.7$(-1.39%/1H)
BNB: 613.3$(-0.19%/1H)
MATIC: 0.72$(-0.79%/1H)
FTM: 0.76$(-3.14%/1H)
ADA: 0.47$(-0.93%/1H)
DOT: 6.88$(-1.21%/1H)
UNI: 7.92$(-0.8%/1H)
CAKE: 2.81$(-0.95%/1H)
SUSHI: 1.03$(-0.82%/1H)
ONE: 0.02$(-1.18%/1H)