
Post-Quantum dApp
Crumena
Money for one purpose: pots that pay only approved payees, within your limits, every step signed with ML-DSA-87.
About
Money given for a purpose often isn't spent on it: a budget handed to someone else, a weekly allowance, a grant, a fund several people paid into. Today the funder either trusts the spender completely or pays every bill personally. Crumena sits in between. A funder fills a pot for someone. The spender can pay only the payees the funder approved, only up to the amount the funder set for each payee, within the pot's limits (a cap per payment, and a limit per day, week or month), and never after the end date. The spender can ask for a new payee with the amount they need; the funder approves it for an amount of their own choice. Whatever is left goes back to the funder. If something looks wrong, such as the spender's phone going missing, the funder freezes the pot in one step. Every action is a plain sentence, not a hex blob. The spender reads "pay 25 fUSD from pot #4 to Halden Building Supplies…", signs it in QoreX with their ML-DSA-87 key, and the Crumena contract rebuilds that exact text and checks the signature with QoreChain's pqcVerify precompile, against the key the chain holds for that person (pqcKeyStatus). Change one character and the signature fails. A stolen ordinary (ECDSA) key signs nothing. The spender needs no gas and no crypto knowledge: a relayer with an EVM window scoped to the Crumena contract submits each call, and it can't change anything because every call is authorised by someone else's post-quantum signature. Each pot has its own address and a short link, so anyone can pay in, by ERC-20 transfer or straight from the bank lane with MsgConvertCoin. Every payment gets a receipt anyone can check: it rebuilds the statement from the chain as of the block before, reads the signer's key at that block, and verifies the ML-DSA-87 signature in the browser. No trust in Crumena's server. Try to break it: the home page has a real pot with real test money and a real post-quantum key. Pick an attack (pay yourself, go over the cap, change the amount after signing, replay, sign with another key, approve yourself, take everything) and the live contract refuses it in front of you. Try it in two minutes: the demo gives you three test people (a funder, a spender and a payee) with real ML-DSA-87 keys registered on QoreChain testnet. No wallet, no sign-up. Live on qorechain-diana at 0xaF8Bed9f9e3C21F2E7a79c9968bFedA54d92E1F5. The live run passed 23 of 23 checks with real ML-DSA-87 signatures, including six attacks and four rule breaks refused by the chain (a stolen classical key, a missing post-quantum signature, the wrong key, a replay, an unapproved payee, an amount raised after signing, over the cap, past the weekly limit, past a payee's approved amount, a frozen pot). Tests: 166 contract, 20 server, 28 app. QCAI audit: 72 on v3, then 85/100 on v4 after the fixes (the highest score reported in the track); every finding across four reports is answered in docs/AUDIT.md with code and tests.
How it's made
Contract (Solidity 0.8.28, Foundry, via-IR). Crumena.sol builds every action's statement as printable ASCII from the call's own arguments: create a pot, pay, approve a payee up to an amount, change that amount, remove or request a payee, confirm an address, change limits, freeze, extend, release. It checks the ML-DSA-87 signature over "qorechain-msg-v1|qorechain-diana|<statement>" (exactly what QoreX's signArbitrary signs) with the pqcVerify precompile (0x…0a01), against the key read from pqcKeyStatus (0x…0a02: registered, ML-DSA-87, possession proven; it fails closed). Nonces are per signer and sequential, signatures expire within 7 days, statements name the contract and the chain. Each pot has its own CREATE2 vault that only Crumena can move money from, and a short link code looked up on chain. Spending rules (cap per payment, limit per period, an amount per payee) and freezing are enforced in the contract and are themselves signed statements. Money-moving functions update state first and are reentrancy-guarded. 166 Foundry tests, including fuzzing that no period ever pays out more than its limit, an invariant that each payee's total is exact, and regression tests for every audit finding. Relayer and API (TypeScript, Node, Hono, @qorechain/sdk, @qorechain/evm, @qorechain/qoresign). The relayer submits calls from an EVM window scoped to the Crumena contract only, so it pays everyone's gas but can't act alone. It registers its own ML-DSA-87 key with proof of possession on startup and signs hybrid transactions. An activity index reads Crumena's events and fUSD transfers into each vault; a deposit index finds MsgConvertCoin payments from the bank lane, which leave no EVM log. The demo endpoint creates three people, funds them, and registers each one's ML-DSA-87 key on chain. The public challenge runs each attack against the live contract exactly as an attacker would build it, without sending it, and counts the refusals. App (React 19, Vite, viem, uqr). Before anything is signed, the app reads the statement from the contract, checks each line matches what the person asked for (it refuses a tampered server), shows the full text, then signs in QoreX, refusing if QoreX switched account. Receipts and the Verify button load ML-DSA-87 only when used and check a past action entirely in the browser. A guide shows who's who (funder, spender, payee). Self-hosted fonts, light and dark themes following the device, WCAG 2.1 AA checked with axe-core on every page. Proof. A live testnet script runs the whole flow plus the attacks with real keys and writes docs/testnet-run.json (23/23), which the home page shows step by step. A bytecode script shows the deployed code is exactly this source (24,122 bytes, same hash). QCAI audit 85/100 on v4, every finding answered in docs/AUDIT.md. Built with AI tools (Claude), documented in AI_USAGE.md; every signature on testnet came from a real ML-DSA-87 key, and the human reviewed and pushed every commit.
Timeline
Comments and questions
- No comments yet.