Repository navigation
Description
Problem
0.1.x currently has a fixed independent P2MR OP_CHECKSIGPQC witness vector only for single_key_default_sighash. That fixture pins the serialized transaction, P2MR leaf/control data, p2mrSigMsg, p2mrSighash, pubkey, and PQC signature.
The production sighash path appears to support the full BIP341-style matrix for P2MR, including SIGHASH_NONE, SIGHASH_SINGLE, and ANYONECANPAY combinations, but the non-default modes are not pinned by fixed independent consensus vectors.
This should be tracked as a vector-oracle gap, not as a confirmed consensus failure.
Evidence
src/test/data/p2mr_pqc_witness_vectors.jsoncontains one vector namedsingle_key_default_sighash.src/test/script_p2mr_tests.cpploads that single fixture and checksp2mrSigMsg,p2mrSighash, domain separation, PQC signature verification, and valid spend acceptance.src/test/fuzz/p2mr_script.cppenumeratesSIGHASH_NONE,SIGHASH_SINGLE,SIGHASH_ALL | ANYONECANPAY,SIGHASH_NONE | ANYONECANPAY, andSIGHASH_SINGLE | ANYONECANPAY, but fuzz coverage is not a fixed independent vector oracle.src/script/interpreter.cppuses theP2MRSighashtagged hash and switches committed fields based on output type andANYONECANPAY.- Functional tests exercise wallet/RPC P2MR signing paths, mostly default sighash, but do not pin independent
OP_CHECKSIGPQCmessage bytes/hash/signature for the non-default matrix. - Current open PRs do not close this exact gap:
- Add independent CHECKDATASIGPQC vector coverage #38 adds independent
OP_CHECKDATASIGPQCcoverage. - Add P2MR data-hash proof fixtures #43 adds P2MR data-hash proof fixtures.
- Add independent P2MR commitment vectors #47 adds P2MR commitment/control-block vectors.
- Fix PQC data-hash counter accounting #46 and Reject non-P2MR raw funding outputs #37 are unrelated to
OP_CHECKSIGPQCsighash vectors.
- Add independent CHECKDATASIGPQC vector coverage #38 adds independent
Proposed Minimal Vector Matrix
Add independent fixed OP_CHECKSIGPQC vectors for:
| Vector | Hashtype | Required commitment behavior |
|---|---|---|
single_key_sighash_none |
0x02 |
Commit all inputs through shared prevouts, amounts, scriptPubKeys, and sequences; omit all outputs. |
single_key_sighash_single_matching_output |
0x03 |
Commit all inputs through shared input hashes; commit only the output at the signing input index; omit the all-outputs hash. |
single_key_sighash_all_anyonecanpay |
0x81 |
Commit only the current input prevout, spent output, and sequence; commit all outputs; omit shared input hashes. |
single_key_sighash_none_anyonecanpay |
0x82 |
Commit only the current input prevout, spent output, and sequence; omit shared input hashes and all outputs. |
single_key_sighash_single_anyonecanpay |
0x83 |
Commit only the current input prevout, spent output, sequence, and matching output; omit shared input hashes and all other outputs. |
Each vector should also commit the common P2MR sighash fields: epoch, hashtype byte, transaction version, locktime, spend type, P2MR leaf hash, key version, and code-separator position. If the vectors intentionally omit annex coverage, state annex: none explicitly.
Risk
If a non-default P2MR CHECKSIGPQC mode is miscommitted, implementations can diverge on which transaction fields are signed. That is a consensus split risk after activation: one node may accept a PQC signature that another rejects, or reject a valid spend that another accepts. Because these modes are rarely used compared with default/all signing, the missing independent vectors leave a hard-fork-sensitive edge under-tested.
Closure Criteria
- Add fixed, independently generated fixtures for all five non-default modes above.
- For each fixture, pin at least:
- serialized spend transaction
- prevout amount and scriptPubKey
- P2MR leaf script, control block, and leaf version
- pubkey
- signature including explicit hashtype byte
- raw
p2mrSigMsg - final
p2mrSighash - provenance explaining the independent generator and that qbit signing/sighash helpers were not used
- Add positive tests proving each fixture spends successfully under
SCRIPT_VERIFY_P2MR_RULES. - Add mutation checks that fail when committed fields change and continue to pass when intentionally omitted fields change.
- Do not count generic sighash tests, wallet signing tests, or fuzz enumeration as closure unless they consume these fixed P2MR
OP_CHECKSIGPQCvectors.
Activity