fametrano
commented at 10:46 PM on August 5, 2026:
contributor
In the "invalid output witnessScript typed key" case, the value no longer hashes to the redeemScript's P2WSH program: 65f0b3dd trimmed it to its last six bytes while fixing a short read. This restores the original 37-byte script as the value and keeps the key one byte too long — the only defect, same layout the redeemScript case already uses, same total length.
Made with my usual tools: a computer, the Internet and an LLM. The mistakes, as usual, are all mine.
fametrano
commented at 9:24 AM on September 7, 2026:
contributor
@achow101 as BIP174's author, could you take a look? In short: the "invalid output witnessScript typed key" vector is meant to fail on the key length alone, but the pushed key in its witnessScript is not a point on secp256k1, so an implementation that validates the key and skips the length check rejects the case for the wrong reason and the missing check goes unnoticed. This swaps in a valid point; nothing else changes and CI is green.
fametrano renamed this: BIP-174: test data: a public key in the witnessScript case BIP-174: test data: fix off-curve pubkey in the witnessScript case on Sep 11, 2026
fametrano renamed this: BIP-174: test data: fix off-curve pubkey in the witnessScript case BIP-174: test data: the witnessScript case should fail on the key length, can fail on an off-curve pubkey on Sep 11, 2026
fametrano renamed this: BIP-174: test data: the witnessScript case should fail on the key length, can fail on an off-curve pubkey BIP-174: test data: fix off-curve pubkey in the witnessScript case on Sep 11, 2026
fametrano force-pushed on Sep 12, 2026
fametrano force-pushed on Sep 19, 2026
fametrano force-pushed on Sep 23, 2026
murchandamus requested review from achow101 on Sep 23, 2026
murchandamus added the label Bug fix on Sep 23, 2026
achow101
commented at 11:34 PM on September 23, 2026:
member
Tend to NACK
The pr description is needlessly verbose and confusing. I've re-read it 5 times and do not understand what the actual problem is. What do curve points have to do with witness scripts? The keydata for a PSBT_OUT_WITNESS_SCRIPT does not contain any interpretable data, and the point of the test is to make sure that parsers are checking the length and not interpreting any data.
jonatack
commented at 11:49 PM on September 23, 2026:
member
fametrano renamed this: BIP-174: test data: fix off-curve pubkey in the witnessScript case BIP-174: test data: make the witnessScript in the invalid-key case match its P2WSH hash on Sep 24, 2026
fametrano
commented at 5:27 PM on September 24, 2026:
contributor
You're right about the curve points — the keydata is filler, so nothing off-curve is reachable; my description was wrong. The real defect: since 65f0b3dd the witnessScript value no longer hashes to the redeemScript's P2WSH program. This restores the original 37-byte script as the value and keeps the key one byte too long — the same layout the redeemScript case already uses. Happy to close if that check doesn't belong here.
fametrano force-pushed on Sep 24, 2026
fametrano force-pushed on Sep 26, 2026
BIP-174: test data: make the witnessScript in the invalid-key case match its P2WSH hash
In the "PSBT with invalid output witnessScript typed key" case, the
value of the PSBT_OUT_WITNESS_SCRIPT record no longer hashes to the
P2WSH program in the output's redeemScript: 65f0b3dd trimmed it to its
last six bytes while fixing a short read.
Re-encode the record as `02 0100 25 <script>`: the key stays one byte
too long, which is what the case tests, and the value is the original
37-byte script again. Same total length, same layout as the "invalid
output redeemScript typed key" case.
This is a metadata mirror of the GitHub repository
bitcoin/bips.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-10-14 03:10 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me