-
Notifications
You must be signed in to change notification settings - Fork 310
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
Avoid double computation of note commitment #1718
Comments
Perhaps the note could contain a cached |
I think it might actually be essential, from a security perspective, because we can't trust the |
Tagging @LeilaWang for thoughts too |
Discussed this issue with @iAmMichaelConnor @dbanks12 and @jeanmon. This does not look like a security issue with the protocol. The function
We still might want to cache the |
We can extend this optimisation to other parts of the code as well. For example, even when siloing a note, we re-compute the inner note hash. aztec-packages/yarn-project/noir-libs/noir-aztec/src/note/utils.nr Lines 21 to 31 in bae313d
aztec-packages/yarn-project/noir-libs/noir-aztec/src/note/utils.nr Lines 33 to 43 in bae313d
This can only be optimised if we introduce a new member |
That's a nice idea, @suyash67 . |
When destroying a note, along with the nullifier of that note, we also output the note commitment. For this, we compute the note commitment from the note itself. Ideally, we must reuse the note commitment (that must already be computed before nullifying a note).
aztec-packages/yarn-project/noir-libs/noir-aztec/src/note/lifecycle.nr
Line 77 in ec5241c
The text was updated successfully, but these errors were encountered: