> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# AggSender

> How AggSender packages L2 state transitions into cryptographically signed certificates and submits them to Agglayer for Pessimistic Proof generation

## What AggSender Does

AggSender is the component responsible for submitting L2 state transitions to Agglayer. It collects bridge events and L1 verification data, packages them into a signed certificate, and submits that certificate to Agglayer on each epoch. Agglayer then uses the certificate to generate a Pessimistic Proof and validate the state transition.

Without AggSender, an L2 chain cannot participate in Agglayer's security guarantees or cross-chain coordination. Every chain connected to Agglayer must run AggSender.

## The Trust Problem AggSender Solves

Agglayer connects multiple independent blockchains, and any of them could theoretically be compromised. The Pessimistic Proof system limits the damage a compromised chain can do, but it needs reliable input data to work correctly.

AggSender provides that input. Rather than simply reporting what happened on a chain, it creates a signed certificate that contains:

* Cryptographic proof that bridge transactions occurred
* Evidence that the chain has sufficient funds to back those transactions
* Mathematical verification data that the chain's state transitions are valid
* A digital signature committing to all of the above

This allows Agglayer to verify the submission rather than trust it.

## Certificate Generation

### Epoch-Based Operation

AggSender submits certificates on Agglayer epochs rather than per-transaction. On each epoch, it collects all bridge activity since the last certificate, packages it, and submits once. This batching is more efficient than per-transaction submissions and provides comprehensive context about the chain's activities.

### Certificate Lifecycle

### Certificate Structure

```go theme={null}
type Certificate struct {
    NetworkID              uint32                // L2 network identifier
    Height                 uint64                // Certificate sequence number
    PrevLocalExitRoot      common.Hash           // Previous Local Exit Root
    NewLocalExitRoot       common.Hash           // New Local Exit Root
    BridgeExits            []BridgeExit          // Outgoing bridge transactions
    ImportedBridgeExits    []ImportedBridgeExit  // Incoming bridge claims
    Signature              []byte                // Cryptographic signature
    Metadata               []byte                // Additional chain-specific data
}
```

## Full Certificate Submission Flow

*Note: AggchainProofGen is only involved when the chain uses the advanced state transition proof system. Chains using basic ECDSA authorization do not require AggchainProofGen.*
