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: 57.4%(+0.32%/24h)
ETH Dominance: 12.16%(-0.03%/24h)
Defi Market Cap: $117B(-31.99%/24h)
Total Market Cap: $3350.4B(-1.65%/24h)
Total Trading Volume 24h: $152.28B(-36.66%/24h)
ETH Market Cap: $407.37B
Defi to ETH Ratio: 28.72%
Defi Dominance: 3.35%
Altcoin Market Cap: $1427.2B
Altcoin Volume 24h: $106.93B
Total Cryptocurrencies: 32939
Active Cryptocurrencies: 10437
Active Market Pairs: 94985
Active Exchanges: 772
Total Exchanges: 9796
BTC: 97136.81$(-0.1%/1H)
ETH: 3381.27$(-0.37%/1H)
AVAX: 38.03$(-0.56%/1H)
BNB: 665.99$(-0.29%/1H)
MATIC: 0.49$(-0.4%/1H)
FTM: 1$(-0.81%/1H)
ADA: 0.91$(-0.77%/1H)
DOT: 7.11$(-1.15%/1H)
UNI: 14.04$(-1.26%/1H)
CAKE: 2.38$(-0.96%/1H)
SUSHI: 1.47$(-1.61%/1H)
ONE: 0.03$(-1.13%/1H)