Skip to content

Commit 93116ec

Browse files
committed
chore: add docs for merkle tree backend
1 parent 002102b commit 93116ec

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • aggregation_mode/src/aggregators

aggregation_mode/src/aggregators/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ impl AlignedProof {
125125
}
126126
}
127127

128+
/// Merkle tree commitment for aligned proofs.
129+
///
130+
/// Each leaf node (representing a proof) is committed by hashing:
131+
/// — The program id: the verification key hash in SP1 or the image ID in RISC Zero
132+
/// — Public inputs.
133+
///
134+
/// Intermediate nodes in the tree are formed by computing the keccak pairs of child nodes.
135+
///
136+
/// Note: this commitment scheme is repeated in both risc0 and sp1 aggregation programs.
137+
/// Therefore, any change to the commitment scheme must be mirrored there.
128138
impl IsMerkleTreeBackend for AlignedProof {
129139
type Data = AlignedProof;
130140
type Node = [u8; 32];

0 commit comments

Comments
 (0)