Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch PXE app-siloed tag secrets from contract #9365

Closed
Tracked by #9119
nventuro opened this issue Oct 23, 2024 · 0 comments · Fixed by #9468
Closed
Tracked by #9119

Fetch PXE app-siloed tag secrets from contract #9365

nventuro opened this issue Oct 23, 2024 · 0 comments · Fixed by #9468
Assignees
Labels
C-pxe Component: PXE (Private eXecution Envrionment) team-fairies Nico's team

Comments

@nventuro
Copy link
Contributor

nventuro commented Oct 23, 2024

With #9263 complete, we'll be able to produce secrets that can be used to compute tags which mark logs meant for us. Tagged logs will be fetched with the method added in #9268.

Tagging computation will be initially done in aztec.js, but is expected to eventually move to aztec.nr. We should design the system with an eye in this future transition in order to make it as painless as possible. So even though all of this will run in PXE, it's good to think of it as if it were running in an untrusted contract.

What should contracts query for?

As seen in #9378, the shared secret computation involves knowledge of the sender's address. Contracts cannot be given the list of addresses in the address book, as that would leak this sensitive information. They similarly cannot be given the list of secrets S, since they'd be able to use that to compute tags for a different contract, and learn information about the user that way (e.g. how many logs exist for some specific contract).

Instead, contracts should receive from PXE an app-siloed secret s_app = hash(S, app_address) = poseidon2([S.x, S.y, app_address]) (i.e. the same one used in #9378). Apps will not be able to use s_app for anything other than computing their own tags.

Indices

While the app-siloed secrets are sufficient to perform note discovery, we ideally want to also know how far we last synced to avoid doing repeated work. This means keeping track of the last seen tag index per app-siloed secret.

PXE should store this value and return it alongside the siloed secrets. Conceptually it'll store (S, app_address, index) and return an array with (s_app, index). How this is achieved internally is an implementation detail, though we do need to make sure to return index 0 if no entry exists, since there's no instance in which an app is 'added' to PXE: any app could perform app_siloed secret requests at any moment.

@nventuro nventuro added C-aztec.js Component: aztec.js client library team-fairies Nico's team labels Oct 23, 2024
@nventuro nventuro added C-pxe Component: PXE (Private eXecution Envrionment) and removed C-aztec.js Component: aztec.js client library labels Oct 23, 2024
This was referenced Oct 23, 2024
@Thunkar Thunkar self-assigned this Oct 28, 2024
@github-project-automation github-project-automation bot moved this to Todo in A3 Oct 28, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Oct 29, 2024
AztecBot pushed a commit to AztecProtocol/aztec-nr that referenced this issue Oct 30, 2024
Closes: AztecProtocol/aztec-packages#9365

- Allows storing the current known index for a given tagging secret.
- Returns the current index when calling `get_app_tagging_secret` so
notes can be sent with the correct one.
- Adds an oracle that returns the app tagging secrets for the whole
addressbook, including their indexes.

---------

Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-pxe Component: PXE (Private eXecution Envrionment) team-fairies Nico's team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants