Message Handlers
Last updated
Last updated
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 LayerZero messaging protocol, L1MessageHandler
, and L2MessageHandler
in conjunction with Decentralized Verifier Networks (DVNs), the Othentic Stack enables message-passing interactions between different layers such as L1 and L2.
By executing othentic-cli network deploy
command, 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.
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.
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
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