aztec-nr - noir_aztec::protocol::merkle_tree::membership

Function check_membership

pub fn check_membership<let TREE_HEIGHT: u32>(
    leaf: Field,
    membership_witness: MembershipWitness<TREE_HEIGHT>,
    root: Field,
) -> bool

Check whether a leaf exists in the tree with the given root. membership_witness is a hint to prove that the leaf exists in the tree with the given root.

Returns:

  • bool: true if the leaf exists in the tree, false otherwise.