Skip to content

feat(wasm-utxo): fix zcash blake2b sighash for 256-byte outputs#257

Merged
lcovar merged 2 commits intomasterfrom
BTC-0.fix-zcash-blake-bug
Apr 22, 2026
Merged

feat(wasm-utxo): fix zcash blake2b sighash for 256-byte outputs#257
lcovar merged 2 commits intomasterfrom
BTC-0.fix-zcash-blake-bug

Conversation

@OttoAllmendinger
Copy link
Copy Markdown
Contributor

Update miniscript dependency from bitgo.1 to bitgo.2, which includes
the corresponding bitcoin crate update to 0.32.8-bitgo.2.

A Zcash transaction with 8 P2SH outputs has a 256-byte outputs preimage
(8 × 32 bytes each), which is an exact multiple of the 128-byte BLAKE2b
block size. The old blake2b_256_personal in rust-bitcoin processed all
complete blocks eagerly and left an empty buffer for finalize, causing a
spurious all-zero final block and an incorrect sighash.

Added regression test that signs such a transaction and verifies the
signature, catching the regression in wasm-utxo's Zcash signing and
verification path.

Issue: BTC-0

OttoAllmendinger and others added 2 commits April 22, 2026 10:54
A Zcash transaction with 8 P2SH outputs has a 256-byte outputs preimage
(8 × 32 bytes each), which is an exact multiple of the 128-byte BLAKE2b
block size. The old blake2b_256_personal in rust-bitcoin processed all
complete blocks eagerly and left an empty buffer for finalize, causing a
spurious all-zero final block and an incorrect sighash.

This test signs such a transaction and verifies the signature, catching
the regression in wasm-utxo's Zcash signing and verification path.

Issue: BTC-0
Update miniscript dependency from bitgo.1 to bitgo.2, which includes
the corresponding bitcoin crate update to 0.32.8-bitgo.2.

Issue: BTC-0

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review April 22, 2026 09:13
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner April 22, 2026 09:13
@lcovar lcovar merged commit 2319b70 into master Apr 22, 2026
16 checks passed
@lcovar lcovar deleted the BTC-0.fix-zcash-blake-bug branch April 22, 2026 13: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.

2 participants