For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::oracle::notes

Function get_next_tagging_index

pub unconstrained fn get_next_tagging_index<M>(secret: Field, mode: M) -> u32

Returns the next sender-side tagging index for a given secret and delivery mode.

The caller already holds the tagging secret, whether obtained from get_app_tagging_secret or computed by the contract, and only needs the simulator to hand out a fresh per-secret, per-mode index; the caller computes the tag itself. mode is converted into the OnchainDeliveryMode selecting the per-mode index counter, so callers can pass either a concrete on-chain delivery builder or an explicit mode. Offchain messages are not tagged, so only the onchain delivery variants can be used by this oracle.

The simulator persists the index increment only if the tagged log is found in an actual block; a reverting transaction can otherwise cause the sender to skip indices and later produce notes that are not found by the recipient.