Skip to content

Commit 53b2f52

Browse files
committed
docs: move blob capacity to rust code
1 parent 17226ee commit 53b2f52

File tree

2 files changed

+26
-40
lines changed

2 files changed

+26
-40
lines changed

aggregation_mode/src/backend/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,32 @@ impl ProofAggregator {
187187
.map_err(AggregatedProofSubmissionError::ReceiptError)
188188
}
189189

190+
/// ### Blob capacity
191+
///
192+
/// As dictated in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), each blob can hold:
193+
///
194+
/// - `FIELD_ELEMENTS_PER_BLOB = 4096`
195+
/// - `BYTES_PER_FIELD_ELEMENT = 32`
196+
///
197+
/// This gives a total theoretical capacity of:
198+
///
199+
/// `FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT = 4096 * 32 = 131072 bytes`
200+
///
201+
/// However, this full capacity isn't usable due to the encoding of KZG commitments to elliptic curve points.
202+
/// Specifically:
203+
///
204+
/// - Ethereum uses the BLS12-381 curve, whose scalar field modulus is slightly less than `2^256`
205+
/// (closer to `2^255`).
206+
/// - Therefore, 32-byte field elements can't represent all 256-bit values.
207+
/// - To ensure values are within the field modulus, we **pad with a leading `0x00` byte**,
208+
/// effectively capping values below the modulus.
209+
/// - This reduces the usable payload to **31 bytes per field element**.
210+
///
211+
/// So, the _actual usable capacity_ per blob is:
212+
///
213+
/// `4096 * 31 = 126976 bytes`
214+
///
215+
/// Meaning that we can send as much as 126976 / 32 = 3968 proofs per blob
190216
async fn construct_blob(
191217
&self,
192218
leaves: Vec<[u8; 32]>,

docs/2_architecture/agg_mode_components/1_deep_dive.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -89,43 +89,3 @@ When submitting the aggregated proof to Ethereum, we include a **blob** that con
8989
- It allows users to:
9090
- Inspect which proofs were aggregated
9191
- Get a Merkle proof to verify that their proof is included in the aggregated proof
92-
93-
### Blob capacity
94-
95-
As dictated in the [eip-4844](https://eips.ethereum.org/EIPS/eip-4844) Each blob can hold:
96-
97-
- `FIELD_ELEMENTS_PER_BLOB = 4096`
98-
- `BYTES_PER_FIELD_ELEMENT = 32`
99-
100-
Which results in a total theoretical capacity of:
101-
102-
`FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT` = `4096 * 32` = `131.072 bytes`
103-
104-
However, this full capacity can't be used due to how KZG bytes to elliptic curve points are encoded. Specifically:
105-
106-
- Ethereum uses the BLS12-381 curve, whose scalar field modulus is slightly less than `2^256`, in fact, it's closer to `2^255`.
107-
- That means the 32-byte field elements can't represent arbitrary 256-bit values.
108-
- To stay within the field modulus, we **pad the value with a leading `0x00` byte**, ensuring it's below the modulus.
109-
- This reduces the usable payload to **31 bytes per field element**.
110-
111-
So the _actual usable capacity_ per blob becomes:
112-
113-
`4096 * 31` = `126.976 bytes`
114-
115-
### Current Bottleneck
116-
117-
Since each [proof commitment](#proof-commitment) is exactly **32 bytes**, the maximum number of proof commitments that can fit in a single blob is:
118-
119-
`126.976 / 32` = `3968 proofs`
120-
121-
This is the **current upper limit** on how many proofs we can include in a single aggregation run.
122-
123-
## Scaling Beyond Current Limits
124-
125-
To increase throughput we can:
126-
127-
1. **Send Multiple Blobs per Transaction**
128-
Up to **6 blobs** can be included per transaction, supporting up to **23,808 proofs per run**, which is more than we can aggregate in one day.
129-
130-
2. **Run Aggregation More Frequently**
131-
Reducing the interval between aggregation runs.

0 commit comments

Comments
 (0)