Skip to main content
This guide explains how to configure Decentralized Verifier Networks (DVNs), Executors, and message libraries for your Starknet OApp or OFT using the SDK.
Production deployments should use multiple required DVNs from independent operators. A single-DVN configuration means a compromise of that one verifier results in unrestricted forged messages on the pathway. See the Integration Checklist for production DVN guidance.

Overview

Configuration is done through the SDK provided by @layerzerolabs/lz-v2-protocol-starknet. All examples use SDK methods to interact with the Endpoint and message library contracts. Configuration flow:
  1. Set delegate (required if configuring via external account)
  2. Set message libraries (optional)
  3. Configure DVNs for send/receive (optional but recommended)
  4. Set enforced options (optional)
  5. Set peer addresses (required - opens pathway, call last!)
Critical OrderAlways configure in this order. Setting peers last ensures the pathway isn’t opened until all security settings are in place.

SDK Setup

Prerequisite: Set Delegate

Endpoint configuration calls (set_send_library, set_receive_library, set_send_configs, set_receive_configs) require the caller to be the OApp itself or an authorized delegate. If you’re configuring from an external account, set a delegate first (owner-only):
Use the address of the account that will submit the endpoint configuration transactions.

Default Configuration

LayerZero provides sensible defaults. If you don’t configure custom settings: You can query the default configuration via the Endpoint or check LayerZero Deployments.

Configuration Methods

Set Peer

Address format: Use Bytes32 for all peers. EVM addresses (20 bytes) must be left-padded with zeros to 32 bytes.

Set Message Libraries

Default: Uses Endpoint defaults if not configured. If you see DEFAULT_SEND_LIB_UNAVAILABLE or UNSUPPORTED_EID, set the send/receive libraries explicitly and ensure the EID is supported by the ULN.

DVN Configuration

Configure Send DVN (Outbound)

Configure Receive DVN (Inbound)

ULN Configuration Structure

has_ Fields*The has_* fields indicate whether the corresponding value should override the default configuration. Set them to true when you want to use custom values, otherwise the protocol defaults will be used.
DVN OrderingDVN addresses in required_dvns and optional_dvns must be sorted in ascending order. The contract will revert if unsorted or duplicate DVNs are provided.
Config types: MessageLibConfigType.EXECUTOR = 1, MessageLibConfigType.ULN = 2

Configuring Executor

The Executor delivers messages on the destination chain.

Executor Config Structure


Setting Enforced Options

Enforced options set minimum execution parameters that users cannot override. This requires the OAppOptionsType3 component (included in OFT contracts). If your ABI doesn’t expose set_enforced_options, load your compiled contract artifact and call the entrypoint directly.
If you prefer sncast, call the entrypoint directly:

Message Types


Complete Configuration Example


Reading Configuration

Get Current Send Config

Get Current Receive Config

Get Peer


Gas Recommendations

Always test your specific use case on testnet to determine accurate gas requirements.

Next Steps