Expand description
Frozen-set (compliance blacklist) Indexed Merkle Tree over BN254 Fr.
Mirrors PERC20 circuits/frozen_cmx_nonmember.circom and the prover’s
poseidon_merkle_bn254 IMT helpers — the root produced here is the on-chain
cmxFrozenRoot() / circuit rt_frozen and must match byte-for-byte.
Non-membership of cmx is proven by a single Merkle inclusion of a sorted
“low-leaf” (val, next_val) that strictly brackets it (val < cmx < next_val,
next_val == 0 being the +inf sentinel). The tree is kept as a sorted linked
list: inserting v splices it after its predecessor (update the predecessor’s
next, append the new leaf). Depth bounds the blacklist capacity (2^DEPTH),
not the key space, so distinct cmx never collide regardless of depth.
Structs§
- Frozen
Imt - Sorted Indexed Merkle Tree of frozen
cmxvalues. - Frozen
NonMembership Witness - Non-membership witness for one
cmx, matchingFrozenCmxNonMember’s inputs.
Constants§
- FROZEN_
IMT_ DEPTH - Indexed-MT depth = log2(capacity). Must equal circom
FROZEN_IMT_DEPTH()andposeidon_merkle_bn254::FROZEN_IMT_DEPTH. - FROZEN_
IMT_ LEAF_ DOMAIN - Leaf domain:
leaf = Poseidon(LEAF_DOMAIN, val, next_val). - FROZEN_
IMT_ NODE_ D0 - Internal-node domain base: node at level
i=Poseidon(NODE_D0 + i, left, right).
Functions§
- fr_
from_ be_ bytes - Big-endian 32 bytes (EVM
uint256) →Fr.Noneif not a canonical field element. - fr_
to_ be_ bytes Fr→ big-endian 32 bytes (EVMuint256order; inverse offr_from_be_bytes).- fr_
to_ le_ bytes Fr→ little-endian 32 bytes (the indexer’s on-the-wire convention).- fr_
to_ le_ hex Fr→0x-prefixed little-endian 32-byte hex (matches/merkle_pathsiblings).- frozen_
imt_ leaf - Low-leaf hash, matching
FrozenCmxNonMember’sleafgate.