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

Implementing aztec-nr library that constrains a use of fresh keys #5688

Closed
Tracked by #5606
benesjan opened this issue Apr 11, 2024 · 2 comments · Fixed by #5939
Closed
Tracked by #5606

Implementing aztec-nr library that constrains a use of fresh keys #5688

benesjan opened this issue Apr 11, 2024 · 2 comments · Fixed by #5939
Assignees

Comments

@benesjan
Copy link
Contributor

benesjan commented Apr 11, 2024

We need to have the ability to constrain the use of fresh keys from registry. Implement a fresh-key library (if you hate the name feel free to chime in with a new one) which will have the following functions:

assert_fresh_master_nullifier_public_key(account: AztecAddress, npk_m)
assert_fresh_master_incoming_viewing_public_key(account: AztecAddress, npk_m)
assert_fresh_master_outgoing_viewing_public_key(account: AztecAddress, npk_m)
assert_fresh_master_tagging_public_key(account: AztecAddress, npk_m)

It's essential that these checks can be done without calling the canonical registry contract because we can't afford another kernel iteration --> it adds a few seconds of proving and these checks will be common. For this reason we will need directly read the SharedMutable of the registry contract. Here is a separate issue to implement that functionality.

@github-project-automation github-project-automation bot moved this to Todo in A3 Apr 11, 2024
@benesjan benesjan changed the title Implementing aztec-nr library that constraints a use of fresh keys Implementing aztec-nr library that constrains a use of fresh keys Apr 11, 2024
@benesjan benesjan added the S-blocked Status: Blocked label Apr 11, 2024
@sklppy88 sklppy88 self-assigned this Apr 16, 2024
@sklppy88
Copy link
Contributor

@benesjan: How do we constrain this if we aren't storing them at them moment? #5723 (comment)

Also, how do we constrain it if its not in the registry and we only pass in one of the parts of the key_hash ? There is no way to derive if it's actually valid no ?

In my eyes we need to have it in the registry to assert if it's fresh, OR to have access to the base derivation through all the inputs.

A bit confused here

@sklppy88
Copy link
Contributor

Following scrum, have decided to make a lib fn to constrain only the nullifier keys (not the other 3), and if the key does not exist in registry, to only say that it does not exist as there is no way to constrain this w/out the full preimg

@sklppy88 sklppy88 removed the S-blocked Status: Blocked label Apr 27, 2024
sklppy88 added a commit that referenced this issue May 1, 2024
resolves #5688

---------

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants