Skip to content

feat(pxe): add resolveCustomRequest hook for caller-defined requests - #24409

Merged
nchamo merged 2 commits into
merge-train/fairies-v5from
nchamo/handshake-request-oracle
Jun 30, 2026
Merged

feat(pxe): add resolveCustomRequest hook for caller-defined requests#24409
nchamo merged 2 commits into
merge-train/fairies-v5from
nchamo/handshake-request-oracle

Conversation

@nchamo

@nchamo nchamo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Motivation

Contracts sometimes need a value they cannot derive locally or from the protocol's existing oracles. The first case is interactive handshakes, where a sender needs the recipient's signature to establish a shared secret, but there is no generic way for a contract to ask the wallet to fulfill an arbitrary request.

The change

Adds a generic, hook-backed request primitive:

  • A contract calls resolve_custom_request(kind, payload) and PXE routes it to a wallet-supplied resolveCustomRequest hook, returning the opaque response.
  • kind selects the request type so a single hook can serve many; everything request-specific goes in the opaque payload. The request carries the issuing contract's address and class ID so a resolver can gate per contract.

There is no consumer yet; the interactive-handshake flow that uses this primitive lands in a follow-up.

@nchamo nchamo added ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-draft Run CI on draft PRs. labels Jun 30, 2026
@nchamo nchamo self-assigned this Jun 30, 2026

When the hook is absent, the PXE applies a privacy-safe default: unconstrained delivery uses an [address-derived shared secret](../../aztec-nr/framework-description/note_delivery.md#tagging-secret-strategy), which leaves no onchain trace, while constrained delivery fails rather than silently revealing the recipient through a [non-interactive handshake](../../aztec-nr/framework-description/note_delivery.md#tagging-secret-strategy).

## `resolveCustomRequest`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in love with the name, open to suggestions

@nchamo
nchamo marked this pull request as ready for review June 30, 2026 18:22
@nchamo
nchamo requested a review from nventuro as a code owner June 30, 2026 18:22

@nventuro nventuro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely

@nchamo
nchamo merged commit 90fc26d into merge-train/fairies-v5 Jun 30, 2026
18 checks passed
@nchamo
nchamo deleted the nchamo/handshake-request-oracle branch June 30, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants