bip375: import DLEQ from BIP-374 instead of vendoring #2309

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:2026-09-bip375-import-DLEQ-from-BIP374-instead-of-vendoring changing 2 files +24 −80
  1. jonatack commented at 6:37 PM on September 25, 2026: member

    bip-0375/deps/dleq.py copied dleq_* functions from bip-0374/reference.py and could go out of sync (#2262, #2304). Replace with a loader so the validator uses bip-0374/reference.py.

    To run the tests:

    python bip-0375/test_runner.py
    
  2. jonatack commented at 8:00 PM on September 25, 2026: member

    cc BIP authors @andrewtoth, @achow101, @josibake for feedback

  3. bip375: import DLEQ from BIP-374 instead of vendoring
    bip-0375/deps/dleq.py was a copy of bip-0374/reference.py
    and could go out of sync. Replace the copy with a loader so
    the validator always uses the current BIP-374 reference.py.
    503119db2c
  4. jonatack force-pushed on Sep 27, 2026
  5. jonatack commented at 6:00 PM on September 27, 2026: member

    Rebased following merge of #2286.

  6. macgyver13 commented at 9:01 PM on September 29, 2026: contributor

    tACK 503119d

  7. fametrano commented at 10:08 AM on October 9, 2026: contributor

    I suggest also dropping bip-0375/deps/secp256k1lab in this PR, with its README entry, and pointing its path in test_runner.py to bip-0374/secp256k1lab/src. I tried this locally and the 43 tests pass. The path change is needed: with the copy dropped and the path unchanged, importing validator.inputs before deps.dleq fails with ModuleNotFoundError: No module named 'secp256k1lab'.

    At 503119d that copy is no longer used. deps/dleq.py loads bip-0374/reference.py, which puts bip-0374/secp256k1lab/src at the front of sys.path. This happens before the validator's first secp256k1lab import. So the validator already runs on BIP-374's copy, as python3 -v bip-0375/test_runner.py shows. The tests pass either way because the two copies are identical today. If they drift apart, no test will notice, and the README will still list the unused copy as a dependency.


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-10-18 07:49 UTC