feat(pxe): resolve tagging secret strategy via wallet hook - #24040
Merged
vezenovm merged 23 commits intoJun 25, 2026
Merged
Conversation
nventuro
reviewed
Jun 12, 2026
…elivery_privacy_preference-oracle
nventuro
reviewed
Jun 19, 2026
nchamo
commented
Jun 20, 2026
vezenovm
pushed a commit
that referenced
this pull request
Jun 22, 2026
) ## Summary Addresses the review comments on #23866 (constrained message delivery). Branched off and based on that PR so these follow-up changes can be reviewed in isolation. - **aztec-nr helpers**: tightened the constrained-delivery docs, fixed the misleading `index > 0` nullifier comment, switched secret resolution to `map`/`unwrap_or_else`, and renamed "chain" -> "sequence" across code/tests to avoid colliding with the existing "chain" (blockchain) meaning. - **Noir tests/contracts**: pinned the `get_handshakes` selector in the registry selector-match test, renamed the test helper to `authorizing`, and dropped redundant TXE tests now covered by the e2e and unit suites (plus the `delivery_unconstrained_handshake` compile-failure pin). - **PXE**: removed the temporary `get_app_siloed_secret` caller-arg authorization check (avoids conflicting with #24062), moved the registry-read helpers below the class, and reworked the cross-contract authorization test into `it.each` with shared `beforeEach`/`afterEach`. - Removed a stray `pied!` file that had been accidentally committed. The docs changes from the review are deferred to #24040, which owns the tagging-secret-source framing.
nchamo
commented
Jun 22, 2026
nchamo
commented
Jun 23, 2026
nchamo
marked this pull request as draft
June 23, 2026 19:00
…amo/f-699-pxewallet-get_delivery_privacy_preference-oracle
…amo/f-699-pxewallet-get_delivery_privacy_preference-oracle
nchamo
marked this pull request as ready for review
June 24, 2026 20:17
nchamo
marked this pull request as draft
June 24, 2026 20:17
nchamo
marked this pull request as ready for review
June 24, 2026 23:34
vezenovm
reviewed
Jun 25, 2026
vezenovm
left a comment
Contributor
There was a problem hiding this comment.
Mostly nits, but one main comment related to failing when the execution hook is incompatible with the delivery mode.
vezenovm
enabled auto-merge (squash)
June 25, 2026 18:22
vezenovm
deleted the
nchamo/f-699-pxewallet-get_delivery_privacy_preference-oracle
branch
June 25, 2026 18:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
There are several ways to deliver a message between users, each with a different privacy trade-off. Delivery can reuse a secret the two parties already share (a previously established handshake, or one agreed off-chain) and leak nothing. Or it can establish a non-interactive handshake on the fly, which works without coordination at the cost of publishing information about the recipient onchain. When no tagging secret has been established for a
(sender, recipient)pair yet, someone has to decide how to source one. That decision belongs to the wallet, which owns the user's privacy stance and can ask the user if needed.The change
aztec-nr gains a
resolve_tagging_strategy(sender, recipient, mode)oracle. It is consulted only when no tagging secret has been established for the(sender, recipient)pair yet; an established secret is reused without asking. The send flow will call it when resolving the tagging secret (F-698, not wired in this PR).The wallet expresses its decision as a
TaggingSecretStrategy: which secret to use, plus any raw material PXE cannot derive on its own (an arbitrary secret point). PXE resolves that strategy, performing any Diffie-Hellman key exchange and app-siloing, and returns aResolvedTaggingStrategythe contract uses directly. So wallets never reimplement the derivation, and the contract never sees raw key material. There are three strategies:PXE answers the oracle through a new optional
resolveTaggingSecretStrategyexecution hook. We chose a hook over a static config value because the decision is per message. The request carries:This lets wallets apply per-application or per-recipient policies, or surface the decision to the user. The hook follows the existing precedent of
authorizeUtilityCall, PXE's other wallet policy callback.When no hook is configured PXE applies a privacy-safe default: unconstrained delivery uses an address-derived shared secret (no onchain trace), while constrained delivery fails, since every sound constrained secret must be backed by an onchain handshake, which needs a wallet. Privacy is therefore never weakened without the wallet opting in.
TXE has no hooks, so tests configure the strategy through a test environment option (unset by default, which exercises PXE's default):
Docs: an Execution hooks page documents the hook mechanism and both hooks, the note delivery page gains a Tagging secret strategy section, and the note discovery page is updated.
Fixes F-699