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: 59.3%(-1.26%/24h)
ETH Dominance: 12.34%(+0.56%/24h)
Defi Market Cap: $91.92B(+28.00%/24h)
Total Market Cap: $3301.85B(+4.03%/24h)
Total Trading Volume 24h: $241.86B(+21.71%/24h)
ETH Market Cap: $407.55B
Defi to ETH Ratio: 22.55%
Defi Dominance: 2.67%
Altcoin Market Cap: $1344.01B
Altcoin Volume 24h: $146.3B
Total Cryptocurrencies: 32361
Active Cryptocurrencies: 10162
Active Market Pairs: 90718
Active Exchanges: 762
Total Exchanges: 9610
BTC: 98917.65$(-0.01%/1H)
ETH: 3379.75$(-0.21%/1H)
AVAX: 36.4$(0.05%/1H)
BNB: 632.37$(-0.54%/1H)
MATIC: 0.47$(-1.24%/1H)
FTM: 0.72$(0.02%/1H)
ADA: 0.88$(0.04%/1H)
DOT: 6.24$(0.55%/1H)
UNI: 9.37$(-0.44%/1H)
CAKE: 1.99$(0%/1H)
SUSHI: 0.8$(0.27%/1H)
ONE: 0.02$(1.66%/1H)