About
Unlike a notary that stores any hash you send, PQ Receipt stores a receipt only after QoreChain's own PQC precompile has verified an ML-DSA-87 signature from the signer's registered key, for any document, signed in the QoreX wallet in your browser, and revocable later with a fresh post-quantum signature.
Releases, approved invoices and signed contracts must stay provably yours for decades, and today's signatures (ECDSA, Ed25519) will be forgeable once a large quantum computer exists. PQ Receipt is for the people who sign those files: maintainers shipping releases, finance teams approving payments, anyone who agrees to a document.
It records that an account signed a file: the file's SHA-256 plus an ML-DSA-87 signature that ReceiptBook checks on chain before storing anything, reading the signer's key from the PQC Key Status precompile (0x…0a02; ML-DSA-87 and proof of possession required) and verifying with the PQC Verify precompile (0x…0a01). ReceiptBook refuses a forged or wrong-key signature (bad stamps sent as real transactions on v3 and again on v4 reverted, nothing stored), and a signer can later withdraw a receipt with a fresh signature from the key registered now. Every transaction is listed in the README's "On testnet" and "Refused on chain" tables.
Try it: stamp with QoreX in the web app (https://apps.swiftbotlab.workers.dev/proof/pq-receipt/), or check any file in one command with nothing of ours in the path: `npx -y github:swiftbotlabs/pq-receipt#v1.1.0 --sample` (npm 10+). It verifies the signature on your machine with a one-bit control that must fail, shows whether the signer still holds that key and whether the receipt was revoked, and ends PASSED or BLOCKED; the same check is a GitHub release gate (action.yml).
How it's made
PQC proof for jurors (10 seconds): ReceiptBook v4 calls the 0x0a02 pqcKeyStatus precompile (all four outputs, possessionProven included) and the 0x0a01 pqcVerify precompile in src/ReceiptBook.sol lines 154-168 (https://github.com/swiftbotlabs/pq-receipt/blob/c359dd3/src/ReceiptBook.sol#L154-L168), used by every stamp (L114-115) and by revoke (L105-106). Both ran on v4 (0x56656ec9779ded1ac113f215a982b6076c2242e4) in a stamp (0x3ab99b2449e818b45ddd877058c10759f050a7f3d1595cc3a39cad299174413a) and its signed revocation (0x9de5f71e2e940d2107a3e3056d43843c7885b64309bd418b926ab1b0f31a47d9). Rerun it yourself, read-only: `bash scripts/juror-check.sh` calls 0x0a01 on that receipt's real key and signature (true; one flipped bit: false), reads 0x0a02, and shows v4 rejecting a replayed signature (BadSignature) and a caller with no PQC key (NoPqcKey); output in docs/juror-check.txt.
Contract: generated with create-qorechain-dapp 0.14.0 (foundry template, credited in the README). Both stamping paths (stamp, stampFor) and revoke share one check: key from 0x0a02 (registered, ML-DSA-87, possession proven), signature through 0x0a01, nothing stored on failure.
Web app (web/, from the viem-wagmi template, RainbowKit with @qorechain/qorex-rainbowkit): hashes the file on your device, signs with QoreX's native provider (enable, getKey, signArbitrary, signAndBroadcast), reads only the public EVM RPC, so it is static files.
Tests: 56 Foundry tests with 100% line, branch and function coverage of ReceiptBook.sol (docs/COVERAGE.md): valid and bad signatures, wrong document, replay by another account, relayer redirection, cross-path and cross-network signatures, no key, wrong algorithm, a key without proof of possession, a missing possessionProven output, key removal and rotation, a dead precompile failing closed, revocation (fresh signature, current key, no double revoke), fuzzing bit flips, relayers, signers and rotations, and an invariant campaign (every receipt names a key its signer really registered; no corrupt signature ever stored). 40 offline verifier tests on two real receipts check that the page's and the CLI's message bytes equal the contract's.
Live checks: `npm run live-check` calls the testnet precompile read-only (real signature true, one changed byte false). Bad stamps were also sent as real transactions on v3 and v4 and reverted (docs/REFUSALS-v3.json, docs/REFUSALS.json). The release gate (action.yml, `npm run receipt -- verify` with EXPECT_SIGNER) and both test suites run on every push; CI is green.
Records and credits: the README lists every transaction with the account that sent it; docs/THREAT-MODEL.md maps each threat to its test; AI_USAGE.md has the decision ledger; every runtime dependency is credited with its licence, @noble/post-quantum (MIT) first. The platform's checker awarded the Ship Weeks badge 'First contract with a PQC check' (v3 deploy 0x125ce539abb9f052535ab1d2f0d5900d0803bab10e148eee49e54c7fb481fbfc); its FAQ says the Solidity PQC features are checked by jurors by hand, which is what the block above is for.