bip360: fix PQC lightning vector, run PQC vectors, fix typos #2376

pull devdavidejesus wants to merge 2 commits into bitcoin:master from devdavidejesus:bip360-pqc-vectors changing 4 files +20 −18
  1. devdavidejesus commented at 10:19 PM on December 2, 2026: contributor

    This PR contains two commits.

    The first commit fixes the PQC simple lightning contract vector by adding the missing 0x7f byte and recalculating its dependent values. It also updates the Python example to run both construction vector files, aligns an outdated vector description, and fixes the representation of missing script trees. With this change, the Python example passes all 9 construction vectors and all 7 PQC vectors.

    The 0x7f byte is added rather than changing the asm because the priv_key already ends with the pushed key, consistent with the other PQC key leaves. Without the final opcode, anyone knowing the preimage could spend Bob's leaf without providing a signature, unlike the matching leaf in p2mr_construction.json, which ends in OP_CHECKSIG.

    The second commit fixes the invalid P2PK example in the long exposure table, updates the Address Format reference to include BIP 350, and corrects several typos.

    The previous values from the corrected lightning vector do not appear anywhere else in the repository or in open PRs touching BIP 360.

    Note for the authors: Line 348 still contains an unclosed parenthesis and refers to the Python example demonstrating a secp256k1 signature, which is no longer accurate since the Rust and JS implementations were removed. I have left this unchanged in this PR.

  2. bip360: fix pqc lightning vector and run pqc vectors
    Run both PQC and regular construction vectors in the Python example.
    Fix the missing 7f byte in the PQC simple lightning contract and
    recalculate its dependent values.
    Align the outdated vector description and use scriptTree: null
    for missing script trees.
    7f62087ef5
  3. bip360: fix P2PK example, BIP 350 reference and typos
    Fix the invalid P2PK example and reference BIP 350 in the
    address format description.
    Correct several typos in the BIP text.
    5fd96e901f
  4. jonatack added the label Fixups on Dec 2, 2026
  5. jonatack commented at 11:08 PM on December 2, 2026: member

    ACK cc @cryptoquick for sign-off

    Downstream sync note: Because the Rust/JS bindings were moved to https://github.com/jbride/libbitcoinpqc-bindings (see 0.12.1 changelog entry), if that repo pins or duplicates p2mr_pqc_construction.json, will it need the updated p2mr_simple_lightning_contract vector as well?

  6. devdavidejesus commented at 12:11 AM on December 3, 2026: contributor

    Thanks for the review and the ACK!

    FWIW, I checked: jbride/libbitcoinpqc-bindings vendors copies of both files under tests/vectors/p2mr/fixtures/, identical to those on current bitcoin/bips master, and they are loaded by the Rust, Python, and Node tests.

    Both files would need updating to stay in sync with upstream, not just the PQC file, since p2mr_construction.json also changes to use scriptTree: null. The provenance notes in tests/vectors/p2mr/README.md would need updating as well.

    Their Rust, Python, and Node P2MR construction tests pass with both the updated and existing files, so this is about keeping the repositories in sync rather than fixing a test failure. I can open a follow-up PR there after this one is merged, if useful.

  7. cryptoquick commented at 1:01 AM on December 3, 2026: contributor

    I will keep them updated, and I'm maintaining the bindings also in my own fork of that repo: https://github.com/cryptoquick/libbitcoinpqc-bindings

    I'll get these changes added there.

  8. jonatack commented at 2:16 AM on December 3, 2026: member
  9. jonatack merged this on Dec 3, 2026
  10. jonatack closed this on Dec 3, 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-12-03 17:10 UTC

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