PaymentAddress encapsulation#109
Conversation
|
Currently this PR encapsulates
Thoughts? I could also postpone the above to a later PR, and merge the encoding changes as-is. |
a39280b to
e59510e
Compare
|
I took the first approach to encapsulation above (only enforcing |
daira
left a comment
There was a problem hiding this comment.
utACK. Can we add a test for try_sapling_output_recovery that catches the case of zero pk_d that would previously have been (incorrectly) accepted?
There was a problem hiding this comment.
This can propagate the error by returning None, but that is correct and fixes a bug :-)
There was a problem hiding this comment.
Here I will add my regularly scheduled exhortation to rename the PrimeOrder marker to PrimeSubgroup (zcash/sapling-crypto#97). Here we actually have a point that is enforced to be prime order, and renaming the marker is still the right thing to do, because it's not the marker that is enforcing that.
Does not block.
There was a problem hiding this comment.
Similarly this should be renamed to as_prime_subgroup. Does not block.
There was a problem hiding this comment.
The spec indeed says that you should use a valid diversifier here (section 4.7.2 which refers to 4.2.2), so looping to find one is correct.
|
Added the test @daira requested. I checked that it fails if applied to current master. |
daira
left a comment
There was a problem hiding this comment.
ACK 988b0d949dde359a4e9c013066df3d8280164122
There was a problem hiding this comment.
What does this end up looking like on the cpp side? Previously we were passing in:
output.note.d.data(),
output.note.pk_d.begin(),
There was a problem hiding this comment.
On the C++ side, those two fields are concatenated.
Introduces a PaymentAddress::from_parts constructor, and getters for the diversifier and pk_d fields (which are now private).
988b0d9 to
d6f6b50
Compare
|
Rebased on master to fix two trivial merge conflicts with #110. |
Codecov Report
@@ Coverage Diff @@
## master #109 +/- ##
==========================================
+ Coverage 56.17% 56.22% +0.04%
==========================================
Files 43 43
Lines 6134 6120 -14
==========================================
- Hits 3446 3441 -5
+ Misses 2688 2679 -9
Continue to review full report at Codecov.
|
feat: tx CLI, genesis instructions, ceremony fixes
Closes #102.