Expand description
Poseidon-based Merkle hashing on the BN254 scalar field (Fr).
Lifted verbatim from orchard-bn254’s poseidon_merkle_bn254 (the merkle-tree parts
only), re-sourced to the standalone crates halo2_poseidon (Poseidon primitives)
and halo2curves (BN254 Fr) so it carries no halo2_proofs / halo2_gadgets
dependency. The Poseidon spec/constants are byte-identical to the prover + on-chain
PoseidonT3 (verified against the live commitment-tree root).
Structs§
- Bn254
Incremental Merkle Tree - Append-only incremental Merkle tree of fixed depth
MERKLE_DEPTH_EVM(32) over BN254 scalar leaves. Empty leaves default toFr::ZERO. - Bn254
Poseidon Merkle Spec - Poseidon-128, width 3, rate 2, x^5 S-box; Grain-generated constants for BN254
Fr.
Constants§
- MERKLE_
DEPTH_ EVM - Orchard-compatible depth for the incremental note commitment tree.
Functions§
- merkle_
compress - One Merkle layer:
H(level || left || right)with domain separation onlevel. - merkle_
root - Full Merkle root (depth
MERKLE_DEPTH_EVM) overFrleaves from a sibling path. - poseidon_
domain_ pair Poseidon(domain, a, b)overConstantLength<3>— the width-3 two-input hash with au64domain tag. Byte-identical to the prover’sposeidon_merkle_bn254::poseidon2and tomerkle_compresswhendomain == level. Used for the frozen Indexed MT, whose node domains exceed theu8range ofmerkle_compress.