Skip to content

feat(pxe)!: unify sender/secret registration into TaggingSecretSource - #24280

Merged
nchamo merged 6 commits into
merge-train/fairies-v5from
nchamo/generalize-senders
Jun 25, 2026
Merged

feat(pxe)!: unify sender/secret registration into TaggingSecretSource#24280
nchamo merged 6 commits into
merge-train/fairies-v5from
nchamo/generalize-senders

Conversation

@nchamo

@nchamo nchamo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

#23708 added registerSharedSecret/removeSharedSecret alongside the existing registerSender/getSenders/removeSender. Both feed the same machinery (sources from which PXE derives the app-siloed tagging secrets it scans for to discover incoming private logs), but the PXE API presented them as two unrelated method families, even though they're already backed by one store (TaggingSecretSourcesStore). This unifies the public surface.

The change

Replaces the five methods with three over a discriminated union TaggingSecretSource:

  • registerTaggingSecretSource(source)
  • removeTaggingSecretSource(source)
  • getTaggingSecretSources(), which returns every registered source

TaggingSecretSource has two variants:

  • { kind: 'sender'; address }: an external address; PXE derives a shared secret via ECDH against every account (present and future). Senders can't be reduced to stored points, so they stay address-anchored.
  • { kind: 'arbitrary-secret'; recipient; secret }: a directly-provided shared-secret point scoped to a recipient. A future handshake-secret variant slots in here.

Scoped to PXE: the Wallet interface, address book, CLI, and RPC schema are unchanged; the wallet implementations just call the new methods. A migration entry is added to migration_notes.md.

@nchamo nchamo added the ci-draft Run CI on draft PRs. label Jun 24, 2026
@nchamo nchamo self-assigned this Jun 24, 2026
*/
export type TaggingSecretSource =
| { kind: 'sender'; address: AztecAddress }
| { kind: 'arbitrary-secret'; recipient: AztecAddress; secret: Point };

@nchamo nchamo Jun 24, 2026

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.

Names are meant to be similar to the ones introduced for the sender in #24040

The idea is we will soon add a way to register interactive handshakes for the recipient this way too

@nchamo
nchamo requested a review from vezenovm June 25, 2026 00:10
@nchamo
nchamo marked this pull request as ready for review June 25, 2026 00:10
Comment thread docs/docs-developers/docs/resources/migration_notes.md Outdated
Comment on lines +208 to +209
expect(remaining).not.toContainEqual(senderSource);
expect(remaining).not.toContainEqual(secretSource);

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.

Suggested change
expect(remaining).not.toContainEqual(senderSource);
expect(remaining).not.toContainEqual(secretSource);
expect(remaining).toEqual([]);

nit: can we not just do this

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.

Sadly no. Only one PXE is shared among all tests (mostly because it's expansive to create one), so we can only test contains/not contains

Comment thread yarn-project/pxe/src/pxe.ts Outdated
Comment thread yarn-project/pxe/src/pxe.ts Outdated
@nchamo
nchamo enabled auto-merge (squash) June 25, 2026 18:02
@nchamo
nchamo merged commit dd6a703 into merge-train/fairies-v5 Jun 25, 2026
12 checks passed
@nchamo
nchamo deleted the nchamo/generalize-senders branch June 25, 2026 18:11
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants