Overview
Aggchain Proof is the verification layer in Agglayer that handles different consensus mechanisms for proving chain state transitions. It combines consensus verification with bridge constraint verification, producing a single proof that covers both a chain’s internal operations and its cross-chain transfers.Supported Consensus Types
ECDSA Signature (CONSENSUS_TYPE = 0)
The original consensus mechanism used in Agglayer where a trusted sequencer acts as a security authority, signing off on state changes to ensure they are valid and authorized. Characteristics:- Trusted Sequencer Model: A designated address signs off on state changes, acting as the primary security authority for the chain
- Simple Verification: Like having a security guard verify and approve changes - fast and straightforward
- Fast Processing: Minimal computational overhead with efficient signature verification
- Trust Assumption: Relies on sequencer integrity and key security
- Message Construction: Create standardized message combining SHA256 of public values, new local exit root, and commitment to imported bridge exits
- Signature Recovery: Use elliptic curve cryptography to recover the signer’s address from the signature
- Authority Validation: Compare recovered address with configured trusted sequencer address
Generic Proof / Validity Proof (CONSENSUS_TYPE = 1)
Advanced consensus mechanism providing comprehensive verification of chain operations through mathematical proofs rather than trusted parties. Characteristics:- Flexible Proof System: Can work with any type of chain-specific proof system
- Mathematical Verification: Provides comprehensive state transition validation with cryptographic certainty
- Universal Compatibility: Like having a universal translator for different security protocols
- Enhanced Security: Mathematical certainty about state correctness without trust assumptions
- State Transition Verification: Mathematically verify every operation within the chain, including transaction processing, smart contract execution, and state machine transitions
- Bridge Constraint Verification: Verify that cross-chain transfers are valid and properly integrated with internal state changes
- SP1 zkVM Verification: Use SP1 zkVM to cryptographically verify the validity proof with mathematical certainty
- Zero-Knowledge Rollups: Chains generating zk-SNARKs or zk-STARKs for state transitions
- Custom Consensus: Chains with unique consensus algorithms and specialized verification requirements
Aggchain Proof Data Structure
Witness Structure
Bridge Witness
Public Values Output
Verification Process
Step 1: Consensus Verification
The system first verifies the chain’s consensus proof:Step 2: Bridge Constraints Verification
Then verifies bridge-related constraints:- GER Hash Chains: Verifies Global Exit Root insert/remove sequences recorded in hash chains that act as a stack using LIFO rules
- Claims Hash Chains: Verifies claimed and unset claims hash chains where valid claims are added to claimed chain and invalid ones to unset chain
- Local Exit Root: Verifies the Local Exit Root is computed correctly
- Imported Bridge Exits: Verifies
commit_imported_bridge_exitsis constructed correctly from claimed and unset bridge events - GER Inclusion: Verifies each inserted Global Exit Root has valid Merkle proof inclusion in the L1 Info Root
Execution Flow
Complete Aggchain Proof Process
Bridge Constraint Details
GER Stack Management
Global Exit Root updates are managed as a sophisticated stack structure that ensures proper sequencing and validation:- Insertion Process: New Global Exit Roots are added when bridge operations occur on any connected chain. Each insertion represents a state change in the Unified Bridge system and must be properly validated and sequenced to maintain network consistency.
- Removal Mechanism: Faulty Global Exit Roots can be removed from the stack in rare cases where invalid state updates are detected. This removal process ensures that incorrect state updates don’t propagate through the network and compromise security.
- LIFO Order: Last-in-first-out ordering ensures proper sequence validation where the most recent GER updates are processed first. This ordering is critical for maintaining temporal consistency and ensuring that state updates are applied in the correct chronological order.
- Hash Chain Tracking: All GER operations (both insertions and removals) are recorded in cryptographically linked hash chains that provide an immutable audit trail. These hash chains enable verification that the GER stack operations were performed correctly and in the proper sequence.
Claims Processing
Bridge Exit Claims are processed with comprehensive dual tracking that ensures security and prevents double-spending:- Claimed Hash Chain: Valid claims that successfully increase balances on destination chains are recorded in a cryptographically linked hash chain. Each entry in this chain represents a legitimate cross-chain transfer that has been properly verified and processed, creating an immutable record of successful bridge operations.
- Unset Hash Chain: Invalid claims that are rejected due to insufficient proofs, double-spending attempts, or other validation failures are recorded in a separate hash chain. This tracking ensures that invalid operations are properly documented and cannot be reprocessed, maintaining system integrity.
- Atomic Processing: All claims in a batch succeed or fail together through comprehensive validation where any single claim failure causes the entire batch to be rejected. This atomic processing prevents partial state updates that could compromise balance consistency across chains.
- Double-Spend Prevention: Ensures each bridge exit can only be claimed once by tracking all processed claims in the Nullifier Tree and validating that imported bridge exits haven’t been previously processed. This mechanism prevents replay attacks and maintains economic security.
Inclusion Proof Verification
L1 Info Root Inclusion provides cryptographic proof that Global Exit Root updates are legitimate:- Merkle Proof Validation: Each inserted Global Exit Root must have a valid Merkle proof demonstrating inclusion in the L1 Info Tree. These proofs use Keccak256 hashing to create cryptographic certainty that the GER was properly recorded on L1.
- L1 Settlement Verification: Proofs demonstrate that Global Exit Root updates were properly recorded on L1 and achieved finality, ensuring that cross-chain operations are backed by Ethereum’s security guarantees and cannot be reverted.
- Leaf Index Validation: Ensures correct positioning in the L1 Info Tree by validating that the Merkle proof corresponds to the expected leaf index. This prevents manipulation of proof paths and ensures that proofs reference the correct historical state.
- Root Verification: Confirms that Merkle proofs lead to the correct L1 Info Root by reconstructing the proof path and validating that it produces the expected root hash. This verification ensures that proofs are based on legitimate L1 state and haven’t been tampered with.