Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions EIPS/eip-7916.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ The [SSZ Merkleization specification](https://github.com/ethereum/consensus-spec
- The merkleization depends on the number of input chunks and is defined recursively:
- If `len(chunks) == 0`: the root is a zero value, `Bytes32()`.
- Otherwise: compute the root using `hash(a, b)`
- `a`: Recursively merkleize chunks beyond `num_leaves` using `merkleize_progressive(chunks[num_leaves:], num_leaves * 4)`.
- `b`: Merkleize the first up to `num_leaves` chunks as a binary tree using `merkleize(chunks[:num_leaves], num_leaves)`.
- `a`: Merkleize the first up to `num_leaves` chunks as a binary tree using `merkleize(chunks[:num_leaves], num_leaves)`.
- `b`: Recursively merkleize chunks beyond `num_leaves` using `merkleize_progressive(chunks[num_leaves:], num_leaves * 4)`.

This results in a 0-terminated sequence of binary subtrees with increasing leaf count. The deepest subtree is padded with zeroed chunks (virtually for memory efficiency).

```
root
/\
/ \
/\ 1: chunks[0 ..< 1]
/ \
/\ 4: chunks[1 ..< 5]
/ \
/\ 16: chunks[5 ..< 21]
/ \
0 64: chunks[21 ..< 85]
root
/\
/ \
1: chunks[0 ..< 1] /\
/ \
4: chunks[1 ..< 5] /\
/ \
16: chunks[5 ..< 21] /\
/ \
64: chunks[21 ..< 85] 0
```

| Depth | Added chunks | Total chunks | Total capacity (bytes) |
Expand Down