Add versioned signatures for Transparent transactions#35
Merged
Conversation
cc631d8 to
34db9e9
Compare
da2f267 to
8c2eab9
Compare
34db9e9 to
f3d9ef6
Compare
PaulLaux
previously approved these changes
Nov 2, 2025
|
|
||
| def transparent_scripts_digest_v6(tx): | ||
| digest = blake2b(digest_size=32, person=TRANSPARENT_AUTH_DIGEST_PERSONALIZAION) | ||
| for (sighash_info, x) in zip(tx.vSighashInfo, tx.vin): |
Comment on lines
+155
to
+158
| if hasattr(self, "bindingSigSapling"): | ||
| self.bindingSigSaplingInfo = sighash_info | ||
| if hasattr(self, "bindingSigOrchard"): | ||
| self.bindingSigOrchardInfo = sighash_info |
There was a problem hiding this comment.
Later, in
for desc in tx.vOutputsSapling:
digest.update(bytes(desc.proof))
digest.update(write_compact_size(len(tx.bindingSigSaplingInfo)))
digest.update(bytes(tx.bindingSigSaplingInfo))
digest.update(bytes(tx.bindingSigSapling))what happens if tx.bindingSigSaplingInfo in None?
Author
There was a problem hiding this comment.
def sapling_auth_digest_v6(tx):
digest = blake2b(digest_size=32, person=SAPLING_AUTH_DIGEST_PERSONALIZAION)
if len(tx.vSpendsSapling) + len(tx.vOutputsSapling) > 0:
for desc in tx.vSpendsSapling:
digest.update(bytes(desc.proof))
for desc in tx.vSpendsSapling:
digest.update(write_compact_size(len(desc.spendAuthSigInfo)))
digest.update(bytes(desc.spendAuthSigInfo))
digest.update(bytes(desc.spendAuthSig))
for desc in tx.vOutputsSapling:
digest.update(bytes(desc.proof))
digest.update(write_compact_size(len(tx.bindingSigSaplingInfo)))
digest.update(bytes(tx.bindingSigSaplingInfo))
digest.update(bytes(tx.bindingSigSapling))
return digest.digest()
If tx.bindingSigSaplingInfo is None and we try to access it, an exception will be raised.
The function sapling_auth_digest_v6 is only called for v6 transaction.
In this function, tx.bindingSigSaplingInfo and tx.bindingSigSapling are accessed only when the transaction includes a Sapling element.
For v6 transactions, whenever a Sapling element is present, both of these fields are populated.
PaulLaux
approved these changes
Nov 3, 2025
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.
Add
SighashInfo(version and associated data) toUpdate
auth_digestby addingSighashInfoas defined in ZIP246Add
SighashInfofor Sapling/Orchard binding signatures only when the signatures exist