BIP-352: add test vectors for skipped inputs and label edge cases #2330

pull fametrano wants to merge 2 commits into bitcoin:master from fametrano:bip352-vectors changing 2 files +686 −1
  1. fametrano commented at 11:28 PM on October 10, 2026: none

    This adds five test vectors for BIP352 cases the file does not cover; the changelog entry names them. reference.py computes every expected value and passes on the whole file, and btclib-wallet, which I maintain, agrees on all five (run). The version is 1.1.4 because #2323 takes 1.1.3; I will rebase whichever lands second.

    Was I right to remove three cases that cannot be consensus-valid, under the scope #2339 proposes? They are a P2PKH input whose pubkey hash matches 33 bytes that are not a valid key, a P2TR input with an empty witness, and a P2TR input whose output key is not on the curve. reference.py keeps code for all three, and no vector reaches it now. I kept inputs whose only flaw is a placeholder signature: the file has no spending transactions, and the ECDSA signatures these vectors reuse from it have no sighash byte.

  2. jonatack added the label Proposed BIP modification on Oct 18, 2026
  3. jonatack added the label Pending acceptance on Oct 18, 2026
  4. BIP-352: add test vectors for skipped inputs and label edge cases
    Five send and receive vectors for cases the file does not cover yet:
    - inputs of ineligible types (P2WSH, P2MS, P2PK, empty scriptPubKey)
      beside an eligible one;
    - a P2SH-P2WSH input beside an eligible one, which is skipped;
    - a P2TR script path spend whose internal key is not NUMS, which counts;
    - the largest label, 0xFFFFFFFF;
    - two recipients, one with a labeled address listed after the other
      recipient, with a taproot and a non-taproot input.
    
    The P2WSH and P2SH-P2WSH witness script is also a valid compressed key,
    so an implementation that reads the last witness item as a key fails.
    
    reference.py computed the expected values and passes on the whole file.
    bca5a23c4a
  5. BIP-352: add version 1.1.4 to the changelog
    Bump the version to 1.1.4 and list the five new test vectors.
    6e98c49355
  6. fametrano force-pushed on Nov 1, 2026

github-metadata-mirror

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-11-03 19:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me