What is WitnessChain?
Witness Chain operates with a sophisticated architecture that leverages a watchtower model to enhance the security and efficiency of decentralized applications. Here's an overview of its software architecture, components, and key smart contracts:
Overview of Watchtower Architecture
The Witness Chain platform uses a watchtower architecture to ensure the integrity of Layer 2 (L2) transactions by employing watchtower nodes that validate state transitions and provide proofs of diligence. The software stack consists of:
- Watchtower Client: Developed in Go, this client interacts with the Ethereum blockchain and Layer 2 solutions.
- On-chain Smart Contracts: Deployed on both Ethereum and a Layer 2 chain to facilitate various functions such as operator registration, settlement management, and alert tracking.
- Layer 1 Contracts: Includes the Operator Registry, Settlement (ServiceManager, aka EigenTower), and Alert Manager for maintaining operator records and managing alerts.
- Layer 2 Contracts: Specifically, the DiligenceProofManager Contract for managing proofs submitted by miners (watchtowers).
Key Smart Contracts and Their Functions
- OperatorRegistry
- Manages operator registration and deregistration for watchtower nodes.
- Functions include adding operators to a whitelist, suspending operators, and registering/deregistering watchtowers.
- DiligenceProofManager
- Enables watchtowers to submit proofs of diligence and inclusion for rewards during specified bounty periods.
- Key functions include setting bounty amounts, submitting proofs, and claiming rewards for successfully mined blocks.
- AlertManager
- Tracks alerts raised by watchtowers when discrepancies occur between the output roots of L2 and L1.
- Provides functionality to raise alerts and retrieve alert history.
- WitnessHub (AVS ServiceManager Contract)
- Processes settlements for collective submissions of proofs from watchtowers on the L2 chain.
- The aggregator collects proof submissions, employs a weighted stake strategy to determine winners, and records settlements on Layer 1.
Proof of Diligence Process
The process for L2 state validation in a watchtower node client involves four stages:
- Output State Root Extraction from Layer 1: The watchtower extracts the root state from the Ethereum Layer 1 chain.
- Output State Root Extraction from Layer 2: This involves tracer execution to extract the output state root from the L2 node.
- Comparison & Proof Generation: The client compares the two extracted states and generates proofs of diligence.
- Smart Contract Integration: Finally, the proofs are published to the appropriate smart contracts on Ethereum.
Functioning as an Active Validated Service (AVS)
Witness Chain serves as an Active Validated Service (AVS) by offering a robust framework for decentralized validation of Layer 2 transactions. Through its watchtower model, it enhances the security of the ecosystem by ensuring that state transitions are monitored and validated, thereby preventing fraud and enhancing trust in L2 applications. The integration of smart contracts facilitates automated operations for operator management, reward distributions, and alert management, streamlining processes crucial to the functioning of decentralized applications. This positions Witness Chain as a vital player in the restaking ecosystem, fostering security and decentralization within the broader blockchain landscape.