bip-0327: add test vectors for cases no vector covers #2329

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:bip327-vectors changing 7 files +138 −7
  1. fametrano commented at 11:22 PM on October 10, 2026: contributor

    I implemented BIP327 independently in btclib-ecc (Python), and these are the cases my tests reach and the vectors do not. reference.py computes every new value, every new case is appended so no existing index changes, and btclib-ecc reproduces every case of the five changed files, with the same error messages.

    • det_sign: plain and x-only tweaks with a 38-byte message.
    • sign_verify: a 100-byte message; a single signer; a secnonce whose second half is zero; a secnonce generated for another signer's public key; fewer pubnonces than pubkeys at verification.
    • sig_agg: a single signer. gen_vectors_helper.py gains the case, so it still generates the file.
    • nonce_gen: an extra_in shorter than 32 bytes.
    • tweak: a 31-byte tweak; fewer is_xonly flags than tweaks.

    One case I left out: a secnonce whose second half is 1. reference.py accepts it, so it is not an error case, and every valid sign_verify case signs with secnonces[0]. Adding it would need a change to reference.py, such as a secnonce index in the valid cases. Would you want that?

    The changelog gets version 1.0.5.

    Assisted-by: my usual tools (LLM, Internet, computer). Mistakes are mine.

  2. jonatack added the label Proposed BIP modification on Oct 18, 2026
  3. jonatack added the label Pending acceptance on Oct 18, 2026
  4. fametrano force-pushed on Oct 27, 2026
  5. bip-0327: add test vectors for cases no vector covers
    New cases:
    - one signer: nonce_agg of one nonce, sign, verify, sig_agg
    - a 100-byte message
    - a plain and an x-only tweak over a 38-byte message (det_sign)
    - an extra_in shorter than 32 bytes
    - a secnonce whose second half is zero
    - a secnonce generated for another signer's public key
    - fewer pubnonces than pubkeys at verify
    - fewer is_xonly flags than tweaks
    - a 31-byte tweak
    
    reference.py computed every value. The sig_agg case is generated by
    gen_vectors_helper.py, which now includes it.
    2bed83657f
  6. fametrano force-pushed on Nov 4, 2026
  7. murchandamus commented at 6:40 PM on November 5, 2026: member
  8. jonatack commented at 7:07 PM on November 5, 2026: member

    ACK

    Tested locally by running both python3 reference.py and ./tests.sh

    Suggest deferring the omitted case.

  9. jonasnick commented at 3:23 PM on November 10, 2026: contributor

    If we create a new version of the BIP, I think we can add a few more that are missed here. Working on a PR.

  10. real-or-random commented at 3:55 PM on November 10, 2026: contributor

    Concept ACK, of course

    It's also on my list to organize a license change of the test vectors to (like done for BIP340 in #1807) in line with the new recommendation of BIP3. So my acceptance of this addition is conditional on your openness to relicense the new vectors to BSD3 OR MIT OR CC0-1.0 in the future.

  11. jonatack added the label PR Author action required on Nov 10, 2026
  12. jonatack commented at 4:06 PM on November 10, 2026: member

    So my acceptance of this addition is conditional on your openness to relicense the new vectors to BSD3 OR MIT OR CC0-1.0 in the future. @fametrano let us know, please

  13. jonasnick commented at 4:11 PM on November 10, 2026: contributor

    Thanks @fametrano. Created #2351 which supersedes this PR because it replaces a few test vectors.

  14. fametrano commented at 9:24 PM on November 10, 2026: contributor

    MIT license is always fine with me

  15. fametrano commented at 9:30 PM on November 10, 2026: contributor

    Closing in favour of #2351, which supersedes this PR.

  16. fametrano closed this on Nov 10, 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-24 00:10 UTC

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