About
SeeSign Kit is post-quantum clear signing for QoreChain.
The problem. In February 2025 Bybit lost about $1.5 billion because the signing screen was changed: the signers saw a routine transfer and approved a change to the wallet's own logic. Separately, the classical ECDSA keys most wallets use face a future quantum risk; NIST plans to deprecate them after 2030 and disallow them after 2035.
The fix. A SeeSign wallet is a smart-contract wallet on QoreChain's EVM. For every action it writes a short, fixed-format sentence (QCS-1) from the call's own arguments. The owner signs that sentence with ML-DSA-87 in QoreX (signArbitrary) or with the SeeSign CLI, a relayer submits it and pays the gas, and the contract checks the signature with QoreChain's pqcVerify against the owner's key from pqcKeyStatus. If a hacked screen changes the amount, the payee or the action, the sentence changes, the signature fails, and nothing moves.
Around that check the wallet enforces a Payee Book (money goes only to saved payees, and a new payee waits out a timelock and can be cancelled), daily limits per token, an on-chain lookalike guard, and one-time signatures with an expiry. A stolen classical key cannot move funds, add payees, raise limits or upgrade the wallet.
What is in the kit:
- QCS-1, a published clear-signing standard with 57 conformance vectors
- ClearSign, a Solidity library any contract can use (see the MyEscrow example)
- SeeSignWallet and SeeSignFactory, deployed on qorechain-diana
- @seesign/kit, the TypeScript SDK, published on npm
- a relayer that pays gas from its own scoped EVM window
- the seesign CLI, for signing from a terminal and scripting the drills
- a web app: Wallet, a Sign screen with explanations in English, Hindi or Bengali, the Attack Lab, and a Proof page
The Attack Lab sends a real attack on diana with one click and shows the refusal with its transaction hash:
- Drill 1, hacked screen: 5 fUSD shown, 500 fUSD sent. Refused, BadPqcSignature.
- Drill 2, stolen classical key: with the bait wallet's published secp256k1 key, the attacker tries to pay itself and to add itself as a payee. Refused, PayeeNotAllowed and BadPqcSignature.
- Drill 3, lookalike payee. Refused, Lookalike.
- Bonus: a replayed signature (BadNonce), an expired one (Expired), and a payee finalized before its timelock ends (Timelocked).
Testnet only: qorechain-diana, EVM chain id 9800. The honest limits are in the README and THREAT_MODEL.md.
How it's made
Architecture
- Contracts (Solidity 0.8.28, Foundry). ClearSign renders the QCS-1 sentence from the call's arguments, reads the owner's key with pqcKeyStatus (0x...0a02: registered, ML-DSA-87, possession proven) and checks the signature with pqcVerify (0x...0a01) over "qorechain-msg-v1|qorechain-diana|" + sentence. It fails closed on any unexpected answer. SeeSignWallet adds the Payee Book (5-minute timelock in the demo), daily limits, the lookalike guard (first and last 4 hex characters), nonces and expiry, and UPGRADE to a new wallet of the same owner, with no proxy. SeeSignFactory creates wallets for owners with a ready key and is the single relay entry point.
- SDK, @seesign/kit (TypeScript, on npm). It renders the same bytes. prepare() refuses to ask for a signature unless the contract's own preview sentence matches byte for byte. signWithQoreX calls QoreX signArbitrary with network and account checks. Call encoders and the contract ABIs are included.
- Relayer (Hono; a Node server or a Vercel function). It simulates every call, pays gas from its own EVM window scoped to the factory, renews the window with a cooldown, and rate-limits. The Attack Lab backend puts refused calls on chain on purpose.
- CLI, seesign. It signs only well-formed QCS-1 sentences for diana, verifies against pqcKeyStatus, submits calls and runs the drills. Testnet keys come from environment variables or a mode-600 key file that git cannot commit.
- Web app (Vite and React): Wallet, Sign screen, Attack Lab, and a Proof page generated from the deployment records.
Kits and network features
- @qorechain/sdk: accounts and recovery codes, hybrid signing (EthNativeSigner), key registration with proof of possession, EVM windows, ML-DSA-87 signing. @qorechain/evm and @qorechain/qoresign in the Phase 0 spike.
- Hybrid ML-DSA-87 native transactions: deposits, top-ups, key registrations, MsgOpenEVMWindow.
- PQC key registration with proof of possession: QoreX accounts, the relayer, the demo and bait accounts, CLI keys.
- Scoped EVM windows: the relayer's admits only the factory; the bait's admits only the bait wallet.
- The Solidity PQC signature check and key status, in ClearSign.
- QoreX signArbitrary on the Sign screen.
- The fest test tokens: fUSD in drill 1, converted into the demo wallet with MsgConvertCoin.
What was hard
- EVM transactions on QoreChain carry only a secp256k1 signature (qore-cli reports tier: classical, reason: evm_lane), so the post-quantum check had to live inside the contract.
- The published pqcKeyStatus ABI has three outputs; the live chain returns four, including possessionProven. ClearSign uses its own ABI and checks the answer's layout.
- A scoped window lists at most 16 targets and refuses contract creation, so the factory is the single relay target and creates wallets itself.
- Two renderers, TypeScript and Solidity, must agree byte for byte: 57 vectors, a 5,000-case fuzz, and a 2,000-case differential test on every CI run.
- QoreX signs "qorechain-msg-v1|" + chain id + "|" + text, at most 4,096 bytes, so the contract rebuilds exactly those bytes and sentences stay under 512 bytes.
- The faucet pays fest tokens as bank coins (erc20:0x...), which a contract cannot spend or convert. An ordinary account converts them with MsgConvertCoin.
Testing and evidence
- 357 automated tests: Foundry Layer A (138, covering every revert path, the drills, fuzzing and invariants, with 100% line coverage), Layer B (7, with a real FIPS 204 verifier behind pqcVerify and a real QoreX signature), plus 2,000 differential cases on every CI run, the SDK (137), the relayer (38), the CLI (30) and the web app (7).
- Live on diana: the live check passed 24/24, the relayer 8/8 and the CLI 12/12; every Attack Lab drill ran from the web app; and a fresh account completed a dry run of TESTERS.md. Every transaction hash is in EVIDENCE.md.
Audit
- QCAI Stage 1: 78/100 with the Ethereum (EVM/Solidity) setting. Every finding is answered with a regression test. Stage 2 runs on the final, deployed contracts. Reports are in docs/audit/, and the finding-by-finding answers in docs/AUDIT.md.
Docs: README, SPEC.md (QCS-1), THREAT_MODEL.md, EVIDENCE.md, TESTERS.md.