Repository navigation
Description
Summary
OP_CHECKDATASIGPQC positive-path coverage is still self-confirming: tests sign ComputeQbitDataSigPQCHash(...) with qbit's own helper and then verify the same helper through the interpreter. The exact QbitDataSigPQC byte contract is documented, but there is no independent fixed digest or executable witness vector proving the data-signature path remains stable across signing and verification refactors.
This is a coverage hardening issue, not evidence that PQC verification is currently broken.
Current Status
Verified still present on 2026-06-26:
- Default branch:
main maincommit checked:4b7e1043ced39218757f9c103460ef05ea4b86d7- Related issue:
Qbit-Org/qbit#20remains open and covers independentOP_CHECKSIGPQCP2MR/PQC witness vectors. - Related PR:
Qbit-Org/qbit#30remains open against0.1.xfrominvestigate-issue-20at5287f545d6c9a73a3c4b54dcfec8b3f2c1e5977b; it addsp2mr_checksigpqc_*vectors, but noOP_CHECKDATASIGPQCindependent vector. - Issue searches for
OP_CHECKDATASIGPQC,signdatapqchash,datasig_hash,CHECKDATASIGPQC,QbitDataSigPQC, andINDVECfound no existing issue for this narrower data-signature vector gap.
Impact
A shared bug in QbitDataSigPQC domain construction, byte serialization, message-hash handling, or witness assembly could be self-confirming:
- qbit computes the data-signature hash.
- qbit signs that hash.
- qbit interpreter verification recomputes the same hash.
- the positive test passes even if the externally intended byte contract changed.
The release currently has lower-level PQC vectors and related OP_CHECKSIGPQC vector work, but the OP_CHECKDATASIGPQC consensus path should have its own fixed data-signature vector because it validates a different domain and a different witness shape.
Evidence
- Manifest SHA:
sha256:19928603d4ba7883b0918f8698e0f5c7376c4cd287cc85e6c18034d472a830d5 - Scope ID:
r11-p2mr-pqc-independent-vectors - Code refs:
src/script/interpreter.cpp:462verifiesOP_CHECKDATASIGPQCby recomputingComputeQbitDataSigPQCHash(msg_hash).src/script/interpreter.cpp:2200definesComputeQbitDataSigPQCHashas theQbitDataSigPQCtagged hash over a 32-byte message hash.src/test/script_p2mr_tests.cpp:111definesSignDataSigPQCby signingComputeQbitDataSigPQCHash(msg_hash).src/test/script_p2mr_tests.cpp:1373accepts a generatedOP_CHECKDATASIGPQCsignature produced bySignDataSigPQC.src/test/script_p2mr_tests.cpp:1396accepts a witness-supplied message hash using a generatedSignDataSigPQCsignature.src/test/script_p2mr_tests.cpp:1618checks the data-signature domain, but its positive branch still signs viaSignDataSigPQC.test/functional/feature_p2mr.py:528exercisessigndatapqchash/verifydatapqchash.test/functional/feature_p2mr.py:621spends aCHECKDATASIGPQCleaf using the RPC-produced signature.
- Spec refs:
doc/design/p2mr-datapqchash.mddocumentsComputeQbitDataSigPQCHash(message_hash)and saysOP_CHECKDATASIGPQCverifies the sameQbitDataSigPQCdomain.Qbit-Org/qbit#20/Qbit-Org/qbit#30are related but currently coverOP_CHECKSIGPQC, not this data-signature opcode path.
- Tests / fuzz refs:
script_p2mr_tests/p2mr_checkdatasigpqc_accepts_valid_signaturescript_p2mr_tests/p2mr_checkdatasigpqc_accepts_witness_supplied_message_hashscript_p2mr_tests/p2mr_checkdatasigpqc_uses_data_signature_domainfeature_p2mr.py::test_data_pqc_hash_rpc
Review-local independent digest check:
TaggedHash("QbitDataSigPQC", 0x48 * 32)
= d9f39a1a0a8acc8147f683da6e063d060a287e9c959d613ac537dbd06a10c532
That digest is not asserted by main, the 0.1.x branch, or the related investigate-issue-20 PR branch.
Failure / Attack Path
This is a test-oracle failure mode:
- A refactor accidentally changes the
QbitDataSigPQCdigest construction, witness message-hash ordering, or opcode verification contract. - qbit's signing helper and interpreter helper share the same changed implementation.
- Generated positive-path tests continue passing.
- External wallets, attestors, bridges, or other software producing signatures against the previous byte contract no longer interoperate, or worse, tests fail to catch an unintended consensus contract change before release.
Reproduction
No failing runtime repro is expected; this is a missing independent fixture.
Verification commands used:
git ls-remote --heads <qbit-remote>
gh repo view Qbit-Org/qbit --json defaultBranchRef,nameWithOwner,url
gh issue list --repo Qbit-Org/qbit --state all --search "OP_CHECKDATASIGPQC" --limit 20 --json number,title,state,url
gh issue list --repo Qbit-Org/qbit --state all --search "signdatapqchash" --limit 20 --json number,title,state,url
gh issue list --repo Qbit-Org/qbit --state all --search "datasig_hash" --limit 20 --json number,title,state,url
git grep -n "p2mr_checkdatasigpqc.*independent\\|datasig.*independent\\|QbitDataSigPQC.*d9f39a1a\\|d9f39a1a0a8acc8147f683da6e063d060a287e9c959d613ac537dbd06a10c532" <qbit-remote>/investigate-issue-20 -- src test docSuggested Fix
Add an independent OP_CHECKDATASIGPQC fixture that pins:
- one fixed 32-byte
message_hash - the exact
QbitDataSigPQCdigest - a fixed PQC public key
- a fixed PQC signature over that digest
- the leaf script and witness bytes for
<pubkey> OP_CHECKDATASIGPQC - a
VerifyScriptpositive case
Add near-miss negatives from the same fixture:
- wrong data-signature domain or digest
- one-byte mutated signature
- wrong message hash
- wrong public key
- wrong leaf script or P2MR commitment
- malformed signature / pubkey / message-hash sizes, where not already covered
If possible, derive the fixture outside qbit's production signing helper and commit the fixture generator or derivation notes so future reviewers can reproduce the vector.
Reverify Requirement
Reverify by confirming the target branch includes executable tests for OP_CHECKDATASIGPQC that do not call qbit's production ComputeQbitDataSigPQCHash before constructing the expected digest or signing the positive vector. The tests should assert at least one fixed digest and should fail when the domain, message hash, public key, signature, or P2MR commitment is changed.
Activity