bip374: add new test vectors checking for boundaries #2335

pull ViniciusCestarii wants to merge 1 commits into bitcoin:master from ViniciusCestarii:bip-374-new-test-vectors changing 3 files +26 −5
  1. ViniciusCestarii commented at 9:16 PM on October 20, 2026: contributor

    Add 3 new generate proof test vectors for testing boundaries:

    Success: a = 1, a = N-1 Failure: a = N+1 (catches implementation that does mod n on secret instead of first rejecting)

  2. jonatack added the label Proposed BIP modification on Oct 20, 2026
  3. jonatack added the label Pending acceptance on Oct 20, 2026
  4. jonatack commented at 9:44 PM on October 20, 2026: member

    cc BIP authors @andrewtoth, @RubenSomsen, and @theStack

  5. fametrano commented at 12:35 PM on October 21, 2026: none

    ACK 60b4c758, tested: the new vectors agree with an independent implementation.

    The PR adds success cases for a=1 and a=N-1 and a failure case for a=N+1 to the proof-generation vectors. With the existing a=0 and a=N failures, both ends of the valid range are now pinned from both sides.

    I ran all 14 rows of the CSV through btclib-ecc's BIP374 code, with and without libsecp256k1. Every success proof matched byte for byte and verified. The four failure rows (a=0, a=N, a=N+1, B at infinity) were refused. Re-running gen_test_vectors.py reproduced both CSV files exactly. The verification file is unchanged and already covers e=N and s=N, so I see no boundary missing from this change. Script and logs on request.

  6. theStack commented at 5:10 AM on October 25, 2026: contributor

    LGTM, can you add a small changelog entry with bumped PATCH version?

  7. bip374: add new test vectors checking for boundaries afaa856630
  8. ViniciusCestarii force-pushed on Oct 26, 2026
  9. ViniciusCestarii commented at 10:19 AM on October 26, 2026: contributor

    Forced-push afaa856630058b87188648111da5dab0dd311bf7 addressing #2335 (comment)

  10. theStack approved
  11. theStack commented at 2:07 AM on October 27, 2026: contributor

    ACK afaa856630058b87188648111da5dab0dd311bf7

  12. jonatack removed the label Pending acceptance on Oct 27, 2026
  13. jonatack merged this on Oct 27, 2026
  14. jonatack closed this on Oct 27, 2026

  15. jonatack removed the label Proposed BIP modification on Oct 27, 2026
  16. jonatack added the label Tests on Oct 27, 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-12 08:10 UTC

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