> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct OnchainConstrainedDelivery

Module: `noir_aztec::messages::delivery`

```rust
pub struct OnchainConstrainedDelivery
{ /* private fields */ }
```

On-chain constrained delivery. Returned by [`MessageDelivery::onchain_constrained`](/aztec-nr-api/v6.0.0/noir_aztec/messages/delivery/struct.MessageDelivery.md#onchain_constrained).

By default the tag reuses a handshake already registered for the pair, and otherwise falls back to the wallet-resolved [tagging secret strategy](/aztec-nr-api/v6.0.0/noir_aztec/messages/delivery/struct.ResolvedTaggingStrategy.md). Constrained delivery only supports handshake-backed derivations.

## Implementations

```rust
impl OnchainConstrainedDelivery
```

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

Overrides the sender address used for discovery tag derivation.

See [`OnchainUnconstrainedDelivery::with_sender`](/aztec-nr-api/v6.0.0/noir_aztec/messages/delivery/struct.OnchainUnconstrainedDelivery.md#with_sender) for details.

#### Examples

```rust
MessageDelivery::onchain_constrained().with_sender(self.address)
```

```rust
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. Overrides the wallet's default resolution.

Constrained delivery only supports constrained secrets (e.g., handshake-registry backed derivations)

```rust
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. Overrides the wallet's default resolution.

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.

## Trait implementations

```rust
impl MessageDeliveryBuilder for OnchainConstrainedDelivery
```

```rust
pub fn build_message_delivery(self) -> MessageDelivery
```
