Skip to content

Commit 16bed0c

Browse files
authored
Merge pull request #49 from BrianSeong99/main
RE-MERGE Aggkit documentation
2 parents 4b4cada + ade9e1c commit 16bed0c

File tree

17 files changed

+1992
-86
lines changed

17 files changed

+1992
-86
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ node_modules/
1111
*.iml
1212
temp_dir/
1313
package-lock.json
14-
package.json
14+
package.json
15+
.cursorindexingignore
16+
.specstory/
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
title: Architecture
3+
---
4+
5+
<!-- Page Header Component -->
6+
<h1 style="text-align: left; font-size: 38px; font-weight: 700; font-family: 'Inter Tight', sans-serif;">
7+
Architecture
8+
</h1>
9+
10+
<div style="text-align: left; margin: 0.5rem 0;">
11+
<p style="font-size: 18px; color: #666; max-width: 600px; margin: 0;">
12+
Discover how AggKit's ingenious architecture makes complex cross-chain synchronization feel effortless
13+
</p>
14+
</div>
15+
16+
## The Architecture Story: Building a Synchronization Symphony
17+
18+
Imagine conducting an orchestra where the musicians are scattered across different buildings, in different time zones, playing different instruments, but they all need to stay perfectly synchronized to create beautiful music together. That's essentially the challenge AggKit solves for blockchain networks.
19+
20+
Traditional blockchain architecture assumes you're dealing with a single network. But in the Agglayer ecosystem, you're dealing with **multiple sovereign chains** that each have their own rhythm, their own pace, their own way of doing things – yet they all need to work together seamlessly.
21+
22+
AggKit's architecture is the **conductor's baton** that keeps everyone in perfect harmony.
23+
24+
## The Three-Tier Architecture: How the Magic Happens
25+
26+
Let's break down AggKit's architecture into three distinct tiers, each with its own purpose and personality:
27+
28+
### Tier 1: Your Chain's Domain
29+
30+
At the foundation, you have **your L2 chain** doing what it does best – processing transactions, executing smart contracts, maintaining state. This is your domain, where you have full sovereignty and control.
31+
32+
When users perform bridge operations on your chain, several things happen simultaneously: bridge contracts emit events, state gets updated, and your chain needs to communicate these changes to the broader ecosystem. This is where AggKit steps in.
33+
34+
### Tier 2: The AggKit Synchronization Orchestra
35+
36+
In the middle tier, you have **AggKit components** working together like a well-orchestrated symphony. Each component has its specialized role, but they all coordinate to ensure seamless synchronization:
37+
38+
![Aggkit](../../../img/agglayer/Aggkit.png)
39+
40+
*Figure 1: The three-tier architecture – your chain, AggKit synchronization, and the broader ecosystem*
41+
42+
### Tier 3: The Unified Ecosystem
43+
44+
At the top tier, you have **the broader Agglayer ecosystem** – Agglayer itself, Ethereum L1, and all the other chains connected to the network. This is where the global state lives, where final settlement happens, and where the unified liquidity that makes everything possible is maintained.
45+
46+
## Data Flow Architecture
47+
48+
### The Two Essential Conversations
49+
50+
Understanding AggKit's architecture means understanding the **two critical conversations** that keep everything synchronized:
51+
52+
#### **Upward Flow: L2 → Agglayer**
53+
```mermaid
54+
sequenceDiagram
55+
participant L2 as L2 Chain
56+
participant BS as BridgeSync
57+
participant L1S as L1InfoTreeSync
58+
participant AS as AggSender
59+
participant AL as Agglayer
60+
61+
Note over L2,AL: Certificate Submission Flow
62+
L2->>BS: Bridge Events
63+
BS->>AS: Bridge Data
64+
L1S->>AS: L1 Verification Data
65+
AS->>AS: Build Certificate
66+
AS->>AL: Submit Certificate
67+
AL->>AL: Generate Pessimistic Proof
68+
AL-->>AS: Certificate Status
69+
```
70+
71+
**Purpose**: Submits L2 state transitions to Agglayer for validation and proof generation.
72+
73+
**Components Involved**:
74+
75+
- **BridgeSync**: Captures bridge events from L2 contracts
76+
- **L1InfoTreeSync**: Provides L1 verification data and Merkle proofs
77+
- **AggSender**: Packages data into signed certificates and submits to Agglayer
78+
79+
#### **Downward Flow: Agglayer → L2**
80+
```mermaid
81+
sequenceDiagram
82+
participant L1 as Ethereum L1
83+
participant L1S as L1InfoTreeSync
84+
participant AO as AggOracle
85+
participant L2S as L2GERSync
86+
participant L2 as L2 Chain
87+
88+
Note over L1,L2: GER Propagation Flow
89+
L1->>L1S: GER Update Event
90+
L1S->>AO: New GER Available
91+
AO->>L2: Inject GER
92+
L2->>L2S: GER Injected Event
93+
L2S->>L2S: Index GER Locally
94+
```
95+
96+
**Purpose**: Propagates global state updates from Agglayer/L1 to L2 chains for claim verification.
97+
98+
**Components Involved**:
99+
100+
- **L1InfoTreeSync**: Monitors L1 for Global Exit Root updates
101+
- **AggOracle**: Propagates GER updates to L2 contracts (with v0.3.5 committee security)
102+
- **L2GERSync**: Indexes and manages GER state locally on L2
103+
104+
## Component Interaction Patterns
105+
106+
### **Certificate Generation Pattern**
107+
108+
```mermaid
109+
graph LR
110+
subgraph "Data Collection"
111+
A[Bridge Events] --> D[Certificate Builder]
112+
B[L1 Verification Data] --> D
113+
C[Chain State] --> D
114+
end
115+
116+
subgraph "Certificate Processing"
117+
D --> E[Sign Certificate]
118+
E --> F[Submit to Agglayer]
119+
F --> G[Monitor Status]
120+
end
121+
122+
subgraph "Error Handling"
123+
G --> H{Certificate Status}
124+
H -->|Success| I[Complete]
125+
H -->|Error| J[Retry Logic]
126+
J --> D
127+
end
128+
129+
style D fill:#e8f5e8
130+
style F fill:#e3f2fd
131+
style I fill:#f3e5f5
132+
```
133+
134+
*Figure 2: Certificate generation and submission pattern*
135+
136+
### **Oracle Propagation Pattern**
137+
138+
```mermaid
139+
graph LR
140+
subgraph "GER Detection"
141+
A[Monitor L1] --> B[Detect New GER]
142+
B --> C[Validate GER]
143+
end
144+
145+
subgraph "Committee Consensus (v0.3.5)"
146+
C --> D{Committee Mode?}
147+
D -->|Yes| E[Propose GER]
148+
E --> F[Collect Votes]
149+
F --> G{Quorum Met?}
150+
G -->|Yes| H[Inject GER]
151+
G -->|No| I[Wait for Votes]
152+
I --> F
153+
D -->|No| H
154+
end
155+
156+
subgraph "L2 Update"
157+
H --> J[Update L2 Contract]
158+
J --> K[Index Locally]
159+
end
160+
161+
style E fill:#fff3e0
162+
style F fill:#fff3e0
163+
style G fill:#fff3e0
164+
style H fill:#e8f5e8
165+
```
166+
167+
*Figure 3: GER propagation with v0.3.5 committee security*
168+
169+
### **v0.3.5 Security Enhancements**
170+
171+
The major architectural improvement in v0.3.5 is the **elimination of single-address vulnerabilities**:
172+
173+
#### **Before v0.3.5: Single Point of Failure**
174+
```mermaid
175+
graph LR
176+
L1[L1 GER Updates] --> Single[Single AggOracle]
177+
Single --> L2[L2 GER Contract]
178+
179+
style Single fill:#ffebee
180+
```
181+
182+
**Risk**: Single compromised address could steal funds or mint unauthorized assets.
183+
184+
#### **After v0.3.5: Distributed Security**
185+
```mermaid
186+
graph LR
187+
L1[L1 GER Updates] --> Committee[AggOracle Committee]
188+
189+
subgraph Committee
190+
M1[Member 1]
191+
M2[Member 2]
192+
M3[Member 3]
193+
Quorum[Threshold Quorum]
194+
end
195+
196+
M1 --> Quorum
197+
M2 --> Quorum
198+
M3 --> Quorum
199+
Quorum --> L2[L2 GER Contract]
200+
201+
style Committee fill:#e8f5e8
202+
style Quorum fill:#e3f2fd
203+
```
204+
205+
**Security**: Multiple parties must agree before any GER injection, eliminating single points of failure.
206+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: AggchainProofGen
3+
---
4+
5+
<!-- Page Header Component -->
6+
<h1 style="text-align: left; font-size: 38px; font-weight: 700; font-family: 'Inter Tight', sans-serif;">
7+
AggchainProofGen
8+
</h1>
9+
10+
<div style="text-align: left; margin: 0.5rem 0;">
11+
<p style="font-size: 18px; color: #666; max-width: 600px; margin: 0;">
12+
Advanced proof generation service for aggregated chain operations and state transition verification
13+
</p>
14+
</div>
15+
16+
## Meet AggchainProofGen: The Security Expert
17+
18+
AggchainProofGen is the **advanced security component** for chains that need mathematical proof of their operations' validity. While basic chains can use simple signature-based verification, some chains require comprehensive **[state transition proofs](../../state-transition-proof/index.md)** that verify both internal chain operations and cross-chain bridge activities.
19+
20+
**Core Function**: AggchainProofGen generates sophisticated cryptographic proofs that demonstrate a chain's operations are mathematically valid and comply with all bridge security constraints. These proofs enable Agglayer's advanced dual proof system introduced in v0.3.
21+
22+
## When You Need the Security Expert
23+
24+
AggchainProofGen is **essential for chains requiring maximum security**:
25+
26+
### **High-Value Environments**
27+
If your chain handles significant value, operates in regulatory environments, or requires mathematical certainty about operations, AggchainProofGen provides the advanced cryptographic proofs that basic signature verification cannot offer.
28+
29+
### **Custom Consensus Chains**
30+
Chains with unique consensus mechanisms that need to prove their internal operations are valid use AggchainProofGen to generate comprehensive verification proofs that Agglayer can validate.
31+
32+
### **Enterprise Deployments**
33+
Organizations requiring audit trails, compliance documentation, and mathematical proof of system correctness use AggchainProofGen to meet strict security and regulatory requirements.
34+
35+
## How AggchainProofGen Works
36+
37+
AggchainProofGen implements a **dual verification system** that validates both internal chain operations and cross-chain bridge activities:
38+
39+
```mermaid
40+
sequenceDiagram
41+
participant AggSender as AggSender
42+
participant APG as AggchainProofGen
43+
participant zkVM as zkVM Prover
44+
participant Agglayer as Agglayer
45+
46+
Note over AggSender,Agglayer: Enhanced Certificate with State Transition Proof
47+
AggSender->>APG: Request proof for state transition
48+
APG->>APG: Verify consensus (ECDSA or validity proof)
49+
APG->>APG: Verify bridge constraints
50+
APG->>zkVM: Generate cryptographic proof
51+
zkVM-->>APG: Return verified proof
52+
APG-->>AggSender: Proof + public values
53+
AggSender->>Agglayer: Submit enhanced certificate
54+
Agglayer->>Agglayer: Validate proof and generate pessimistic proof
55+
```
56+
57+
**The dual verification**: AggchainProofGen first verifies your chain's consensus mechanism, then verifies that all bridge operations comply with security constraints, finally generating a cryptographic proof of both validations.
58+
59+
## The Two Types of Proof Generation
60+
61+
### **ECDSA Mode**: Fast and Simple
62+
For chains with trusted sequencer models, AggchainProofGen can verify operations using **ECDSA signature validation**. This provides fast verification while maintaining compatibility with existing chain architectures.
63+
64+
### **Validity Proof Mode**: Mathematical Certainty
65+
For chains requiring maximum security, AggchainProofGen generates **comprehensive mathematical proofs** using zero-knowledge virtual machines. This provides cryptographic certainty about the correctness of both internal operations and bridge activities.
66+
67+
## Integration with AggSender
68+
69+
When chains use AggchainProofGen, AggSender operates in **AggchainProver mode**:
70+
71+
```mermaid
72+
sequenceDiagram
73+
participant AS as AggSender
74+
participant APG as AggchainProofGen
75+
participant AL as Agglayer
76+
77+
AS->>APG: Request state transition proof
78+
APG->>APG: Generate aggchain proof
79+
APG-->>AS: Proof + public values
80+
AS->>AL: Submit certificate with proof
81+
AL->>AL: Validate and process dual proofs
82+
```
83+
84+
This integration enables the **advanced security model** where both internal chain operations and cross-chain bridge activities are mathematically verified before acceptance by Agglayer.
85+
86+
AggchainProofGen represents the **cutting-edge security option** for chains that require mathematical certainty about their operations. It enables the most advanced security model available in the Agglayer ecosystem, making it suitable for high-value deployments and enterprise environments that demand comprehensive verification.

0 commit comments

Comments
 (0)