Skip to main content
Version: Endpoint V2 Docs

LayerZero Documentation

LayerZero is an omnichain interoperability protocol that enables seamless communication between different blockchains. It allows developers to build omnichain applications (OApps) that can interact across multiple chains as if they were on a single chain.

All core protocol contracts are immutable and non-upgradeable, ensuring you never face unplanned changes from the protocol. Application contract owners have the flexibility to define, customize, and lock configurations, allowing them to optimize security and cost according to their specific needs.

LayerZero OApp

Why LayerZero?

Before LayerZero, developers had to choose a single blockchain for their applications, limiting their reach and functionality. Existing cross-chain solutions frequently rely on centralized intermediaries or fragmented bridges, introducing security risks, a poor user experience, and fragmented liquidity. LayerZero solves these problems by providing a secure, efficient, and user-friendly way to build truly omnichain applications.

With LayerZero, you can:

  • Reach more users: Deploy your dApp on any supported chain, interacting with users and assets across all other supported chains.
  • Unify liquidity: Avoid breaking up liquidity across multiple blockchains, allowing your dApp to harness a shared liquidity pool.
  • Simplify development: Build as if you're deploying on a single chain, using familiar tools and programming languages.
  • Enhance security: Benefit from a decentralized, independently configurable security model (Decentralized Verifier Networks, or DVNs).
  • Improve user experience: Offer seamless cross-chain interactions without requiring users to understand underlying complexities.

Use Cases

LayerZero unlocks a wide range of possibilities for decentralized applications, including:

  • Omnichain tokens: Create and manage tokens that are available on multiple chains with a unified supply.
  • Cross-chain lending and borrowing: Lend on one chain and borrow on another, all within a single transaction flow.
  • Unified liquidity DEXes: Aggregate liquidity from multiple chains to provide deeper liquidity and better prices.
  • Omnichain NFTs: Mint, transfer, and manage NFTs across different chains while preserving ownership records.
  • Cross-chain governance: Allow governance protocols to operate across multiple chains for broader participation.
  • Cross-chain gaming: Build games that leverage assets and functionalities from different chains, enriching gameplay experiences.
  • Cross-chain data queries: Securely read real-time state from multiple networks, such as price feeds or contract balances, to trigger onchain operations like rebalancing liquidity pools, adjusting lending parameters or executing conditional logic across chains.

Quick Start Guide

Ready to start building with LayerZero? Here’s your roadmap:

1. Choose Your Environment

2. Build Your First OApp

3. Understand Core Concepts & Architecture

  • Protocol Overview: Understand how messages flow between chains.
  • Security Stack (DVNs): Learn about decentralized verifier networks that validate cross-chain messages.
  • Executors: Discover how messages are delivered and executed on destination chains.

4. Dive Deeper

5. LayerZero Read (Optional)

Key Concepts

Below are common terms you’ll encounter in the docs. A more detailed listing can be found in the Glossary.

  • OApp (Omnichain Application): A smart contract that uses LayerZero to send and receive messages across different blockchains.
  • Endpoint: Immutable smart contracts deployed on each supported chain that serve as the entry and exit points for LayerZero messages.
  • Endpoint ID (EID): A unique identifier for each LayerZero Endpoint contract, used for routing messages between chains.
  • Decentralized Verifier Networks (DVNs): Independent entities that validate messages between chains for security and integrity.
  • Executor: An off-chain service that executes messages on the destination chain after verification.
  • Message Library (MessageLib): Smart contracts for packing message payloads on the source chain and verifying them on the destination.
  • Security Stack: The combination of DVNs and other parameters that an application configures for message authenticity.
  • Composed Message: A cross-chain message that triggers another cross-chain message (nested calls).

Developer Tooling

LayerZero offers a suite of tools to streamline your development experience:

  • LayerZero Scan: Comprehensive block explorer for tracking and debugging cross-chain messages.
  • TestHelper (Foundry): Simulate cross-chain transactions in Foundry tests.
  • Hardhat Toolbox: A framework for building, configuring, and deploying OApps locally.

Community and Support

Join our community to connect with other developers, ask questions, and share your projects:

Start Building

You are now ready to build the next generation of omnichain applications with LayerZero. Dive into the documentation, explore the examples, and join our community to unleash the full potential of cross-chain development!

Your Feedback Shapes This Documentation

If anything is unclear or missing, we invite you to open an issue on GitHub, ask in Discord, or get in touch with the team. Happy building!