Skip to content

Add P2MR PQC annex sighash vectors - #54

Merged
kiwidream merged 2 commits into
0.1.xfrom
p2mr-pqc-annex-sighash-vectors
Jul 2, 2026
Merged

kiwidream merged 2 commits into
0.1.xfrom
p2mr-pqc-annex-sighash-vectors

Conversation

@kiwidream

@kiwidream kiwidream commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add an independent annex-present P2MR OP_CHECKSIGPQC witness vector.
  • Extend the P2MR PQC witness-vector loader to handle multiple named vectors and optional annex/no-annex fields.
  • Validate annex spend-type encoding, annex hash commitment, no-annex contrast data, and annex-specific near-miss failures.

Fixes #51.

Verification

  • python3 -m json.tool src/test/data/p2mr_pqc_witness_vectors.json
  • git diff --check
  • cmake --build build --target test_bitcoin -j6
  • build/bin/test_qbit --run_test=script_p2mr_tests --catch_system_error=no --log_level=test_suite
  • Focused independent vector accept/reject test cases
  • Docker lint container with targeted whitespace/newline/include/Python linters

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Changes are limited to test fixtures and script_p2mr_tests; no production sighash or script interpreter logic is modified in this diff.

Overview
Adds an independent annex-present P2MR OP_CHECKSIGPQC witness fixture (single_key_default_sighash_annex_present) to p2mr_pqc_witness_vectors.json, including annex bytes/hash, contrast no-annex sighash/sigmsg/signature fields, and a 4-stack-item spend tx.

Refactors script_p2mr_tests so witness JSON loads as a named, multi-entry set: optional annex and data-sig fields, BuildExecData(leaf, annex) for annex hashing, and helpers that select the data-sig / data-sig-add vectors by capability instead of assuming a single combined fixture.

CHECKSIG accept/reject tests now iterate all vectors; for annex cases they assert spend-type 0x03 vs 0x02, annex hash commitment, and extra near-misses (drop annex, corrupt annex, wrong no-annex signature).

Reviewed by Cursor Bugbot for commit 35a42d7. Bugbot is set up for automated code reviews on this repo. Configure here.

@kiwidream
kiwidream force-pushed the p2mr-pqc-annex-sighash-vectors branch from d10c21c to f0c63df Compare June 29, 2026 19:12

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f0c63df. Configure here.

Comment thread src/test/script_p2mr_tests.cpp Resolved
@kiwidream
kiwidream force-pushed the p2mr-pqc-annex-sighash-vectors branch from f413611 to 353edcb Compare June 30, 2026 01:00
@djh58
djh58 self-requested a review June 30, 2026 13:53
djh58
djh58 previously approved these changes Jun 30, 2026
@kiwidream
kiwidream force-pushed the p2mr-pqc-annex-sighash-vectors branch from 353edcb to 06f11a6 Compare June 30, 2026 14:36
@kiwidream
kiwidream force-pushed the p2mr-pqc-annex-sighash-vectors branch from 06f11a6 to 35a42d7 Compare June 30, 2026 19:46
@kiwidream
kiwidream merged commit f8f32bb into 0.1.x Jul 2, 2026
56 of 59 checks passed
djh58 pushed a commit that referenced this pull request Jul 2, 2026
* Accept legacy AuxPoW RPC payloads (#23)

* Prevent AuxPoW signalling in permissionless GBT (#22)

* wallet: defer P2MR getnewaddress keypool refill (#13)

* wallet: defer P2MR getnewaddress keypool refill

* wallet: bound internal P2MR keypool refill

* wallet: align P2MR top-up lock ordering

* wallet: schedule raw change P2MR refills

* wallet: report paused P2MR refills as failed

* wallet: log inline P2MR refill failures

* ci: fix BuildKit helper lint

* Document AuxPoW commitment order fields (#35)

* Restrict explicit wallet output types on P2MR-only chains (#25)

* Restrict explicit wallet output types

* test: run BECH32 wallet suites on unrestricted regtest

* fuzz: run wallet transaction target on unrestricted regtest

* Fix BuildKit helper lint

* Report missing wallet output managers accurately

* Allow managerless wallets with default output options

* test: add independent P2MR and CTV script vectors (#29)

* Add independent P2MR PQC witness vector tests (#30)

* test: add independent P2MR PQC witness vector

* test: verify P2MR wrong-domain vector signature

* Fix AuxPoW legacy payload disambiguation

* wallet: avoid MarkUnused P2MR full top-up (#31)

* wallet: avoid MarkUnused P2MR full top-up

* wallet: avoid MarkUnused lock inversion

* wallet: preserve P2MR recovery lookahead

* Split P2MR wallet unit tests (#52)

* Remove unused P2MR wallet test import (#58)

* Shard P2MR wallet unit tests (#60)

* Add independent CHECKDATASIGPQC vector tests (#38)

* test: add P2MR data-hash proof fixtures (#43)

* test: add independent P2MR commitment vectors (#47)

* Reject invalid raw funding outputs (#37)

* Validate witness-pruned assumevalid before wipe (#59)

* Add independent CHECKDATASIGADDPQC vector tests (#42)

* qt: recommend wallet encryption by default (#62)

* Verify libbitcoinpqc tagged subtree imports (#41)

* ci: verify libbitcoinpqc tagged subtree imports

* ci: handle peeled libbitcoinpqc tag refs

* ci: peel libbitcoinpqc tag objects before compare

* ci: pass auth to libbitcoinpqc verifier

* ci: pin libbitcoinpqc verifier inputs

* ci: verify libbitcoinpqc import tree

* Add P2MR PQC annex sighash vectors (#54)

* Add P2MR PQC annex sighash vectors

* Guard annex mutation vector test

* Add P2MR data signature support to Qt Sign/Verify (#63)

* qt: add P2MR data signature dialog

* qt: support text data in P2MR signatures

* qt: align P2MR proof verification with RPC

* test: add P2MR CHECKSIGPQC sighash vectors (#55)

* Add rawmr future-leaf coverage (#64)

* test: cover P2MR SIGHASH_SINGLE missing outputs (#57)

* test: add P2MR PQC codeseparator vectors (#56)

* Fix PQC data-hash counter accounting (#46)

* Fix PQC data-hash counter accounting

* Fix PQC data-hash leaf error priority

* Report final PQC slot failures as exhausted

* doc: add v0.1.2-testnet4 release notes

* build: bump version to v0.1.2-testnet4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants