Layer Zero
LayerZero is a messaging protocol, not a blockchain. Using smart contracts deployed on each chain, in combination with Decentralized Verifier Networks (DVNs) and Executors, LayerZero enables different blockchains to seamlessly interact with one another.
Getting Started
To start sending omnichain messages with LayerZero, you only need to implement two functions:
_lzSend
: This function is used to send a message to a different chain.
_lzReceive
: This function is used to receive a message from a different chain.
LayerZero offers Contract Standards that simplify this implementation by providing out of the box message handling, interfaces for custom protocol configurations, and other quality of life improvements:
Prerequisites
You should first be familiar with writing and deploying contracts to your desired blockchains. This involves understanding the specific smart contract language and the deployment process for those chains.
A wallet set up and funded for the chains you'll be working with.
Deploying your Contracts
Connecting your Contracts
To connect your contracts, call setPeer and pass the address of your destination contract as a bytes32 value, as well as the destination endpoint ID. If successful, you now should be setup to start sending cross-chain messages!
Last updated