Repository navigation
Closed
Description
Summary
0.1.x has a fixed independent P2MR OP_CHECKSIGPQC witness vector for the default/no-codeseparator path, but I could not find fixed, independent vectors that pin p2mrSigMsg / p2mrSighash when the last executed OP_CODESEPARATOR changes m_codeseparator_pos.
This is a test-vector coverage gap for a consensus-critical transcript field. I am not claiming a known consensus bug.
Evidence
- P2MR sighash serialization includes
execdata.m_codeseparator_posin the BIP342/BIP360 extension data:src/script/interpreter.cpp:1785-1791. - Runtime P2MR script execution does update that field when
OP_CODESEPARATORexecutes:src/script/interpreter.cpp:1166-1174. - The wallet/signing helper path only supports the no-codeseparator signing path and sets
m_codeseparator_pos = 0xffffffff:src/script/sign.cpp:108-122, also verification helpersrc/script/sign.cpp:145-159. - The unit-test helper
BuildExecData()also hard-codes0xffffffff:src/test/script_p2mr_tests.cpp:475-484. - The current fixed vector file has one vector named
single_key_default_sighash; itsleafScriptis only<pubkey> OP_CHECKSIGPQC, and itsp2mrSigMsgends inffffffff:src/test/data/p2mr_pqc_witness_vectors.json. script_p2mr_testspins that default vector'sp2mrSigMsg/p2mrSighash, but recomputes throughBuildExecData()with the default codeseparator position:src/test/script_p2mr_tests.cpp:551-580,src/test/script_p2mr_tests.cpp:1373-1401.- Existing generic Bitcoin/Taproot codeseparator coverage, for example
test/functional/feature_taproot.py:764-781, exercises Taproot/SchnorrTapSighash, not P2MRCHECKSIGPQCwithP2MRSighash. - The P2MR fuzz target signs through
MutableTransactionSignatureCreator::CreatePQCSignature(), which uses the default codeseparator path, and is not a fixed independent oracle:src/test/fuzz/p2mr_script.cpp:475-494.
Current PR Reconciliation
Checked current 0.1.x and open PRs in Qbit-Org/qbit.
- Add independent CHECKDATASIGPQC vector coverage #38 adds independent
OP_CHECKDATASIGPQCvectors, notOP_CHECKSIGPQCcodeseparator sighash vectors. - Add independent CHECKDATASIGADDPQC vector coverage #42 adds independent
OP_CHECKDATASIGADDPQCthreshold vectors, notOP_CHECKSIGPQCcodeseparator sighash vectors. - Add P2MR data-hash proof fixtures #43 adds P2MR data-hash proof fixtures, not transaction
p2mrSigMsgcodeseparator vectors. - Add independent P2MR commitment vectors #47 adds independent P2MR commitment/control-block vectors, not sighash transcript vectors.
- Searches for
codeseparator P2MR CHECKSIGPQC p2mrSighashfound no open PR or issue covering this gap.
Expected Fixed-Vector Contents
Add independent fixtures, generated without qbit signing/sighash helpers, that include at least:
nameprovenancespendTxprevoutAmountprevoutScriptPubKeyleafScriptcontrolBlockpubkeysignaturecodeseparatorPos- raw
p2mrSigMsg p2mrSighash- a negative signature/hash for the wrong codeseparator position, or equivalent near-miss data
The tests should hash the pinned p2mrSigMsg with HASHER_P2MR_SIGHASH, compare it to the pinned p2mrSighash, then compare qbit's SignatureHashP2MR() result against the pinned value.
Boundary Cases To Cover
OP_CODESEPARATORbeforeOP_CHECKSIGPQC, proving a non-default position such as0is serialized instead of0xffffffff.- Branch-dependent codeseparators, where two valid spends of the same committed script select different branches and therefore different last executed codeseparator positions.
- An unexecuted branch codeseparator should not affect the transcript.
- Wrong-position or wrong-branch signatures should fail with
SCRIPT_ERR_P2MR_SIG.
Acceptance Criteria
- Add fixed independent P2MR
CHECKSIGPQCvectors for non-default codeseparator positions. - Extend
script_p2mr_teststo load multiple CHECKSIGPQC witness vectors instead of assuming only the default vector. - Tests pin raw
p2mrSigMsgbytes andp2mrSighash, not only production-helper recomputation. - Tests would fail if P2MR CHECKSIGPQC always serialized
0xffffffffform_codeseparator_pos. - Do not count legacy, P2WSH, or Taproot codeseparator tests as satisfying this unless the new tests exercise P2MR
CHECKSIGPQCand pin the P2MR-specific transcript.
Metadata
Metadata
Assignees
Labels
No labels
Activity