You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/advanced/prove-scripts.md
+34-11Lines changed: 34 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,26 @@
1
1
# Prove Scripts
2
2
3
-
The prove scripts allow you to manually generate range and aggregation proofs for OP Succinct. These are useful for testing proof generation workflows and debugging.
3
+
The prove scripts allow you to manually generate range and aggregation proofs for OP Succinct.
4
4
5
5
## Overview
6
6
7
-
There are two main proving binaries:
8
-
-**multi.rs**: Generates range proofs for multiple blocks
9
-
-**agg.rs**: Aggregates multiple range proofs into a single aggregation proof
7
+
OP Succinct uses a two-tier proving architecture:
8
+
9
+
1.**Range Proofs** (`multi.rs`): Generate compressed proofs for a range of L2 blocks. These proofs verify the state transition for a specific block range.
10
+
11
+
2.**Aggregation Proofs** (`agg.rs`): Combine multiple range proofs into a single aggregation proof. This reduces on-chain verification costs by verifying one proof instead of many.
10
12
11
13
Both binaries use the SP1 network prover by default.
12
14
15
+
### When to Use Aggregation
16
+
17
+
Aggregation is useful when you need to:
18
+
- Reduce on-chain verification costs by combining multiple range proofs into one proof
19
+
- Prove larger block ranges by aggregating individual range proofs from different time periods
20
+
- Combine proofs from different proving sessions into a single proof for batch submission
21
+
22
+
> **Note:** All range proofs must be generated in compressed mode for aggregation. The prove scripts handle this automatically.
The `multi.rs` binary generates range proofs for a specified block range.
88
+
The `multi.rs` binary generates compressed range proofs for a specified block range. These proofs verify the state transition function for the L2 blocks in the range.
78
89
79
90
### Usage
80
91
@@ -88,20 +99,29 @@ cargo run --bin multi --release -- \
88
99
### Example
89
100
90
101
```bash
91
-
# Generate a range proof for blocks 1000-1300
102
+
# Generate a compressed range proof for blocks 1000-1300
92
103
cargo run --bin multi --release -- \
93
104
--start 1000 \
94
105
--end 1300 \
95
106
--prove
96
107
```
97
108
109
+
The proof will be generated in compressed mode, which is required for aggregation.
110
+
98
111
### Output
99
112
100
113
Range proofs are saved to `data/{chain_id}/proofs/{start_block}-{end_block}.bin`
101
114
102
115
## Generating Aggregation Proofs
103
116
104
-
The `agg.rs` binary aggregates multiple range proofs into a single aggregation proof.
117
+
The `agg.rs` binary aggregates multiple compressed range proofs into a single aggregation proof. This allows you to verify the state transition for a large block range with a single on-chain verification.
118
+
119
+
### How Aggregation Works
120
+
121
+
1. The binary loads the specified range proofs from `data/fetched_proofs/`
122
+
2. Each range proof is verified to ensure validity
123
+
3. The proofs are aggregated into a single proof that attests to the entire block range
124
+
4. The aggregation proof can be submitted on-chain for efficient verification
0 commit comments