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

[Ignore for now] Try optimizing DA costs by not including Npk_m in a note #5632

Closed
Tracked by #5606
benesjan opened this issue Apr 9, 2024 · 1 comment
Closed
Tracked by #5606
Labels
S-needs-discussion Status: Still needs more discussion before work can start.

Comments

@benesjan
Copy link
Contributor

benesjan commented Apr 9, 2024

Note: This issue is low priority and I created it just so that the idea is not forgotten.

We could remove the Npk_m from the note preimage and instead we could modify how a note hash is computed within a note and silo there the note hash with Npk_m. Then when spending the note we would:

  1. Fetch the Npk_m from a registry (that will probably mean that we will fetch it from oracle and then do a public tree inclusion proof - the oracle would have account address as input and it would return all the historical nullifier public keys),
  2. iterate through the nullifier pub keys and check whether hash(Npk_m, inner inner inner note hash) matches the note hash we have,
  3. once we find the match we have the Npk_m without having it in the preimage.

Update: We might do the same thing for storage slot given that it's in ABI now. We might need to brute force a bunch of nullifier pub keys and slots but that should be totally ok given that the number of [nullifier pub key, storage slot] pairs is not expect to be large.

Requirements: We have to make sure we don't over-fit aztec.nr to always do a "hash note with nullifier public key" step, in case someone wants to do some other kind of note derivation. For this reason the extra siloing and later on bruteforcing of the Npk_m for nullification has to happen inside the NoteInterface::compute_note_content_hash and NoteInterface::compute_nullifier functions. I don't expect this to be a problem. In the compute_nullifier function we would just call an oracle which would try bruteforcing the note hash with all the owner's Npk_m keys and then return it.

@github-project-automation github-project-automation bot moved this to Todo in A3 Apr 9, 2024
@benesjan benesjan changed the title Optimize DA costs by not including Npk_m in note Optimize DA costs by not including Npk_m in note Apr 9, 2024
@benesjan benesjan changed the title Optimize DA costs by not including Npk_m in note Try optimize DA costs by not including Npk_m in note Apr 9, 2024
@benesjan benesjan added the S-needs-discussion Status: Still needs more discussion before work can start. label Apr 9, 2024
@benesjan benesjan changed the title Try optimize DA costs by not including Npk_m in note Try optimizing DA costs by not including Npk_m in note Apr 9, 2024
@benesjan benesjan changed the title Try optimizing DA costs by not including Npk_m in note [Ignore for now] Try optimizing DA costs by not including Npk_m in note Apr 11, 2024
@benesjan benesjan changed the title [Ignore for now] Try optimizing DA costs by not including Npk_m in note [Ignore for now] Try optimizing DA costs by not including Npk_m in a note Apr 11, 2024
@LHerskind
Copy link
Contributor

We added npk_m_hash instead for the nullifiers to address this more neatly, should be in #5637.

@github-project-automation github-project-automation bot moved this from Todo to Done in A3 May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-discussion Status: Still needs more discussion before work can start.
Projects
Archived in project
Development

No branches or pull requests

2 participants