-
Notifications
You must be signed in to change notification settings - Fork 108
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
Implement ZIP-244 authorizing data commitment (auth_digest) #2547
Conversation
I'm happy to leave this review to @dconnolly. |
3f61277
to
3552b2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to pad auth data merkle trees with zeroes:
https://zips.z.cash/zip-0244#block-header-changes
(The transaction ID merkle tree pads with the previous transaction ID.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly small things, but teor++ on making sure we getting the different paddings right between the transaction merkle tree and the auth digest merkle tree, however we want to do that
Co-authored-by: Deirdre Connolly <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the AuthDataRoot computation and added some tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I have a suggestion about a follow-up optimisation ticket, but it's not blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for @dconnolly's approval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Add #2547 to changelog Clarify partial implementation of ZIP-221
* WIP: Copy unformatted changelog from github * Categorise and refactor changelog entries * Update CHANGELOG.md Add missing whitespace Co-authored-by: teor <[email protected]> * Apply suggestions from teor's review * Update CHANGELOG.md Add #2547 to changelog Clarify partial implementation of ZIP-221 * Update release date Co-authored-by: teor <[email protected]>
Motivation
ZIP-244 specifies a new digest called "authorizing data commitment" or "auth_digest" that binds to authorization data (signatures, proofs). This must be implemented for Nu5.
Part of #2048
Specifications
https://zips.z.cash/zip-0244
https://zips.z.cash/zip-0225#modifications-to-zip-244
Designs
N/A
Solution
This adds a new method in
Transaction
to compute the auth_digest. It uses librustzcash to compute it, just like we do for the transaction ID and sighash.Review
This is a requirement for ZIP-221 work, but since that's ongoing it's not urgent.
@dconnolly or @teor2345 might want to review, but I think anyone else can review it too.
Reviewer Checklist
Follow Up Work
N/A
This change is