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

Add UnifiedIncomingViewingKey struct #1245

Merged
merged 11 commits into from
Mar 18, 2024
Merged

Add UnifiedIncomingViewingKey struct #1245

merged 11 commits into from
Mar 18, 2024

Conversation

AArnott
Copy link
Contributor

@AArnott AArnott commented Mar 9, 2024

  • Remove some fn implementations in the UFVK type and have it instead simply forward to the UIVK type. For example address generation needn't be implemented twice.
  • Update zcash_client_sqlite where it left placeholders for using the new UIVK type.
  • Consider adding ZIP-316 rev. 1 support to both UFVK and UIVK types.
  • Add tests

zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
@AArnott
Copy link
Contributor Author

AArnott commented Mar 9, 2024

@nuttycom Why is #[doc(hidden)] applied to the existing UnifiedFullViewingKey struct? Should I remove it at this point, or add it to the new UnifiedIncomingViewingKey struct?

zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

This looks great, it looks to me like the hdwallet AddressGenerationError and keeping the decode and encode convenience methods (to limit API breakage slightly) are the only blocking issues.

@nuttycom
Copy link
Contributor

nuttycom commented Mar 9, 2024

@nuttycom
Copy link
Contributor

nuttycom commented Mar 9, 2024

@nuttycom Why is #[doc(hidden)] applied to the existing UnifiedFullViewingKey struct? Should I remove it at this point, or add it to the new UnifiedIncomingViewingKey struct?

Oh, yeah, we should definitely remove that and have both of these publicly documented.

@AArnott AArnott marked this pull request as ready for review March 9, 2024 20:06
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
@nuttycom nuttycom dismissed their stale review March 11, 2024 19:34

Unblocking for others to review, since I don't have time at the moment. @daira?

AArnott and others added 2 commits March 12, 2024 06:37
Also update sqlite to utilize the new struct
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

One minor naming fix, otherwise looks good!

@nuttycom nuttycom force-pushed the uivk branch 6 times, most recently from 04798e4 to f3fb7db Compare March 14, 2024 17:24
nuttycom
nuttycom previously approved these changes Mar 14, 2024
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

utACK 4d9927b

zcash_keys/src/keys.rs Outdated Show resolved Hide resolved
nuttycom
nuttycom previously approved these changes Mar 14, 2024
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

utACK b4171ca

nuttycom
nuttycom previously approved these changes Mar 14, 2024
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

re-utACK 25045b3

Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

re-utACK 6102e83

@@ -206,7 +206,7 @@ impl Account {
) -> Result<(UnifiedAddress, DiversifierIndex), AddressGenerationError> {
Copy link
Contributor

@daira daira Mar 15, 2024

Choose a reason for hiding this comment

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

This method can be public. (It will need a changelog entry.)

Copy link
Contributor

Choose a reason for hiding this comment

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

In general we would like to avoid encouraging users to use the default_address method. In any case, this is not a change that should be made in this PR.

let _encoded_no_t = "uivk1020vq9j5zeqxh303sxa0zv2hn9wm9fev8x0p8yqxdwyzde9r4c90fcglc63usj0ycl2scy8zxuhtser0qrq356xfy8x3vyuxu7f6gas75svl9v9m3ctuazsu0ar8e8crtx7x6zgh4kw8xm3q4rlkpm9er2wefxhhf9pn547gpuz9vw27gsdp6c03nwlrxgzhr2g6xek0x8l5avrx9ue9lf032tr7kmhqf3nfdxg7ldfgx6yf09g";

// We test the full roundtrip only with the `sapling` and `orchard` features enabled,
// because we will not generate these parts of the encoding if the UIVK does not have an
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// because we will not generate these parts of the encoding if the UIVK does not have an
// because we will not generate these parts of the encoding if the UIVK does not have

Non-blocking.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

utACK

@nuttycom nuttycom merged commit 273712b into zcash:main Mar 18, 2024
22 of 25 checks passed
@AArnott AArnott deleted the uivk branch March 18, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants