script: Add BIP360 P2MR validation, policy plumbing, and tests #35107

pull arturschuch wants to merge 2 commits into bitcoin:master from arturschuch:bip360-p2mr-review changing 16 files +307 −11
  1. arturschuch commented at 2:33 PM on April 18, 2026: none

    What

    This PR adds draft BIP360 P2MR support wiring across script validation, policy, type solving/signing, RPC decoding, wallet integration, and test coverage.

    Main changes:

    • script interpreter:
      • add witness v2 P2MR validation path
      • verify P2MR commitment using P2MR control-block semantics
    • standardness/policy:
      • add P2MR-related standardness checks in mempool policy paths
    • script type plumbing:
      • add TxoutType::WITNESS_V2_P2MR
      • update solver/sign/address/rpc/wallet paths for the new type
    • tests:
      • add functional test test/functional/feature_p2mr.py
      • register it in test/functional/test_runner.py
      • update related unit tests

    Why

    BIP360 P2MR introduces a witness v2 pattern that needs coherent handling across interpreter, policy, and supporting infrastructure. This change set wires those components together and adds coverage for acceptance/rejection behavior.

    Scope / Non-goals

    • This PR does not claim broad "quantum-safe" guarantees.
    • It focuses on implementing and testing P2MR handling in Core’s current validation/policy/test framework.

    Test coverage

    Executed locally:

    • ctest --output-on-failure -j6
    • build/test/functional/test_runner.py feature_p2mr.py feature_taproot.py mempool_accept.py mempool_packages.py mempool_package_limits.py
    • .venv-functional/bin/python build/test/functional/test_runner.py --extended --jobs=6
    • .venv-functional/bin/python build/test/functional/test_runner.py tool_bench_sanity_check.py tool_bitcoin_chainstate.py
    • .venv-functional/bin/python build/test/functional/test_runner.py wallet_backwards_compatibility.py wallet_migration.py mempool_compatibility.py feature_coinstatsindex_compatibility.py feature_unsupported_utxo_db.py
  2. Add BIP360 P2MR validation, policy, and functional coverage 45a557c9ea
  3. test: use assert_equal in feature_p2mr reject check 72eeb9e0ca
  4. DrahtBot added the label Consensus on Apr 18, 2026
  5. DrahtBot commented at 2:33 PM on April 18, 2026: contributor

    ♻️ Automatically closing for now based on heuristics. Please leave a comment, if this was erroneous. Generally, please focus on creating high-quality, original content that demonstrates a clear understanding of the project's requirements and goals.

    📝 Moderators: If this is spam, please replace the title with ., so that the thread does not appear in search results.

  6. DrahtBot closed this on Apr 18, 2026

  7. DrahtBot commented at 2:33 PM on April 18, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • AddCoins(coins, CTransaction{tx_create}, 0, false) in src/test/transaction_tests.cpp

    <sup>2026-04-18 14:33:57</sup>

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 09:12 UTC

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