aztec-nr - noir_aztec::note::utils

Function compute_note_hash

pub fn compute_note_hash<let N: u32>(storage_slot: Field, data: [Field; N]) -> Field

Computes a domain-separated note hash.

Receives the storage_slot of the crate::state_vars::StateVariable that holds the note, plus any arbitrary note data. This typically includes randomness, owner, and domain specific values (e.g. numeric amount, address, id, etc.).

Usage of this function guarantees that different state variables will never produce colliding note hashes, even if their underlying notes have different implementations.