BIP-374: vendor secp256k1lab and use it for reference implementation #2084

pull theStack wants to merge 6 commits into bitcoin:master from theStack:bip374-vendor-secp256k1lab changing 17 files +442 −127
  1. theStack commented at 1:00 am on January 15, 2026: contributor

    Following up on the recent decision that secp256k1lab should be vendored per-BIP if needed/useful (see #2004 (comment) ff. and #1855 (comment) ff.), this PR exercises this for BIP-374. The changes add secp256k1lab version 1.0.0 as subtree [1] within the bip-0374 folder and take use of it in the reference implementation. In particular, secp256k1.py is removed and the TaggedHash and xor_bytes routines are used from the secp256k1lab utils module, to simplify the code further. Usage of the library is mentioned in the BIP text to be license compliant (see #2004 (comment)).

    Can be tested via:

    0$ ./bip-0374/run_test_vectors.py
    1.....
    2All test vectors passed.
    3$ ./bip-0374/gen_test_vectors.py
    4Generating /home/thestack/bips/bip-0374/test_vectors_generate_proof.csv...
    5Generating /home/thestack/bips/bip-0374/test_vectors_verify_proof.csv...
    6$ git diff
    7<shouldn't show any diffs, as generated .csv files should match the ones in the repository> 
    

    [1] added via the command $ git subtree add --prefix=bip-0374/secp256k1lab --squash https://github.com/secp256k1lab/secp256k1lab v1.0.0

  2. Squashed 'bip-0374/secp256k1lab/' content from commit 44dc4bd
    git-subtree-dir: bip-0374/secp256k1lab
    git-subtree-split: 44dc4bd893b8f03e621585e3bf255253e0e0fbfb
    3050bb6b25
  3. Merge commit '3050bb6b25c0c20b62e2fc1a23276a09d50d151b' as 'bip-0374/secp256k1lab' d2ceae1dd6
  4. BIP-374: avoid using sys.path[0] to find current working directory
    This approach is incompatible with the sys.path extension approach
    in the next commit which is used to to find the vendored copy of
    secp256k1lab, so use __file__ instead which works as well.
    4e18ee641b
  5. BIP-374: replace secp256k1.py with vendored copy of secp256k1lab 459d977d9b
  6. BIP-374: use `tagged_hash` and `xor_bytes` routines from secp256k1lab 436a3dd1fa
  7. BIP-374: mention secp256k1lab in BIP text 2b7f07986b
  8. nymius commented at 1:38 pm on January 15, 2026: contributor

    ACK 2b7f07986b5f62753486e5fd9db59c189eed946e

    The changes are aligned with the referenced comments. I’m not reviewing the vendor library as the change is not about the qualities of it.


theStack nymius


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-01-16 16:10 UTC

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