For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::messages::delivery

Struct OnchainUnconstrainedDelivery

pub struct OnchainUnconstrainedDelivery
{ /* private fields */ }

On-chain unconstrained delivery. Returned by MessageDelivery::onchain_unconstrained.

By default the tag reuses a handshake already registered for the pair, and otherwise falls back to the wallet-resolved [tagging secret strategy]crate::messages::delivery::ResolvedTaggingStrategy. The contract can also fix the derivation, and its choice is honored over this default.

Implementations

impl OnchainUnconstrainedDelivery

pub fn with_sender(&mut self, sender: AztecAddress) -> Self

Overrides the sender address used for discovery tag derivation.

On-chain messages are tagged so that the recipient can find them efficiently without scanning all logs. The tag is derived from a shared secret between a "sender" and the recipient. By default, the sender is the wallet-supplied address (typically the account that initiated the transaction), but some contracts need to override it so that recipients can discover the notes correctly. This is the case for account contracts in their constructor: the deployer is the one that initiated the transaction, but any notes generated during deployment should be tagged by the account contract itself.

Examples

MessageDelivery::onchain_unconstrained().with_sender(self.address)
pub fn via_non_interactive_handshake(&mut self) -> Self

Derives the discovery tag from a non-interactive handshake for the pair, reusing an existing one and creating a fresh one only when none exists.

pub fn via_interactive_handshake(&mut self) -> Self

Derives the discovery tag from an interactive handshake.

Reuses an existing handshake for the pair, creating a fresh interactive one only when none exists.

Unlike a non-interactive handshake, establishing an interactive one announces nothing onchain, but it requires the recipient's cooperation: they must answer the registry's signed-authorization request, so the send fails if they cannot be reached.

pub fn via_address_derived_secret(&mut self) -> Self

Derives the discovery tag from the address-derived secret for the (sender, recipient) pair, established via Diffie-Hellman between their addresses. Leaves no on-chain trace and never consults the handshake registry.

Examples

MessageDelivery::onchain_unconstrained().via_address_derived_secret()

Trait implementations

impl MessageDeliveryBuilder for OnchainUnconstrainedDelivery

pub fn build_message_delivery(self) -> MessageDelivery