Skip to main content
Version: Endpoint V2 Docs

Workers in LayerZero V2

In the LayerZero V2 protocol, Workers serve as the umbrella term for two key types of service providers: Decentralized Verifier Networks (DVNs) and Executors.

Both play crucial roles in facilitating cross-chain messaging and execution by providing verification and execution services. By abstracting these roles under the common interface known as a worker, LayerZero ensures a consistent and secure method to interact with both service types.

What Are Workers?

Workers are specialized entities that interact with the protocol to perform essential functions:

  • Verification as a Service: Decentralized Verifier Networks (DVNs), verify the authenticity and correctness of messages or transactions across chains.

  • Execution as a Service: Executors are responsible for carrying out actions requiring gas or compute units (transactions) on behalf of applications once verification is complete.

These roles are unified under the Worker interface, meaning that whether a service provider is a DVN or an Executor, it interacts with the protocol using a standardized set of methods.

Common Responsibilities

Both DVNs and Executors share several common responsibilities managed through the Worker contract:

  • Price Feeds: Maintaining up-to-date pricing information relevant to transaction fees or service costs.

  • Fee Management: Handling fees associated with using the service, ensuring that both service providers and application owners have clear, consistent cost structures.

By consolidating these responsibilities, the protocol simplifies the integration of different types of service providers while maintaining security and performance standards.

The Role of the Protocol

EndpointV2 uses a MessageLibManager.sol contract, responsible for the configuration and management of off-chain workers. Key features include:

  • Application-specific configurations: Applications can select specific message libraries, allowing them to tailor the protocol’s behavior to meet their unique security and trust requirements.

  • Customizable settings: Developers can set configurations for how messages are processed within each library, determine which off-chain entities are responsible for handling message delivery, and handle payment for these services.

  • Decentralization and flexibility: Instead of forcing every application into a one-size-fits-all approach,LayerZero V2 provides the flexibility needed to configure off-chain workers in a way that best fits the application’s design and security model.


This architecture allows LayerZero V2 to provide robust, decentralized cross-chain communication while giving application developers the tools needed to fine-tune their security and operational parameters.