#32247 BIP-348 (OP_CHECKSIGFROMSTACK) (regtest only)

full analysis

https://github.com/bitcoin/bitcoin/pull/32247 · jamesob · +296/-12 in 20 files, 3 commits · labels: Consensus, Needs rebase, Needs Conceptual Review · draft

Goal

  • Allow developers to experiment with covenants and LN-Symmetry on regtest using OP_CHECKSIGFROMSTACK
  • Enable testing arbitrary stack signature verification in Tapscript without risking mainnet consensus

This pull request implements BIP-348 (OP_CHECKSIGFROMSTACK) within Tapscript, restricted strictly to regtest activation via version bits. It introduces the opcode to the script interpreter, provides verification for 64-byte Schnorr signatures against arbitrary stack messages, and adds functional and unit test coverage.

Problem: Bitcoin Tapscript currently lacks an opcode to verify signatures over arbitrary data on the execution stack, which prevents testing and prototyping covenants and protocols such as LN-Symmetry (Eltoo). Developers and researchers need a working implementation on regtest to experiment with these designs without activating new consensus rules on mainnet.

Category: Validation (#11 of 48)

P2 · new feature

  • P2 because it enables practical experimentation with proposed covenant designs on regtest
  • Validating consensus correctness and script semantics is strategically valuable for the network roadmap

P2 because proposed consensus additions require careful evaluation and this PR enables tangible experimentation with covenants on regtest. Even though activation is limited to regtest, validating proposed script semantics and establishing consensus correctness is strategically important for the network roadmap.

Membership: Implements a new script opcode OP_CHECKSIGFROMSTACK in the interpreter (src/script/interpreter.cpp) and sets up a version bits consensus deployment in src/validation.cpp.

Factors: security/stability 0, bug 0, performance 0, user value 2, leverage 2

Reviewability: Stale: Needs rebase

  • Needs rebase and has merge conflicts with master
  • Author has been silent for over 400 days

The PR has merge conflicts with master and the author has been silent for over 400 days.

Author status: silent since 2025-05-12

Open concerns:

  • Discussion on whether OP_CHECKSIGFROMSTACK should be restricted only to Tapscript or also permitted in legacy/segwit script
  • Broader community debate regarding whether and how to bundle covenant opcodes for mainnet activation

Resolved concerns:

  • JeremyRubin raised API and boundary checks regarding empty messages and pubkey types, which were discussed and confirmed compliant with the BIP
  • instagibbs provided an extensive set of edge-case functional tests for feature_taproot.py, which the author incorporated

Agreement: Positive

  • Broad support with no blocking objections to regtest implementation
  • Code review ACK noting implementation matches BIP semantics (JeremyRubin)
  • Contributed functional tests covering edge cases and sigops budgets (instagibbs)
  • Concept approval without stated reasons (jonatack, shahsb, yuvicc, delta1)

Positive; multiple Concept ACKs and code review ACK from JeremyRubin, with no blocking objections to the regtest implementation.

Technical feedback on the PR itself has been constructive and supportive, with JeremyRubin providing a code review ACK and instagibbs providing tests. Broader governance discussions on covenant activation have been moved to Delving Bitcoin rather than blocking this regtest-only PR.

  • Concept ACK from jonatack, shahsb, yuvicc, and delta1
  • JeremyRubin gave cr ACK on commit cb0c9f6 noting it matches the BIP semantics
  • instagibbs contributed functional tests in feature_taproot.py covering sigops budgets and corner cases
  • pinheadmz suggested moving non-code conceptual discussion to meta discussions

Review verdicts (DrahtBot): 0 (+1)

Dependencies

Enables:

  • Regtest experimentation with covenants and LN-Symmetry (BIP-348)

Files

165 lines under test/bench/ci.

  • src/script/interpreter.cpp +92/-3
  • test/functional/feature_taproot.py +85/-1
  • src/test/data/tx_valid.json +29/-0
  • test/functional/test_framework/script.py +18/-2
  • src/validation.cpp +12/-1
  • test/functional/rpc_blockchain.py +13/-0
  • src/test/data/tx_invalid.json +8/-0
  • src/script/interpreter.h +6/-0
  • src/test/versionbits_tests.cpp +6/-0
  • src/kernel/chainparams.cpp +5/-0
  • src/pubkey.cpp +3/-2
  • src/deploymentinfo.cpp +4/-0
  • src/rpc/blockchain.cpp +4/-0
  • src/policy/policy.h +2/-1
  • src/pubkey.h +2/-1
  • src/script/script.cpp +3/-0
  • src/test/transaction_tests.cpp +2/-0
  • src/consensus/params.h +1/-0
  • src/script/script.h +1/-0
  • test/functional/test_framework/key.py +0/-1

Card

Implements BIP-348 OP_CHECKSIGFROMSTACK for Tapscript on regtest only, enabling script validation of arbitrary message signatures on the stack. This provides the foundation for covenant designs and layer-2 protocols such as LN-Symmetry without modifying mainnet consensus rules. It is strategically important as part of the broader covenant design and activation debate. Review is currently stale because the PR needs a rebase and the author has been silent since May 2025. It has received several Concept ACKs and code review approval from Jeremy Rubin with no blocking technical objections.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:49, confidence high, input hash 909be6080fab6992