project screenshot 1
project screenshot 2
project screenshot 3

LayerKit

LayerKit lets you deploy LayerZero into rollups like Optimism with just one command in just a few minutes. This helps developers easily test and build cross-chain dApps with full flexibility

LayerKit

Created At

ETHGlobal San Francisco

Winner of

LayerZero - Most Innovative Omnichain Solution 3rd place

LayerZero - Most Innovative Omnichain Solution Best Developer Feedback

Project Description

LayerKit is a developer toolkit designed for rapid and flexible deployment of LayerZero into rollups so that they can exchange messages with Ethereum (or with other rollups / chains in the future). It enables application development and testing directly on local versions of Ethereum and Optimism (running Geth and Lighthouse nodes). With a simple one-command setup, LayerKit deploys fully connected LayerZero components in under 10 minutes - including endpoints, MessageLib (ULN302), Executor, DVN, PriceFeed, and Worker on each chain. The package is very modular, allowing users to use custom MessageLibs or DVNs as required. Furthermore, the Optimism and Ethereum network can be configured with a high degree of control. Additionally, it provides a Blockscout explorer for both chains, allowing easy tracking of blockchain activity.

How it's Made

LayerKit uses kurtosis packages to orchestrate the deployment process of LayerZero components across Ethereum and Optimism networks. It leverages the Ethereum and Optimism packages developed by the Ethereum Foundation to set up both networks in isolated environments. Each network is spun up with its own Blockscout block explorer.

Once the Ethereum and Optimism networks are running, the necessary chain details (e.g. pre-funded keys, RPC) are retrieved. To facilitate LayerZero deployment on the Optimism layer 2, tokens are bridged to Optimism using the built-in token bridge.

Next, LayerKit deploys the core LayerZero components:

  1. LayerZero Endpoints: These are deployed on both Ethereum and Optimism, serving as the entrypoint for users
  2. MessageLib (ULN302): This library is responsible for handling message encoding and decoding between the two chains
  3. Executors: These contracts handle the messages on the destination chain, ensuring they are properly processed
  4. Price Feeds: To support dynamic validation in the LayerZero environment, mock price feeds are deployed. These price feeds are needed to simulate the DVN
  5. DVN Contract: A DVN mock contract, responsible for message validation, is deployed on-chain (off-chain DVN could be added later). It ensures messages are verified before being relayed between chains

Once the contracts are deployed, LayerKit configures the system by:

  • Registering the MessageLib with the Endpoints
  • Registering the Executor with the MessageLib
  • Connecting the DVN to the Executor

The DVN contract can easily be swapped out for an alternative and in future work this will be even more parameterised to allow for easier DVN development.

These deployment steps were derived by looking at the deployed contracts on various mainnets and testnets as there is no documentation for this. Most of the contracts deployed are the same ones as on mainnet. Only the price feed and DVN contracts are mocked ones as it would not be feasible to deploy the full version.

background image mobile

Join the mailing list

Get the latest news and updates