Message Handlers

The L1MessageHandler and L2MessageHandler contracts represent an abstraction for cross-chain message communication used within the Othentic Stack. Each AVS deploys its own message handlers to facilitate message-passing between Layer 1 and Layer 2 blockchains. These handlers play a critical role in ensuring seamless and secure communication across different layers.

Leveraging L1MessageHandler, and L2MessageHandler in conjunction with Decentralized Verifier Networks (DVNs), the AVS enables message-passing interactions between L1 and L2.

Contract Addresses

During the AVS deployment, the L1 and L2 Message Handlers are deployed. The contract addresses can be obtained from the L1MessageHandlerDeployed and L2MessageHandlerDeployed events, emitted in the respective L1 and L2 transactions.

To avoid failed message executions, ensure that Message Handler Contracts are funded with the native tokens of their respective chains.

Core Functions

The primary goal of the handler contracts is to communicate infrequent operations such as the registration and deregistration of Operators, slashing events, and the distribution of rewards payments.

L1 Message Handler

View source code

Access Control: Only the AVS governance contract can send messages from L1.

Functionality:

  • AVS governance contract calls the L1 messageHandler to notify L2 about processed payments and Operator status updates.

  • Message Processing: Implements _lzReceive method to handle incoming messages from L2, including:

    • Payment request

    • Batch Payment request


L2 Message Handler

View source code

Access Control: Only the Attestation Center contract can send messages from L2.

Functionality:

  • The Attestation Center contract calls the L2MessageHandler to forward payment or slashing requests to L1.

  • Message Processing: Implements _lzReceive method to handle incoming messages from L1, including:

    • Operator registration

    • Operator de-registration

    • Payment success

    • Batch payment success

Last updated