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

Implement ZIP 302 structured memos #668

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Oct 6, 2022

Implements zcash/zips#638.

@str4d
Copy link
Contributor Author

str4d commented Oct 6, 2022

Force-pushed to fix a bug and CI lints.

Comment on lines +11 to +12
/// A Sapling return address.
ReturnAddress(PaymentAddress),
Copy link
Contributor Author

@str4d str4d Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I copied this type code from some existing implementation of structured memos. It was Sapling-specific then, but we can easily expand its definition to be any valid recipient address encoding.

Note that this uses a byte encoding rather than a string encoding for more efficient packing, so we may need to consider how this interacts with Unified Addresses (which now exist). We don't need to serialize the network of the address, as that is implicit in the transaction (via the chain in which it is mined), so can just be provided by the caller if they want to take the address and encode it as a string.

@nuttycom nuttycom self-requested a review October 6, 2022 19:18
@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Attention: Patch coverage is 25.75758% with 98 lines in your changes missing coverage. Please review.

Project coverage is 75.08%. Comparing base (e940620) to head (e7a12ea).
Report is 1352 commits behind head on main.

Files Patch % Lines
zcash_primitives/src/memo/structured.rs 30.76% 72 Missing ⚠️
zcash_primitives/src/memo/builder.rs 0.00% 17 Missing ⚠️
zcash_primitives/src/memo.rs 18.18% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #668      +/-   ##
==========================================
- Coverage   75.70%   75.08%   -0.63%     
==========================================
  Files         103      105       +2     
  Lines       10535    10666     +131     
==========================================
+ Hits         7976     8009      +33     
- Misses       2559     2657      +98     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@str4d str4d added the C-zip-impl Category: An implementation of a ZIP, or a request to do so label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-zip-impl Category: An implementation of a ZIP, or a request to do so
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant