Add in v6 and Ironwood TX-id / Auth-ID code#510
Merged
Conversation
ebfull
requested changes
Jun 24, 2026
ebfull
left a comment
Collaborator
There was a problem hiding this comment.
Let's make this API nicer.
Collaborator
Author
|
Updated, agreed prior API was not good. My recollection was some decisions were made in Orchard to not expose it to V5/V6 tx formats (which is not possible for the hashing update) I think the new bundle pool parameters implementation is far cleaner. |
czarcas7ic
reviewed
Jun 24, 2026
Collaborator
Author
|
Addressed all comments and combined into one commit! |
czarcas7ic
reviewed
Jun 25, 2026
czarcas7ic
reviewed
Jun 25, 2026
ebfull
requested changes
Jun 25, 2026
czarcas7ic
reviewed
Jun 25, 2026
czarcas7ic
reviewed
Jun 25, 2026
czarcas7ic
reviewed
Jun 25, 2026
Co-Authored-By: Dev Ojha <dojha@berkeley.edu>
ebfull
requested changes
Jun 25, 2026
Replace the internal AnchorCommitment enum with two boolean predicates (includes_anchor_in_txid_digest / includes_anchor_in_authorizing_digest) and reword the bundle commitment documentation for clarity. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ebfull
reviewed
Jun 25, 2026
Comment on lines
+96
to
+105
| fn includes_anchor_in_txid_digest(self) -> bool { | ||
| matches!(self, BundleCommitmentFormat::OrchardV5) | ||
| } | ||
|
|
||
| fn includes_anchor_in_authorizing_digest(self) -> bool { | ||
| matches!( | ||
| self, | ||
| BundleCommitmentFormat::OrchardV6 | BundleCommitmentFormat::IronwoodV6 | ||
| ) | ||
| } |
Collaborator
There was a problem hiding this comment.
We could just define these in terms of each other, but I'll let someone else insist on it first.
Collaborator
Author
|
Changes look great to me! Looks way better with tx version being explicit |
ebfull
approved these changes
Jun 25, 2026
ebfull
reviewed
Jun 25, 2026
TalDerei
approved these changes
Jun 25, 2026
TalDerei
left a comment
Collaborator
There was a problem hiding this comment.
checked against ZIP 229 and generated some of my own local test vectors for redundancy against zcash/zcash-test-vectors#130.
ebfull
approved these changes
Jun 25, 2026
czarcas7ic
added a commit
to valargroup/voting-circuits
that referenced
this pull request
Jun 25, 2026
Move the orchard pin from cab7d78 to the head of zcash/orchard#510 (dev/tx-id: the v6 / Ironwood TX-id + Auth-ID work). That branch was rebased with public-API renames, so this is a source port, not just a rev bump: - Note::new reordered to (.., version, rng); swap the two args at every call site. - RandomSeed::rcm -> rcm_v2 (the V2 derivation; qr_rcm -> rcm_v3). - NoteVersion::DEFAULT removed (it was = V2); replace with V2, except real_proof_roundtrip's real delegated note, which must be V3 (DELEGATION_NOTE_VERSION) — that test was latently red before this bump because it built a V2 note the builder rejects. The new orchard circuit Config rotates the delegation and vote-proof verifying keys (share-reveal unchanged); update both VK-fingerprint tripwires accordingly. Intentional VK rotation. Verified: cargo check --all-targets --all-features clean; 141/141 unit tests pass; all ignored delegation proving tests pass (happy_path, real_proof_roundtrip); all three VK fingerprint tripwires green.
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.
This PR brings the v6 transaction hashing (txid / authorizing digest) code for Orchard and Ironwood bundles into the branch. It originated as the V6 tx-hashing work from #505 layered on the QR note-version PR (#509).
Rather than introducing a single combined struct, commitment computation is selected by two parameters threaded through the public commitment API:
BundlePoolRestrictions— the(pool, era)selector. It determines the flag-byte encoding (pre-NU6.3 rules where bit 2 is reserved, vs. NU6.3 rules where bit 2 isenableCrossAddress).TxVersion(V5/V6) — the transaction version the bundle is encoded in. It selects the commitment personalization strings and where the anchor is committed: a v5 transaction includes the anchor in the transaction-ID (effects) digest, while a v6 transaction includes it in the authorizing digest instead.Both are now arguments to
Bundle::commitment,Bundle::<Authorized, V>::authorizing_commitment, and thehash_bundle_txid_empty/hash_bundle_auth_emptyhelpers. This is required because the sighashing code definitively needs to know both the pool (for the flag byte) and the transaction version (for the personalizations and anchor placement) — neither alone is sufficient.Internally,
(pool_restrictions, tx_version)is resolved byBundlePoolRestrictions::commitment_format(tx_version)into a privateBundleCommitmentFormatenum with three variants:OrchardV5— anchor in the txid digest; legacy personalizations.OrchardV6— anchor in the authorizing digest; reuses the v5 action-level personalizations and gains_v6top-levelbundle/authstrings.IronwoodV6— anchor in the authorizing digest; fresh_v6personalizations throughout (Ironwood bundles exist only in v6 transactions).Each format carries its set of BLAKE2b personalization strings. Because
Bundle::commitmentnow depends on the pool restrictions, it returnsResult<BundleCommitment, CommitmentError>and fails withCommitmentError::UnrepresentableFlagswhen a bundle's flags cannot be encoded under the given pool (e.g. a cross-address-restricted bundle under a pre-NU6.3 pool).New personalization strings:
ZTxIdOrchardH_v6,ZTxAuthOrchaH_v6ZTxIdIronwd_H_v6,ZTxIdIrnActCH_v6,ZTxIdIrnActMH_v6,ZTxIdIrnActNH_v6,ZTxAuthIrnwdH_v6All constants should match: