Conversation
956c76e to
ae912df
Compare
nullcopy
reviewed
Apr 2, 2026
… unknown items Add EXPIRY_HEIGHT_ITEM (0xE0) and EXPIRY_TIME_ITEM (0xE1) constants. Change decode_unified to accumulate unknown items as a list instead of asserting on duplicates, since R2 encodings can contain multiple metadata typecodes. Update R0 generator assertions accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate test vectors for R2 Unified Addresses with zu (shielded-only) and tu (transparent-enabled) HRPs, and optional address expiry metadata (typecodes 0xE0 and 0xE1). Produces 60 vectors covering Sapling-only, Orchard-only, mixed shielded, and transparent+shielded combinations with various expiry configurations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate test vectors demonstrating the full UFVK (uvf) -> UIVK (uvi) -> UA (zu/tu) derivation chain for Revision 2 unified viewing keys. Each of the 20 vectors includes: - R2 UFVK with P2PKH, P2SH (ZIP 48 2-of-3 sortedmulti), Sapling, and Orchard FVK items, plus optional expiry metadata - Derived R2 UIVK with template transformation (/** -> /*), key derivation at non-hardened index 0, and metadata retention - Derived R2 UA with P2SH address computation via BIP 67 sorted redeem script and expiry propagation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract derive_sapling_fvk, derive_sapling_ivk, derive_orchard_fvk, and derive_orchard_ivk into viewing_key_derivation.py. These were duplicated across unified_full_viewing_keys.py, unified_incoming_viewing_keys.py, and unified_viewing_keys_r2.py. Each function returns the serialized bytes along with intermediate key objects needed by callers for further derivation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The UFVK and UIVK bech32m strings were being stored via .encode() as hex-encoded UTF-8 bytes (Vec<u8>), while unified addresses were already stored as plain strings (&'static str). Change all viewing key generators to store the bech32m string directly, consistent with how addresses are stored. Affects: unified_full_viewing_keys, unified_incoming_viewing_keys, unified_viewing_keys_r2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8e129c7 to
9d8a3b1
Compare
daira
reviewed
Apr 3, 2026
daira
reviewed
Apr 3, 2026
daira
reviewed
Apr 3, 2026
daira
reviewed
Apr 3, 2026
Per ZIP 316: "A Unified Address or Unified Viewing Key MUST contain at least one non-metadata Item." Metadata is typecodes 0xC0..=0xFC. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that expiry height and time metadata survive encode/decode in the R2 viewing key generator, matching the existing assertions in the R2 address generator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate the random bool before checking the condition, so that changes to the condition don't disrupt the RNG stream for subsequent test vectors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sapling needs the account_key for diversifier derivation (find_j, diversifier, pk_d), unlike Orchard where the FVK has those methods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update each generator's filename argument to render_tv to use the correct path relative to the repo root, so the URLs in generated test vectors point to the actual source files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The parameter now holds a module path (e.g. zcash_test_vectors/orchard/key_components) rather than a bare filename. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
As suggested by @vivek-arte in #112. This does not change the output with the current version of rustfmt but is good practice for forward compatibility. Co-Authored-By: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 4, 2026
nuttycom
commented
Apr 6, 2026
Contributor
Author
nuttycom
left a comment
There was a problem hiding this comment.
utACK delta since last review
nullcopy
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #117