aztec-nr - noir_aztec::history::nullifier

Function assert_nullifier_existed_by

pub fn assert_nullifier_existed_by(block_header: BlockHeader, siloed_nullifier: Field)

Asserts that a nullifier existed by the time a block was mined.

This function takes a siloed nullifier, i.e. the value that is actually stored in the tree. Use crate::protocol::hash::compute_siloed_nullifier to convert an inner nullifier (what PrivateContext::push_nullifier takes) into a siloed one.

Note that this does not mean that the nullifier was created at block_header, only that it was present in the tree once all transactions from block_header were executed.

In order to prove that a nullifier did not exist by block_header, use assert_nullifier_did_not_exist_by.

Cost

This function performs a full merkle tree inclusion proof, which is in the order of 4k gates.

If you don't need to assert existence at a specific past block, consider using PrivateContext::assert_nullifier_exists instead, which is typically cheaper. Note that there are semantic differences though, as that function also considers pending nullifiers.