
Encrypted Apps
Courier
Encrypted invoices and documents that get paid, with recipient keys bound on chain by ML-DSA-87.
About
When two QoreChain accounts exchange an invoice or a document, a relay has to carry it, and an untrusted relay can swap in its own key or store ciphertext to decrypt later. Courier delivers encrypted invoices and documents between QoreChain addresses and ties each one to its payment and delivery receipt on chain. Each recipient binds a prekey bundle to their address in `PrekeyDirectory` with an ML-DSA-87 signature; before encrypting, the sender checks the bundle against the chain, so a swapped key is refused before a byte is sealed. Files are sealed on the device with ML-KEM-1024 plus X25519 and a double ratchet. `MemoPay` pays the invoice in fUSD and stores only the ciphertext hash; `DeliveryReceipts` checks the recipient's ML-DSA-87 receipt on chain. Try it with no wallet: https://courier-fawn-psi.vercel.app/app/try. Switch the relay to Lying and watch the refusal (public demo keys that hold nothing).
How it's made
Contracts. PrekeyDirectory stores one ML-DSA-87-bound bundle hash per owner (7-day maximum expiry); DeliveryReceipts records one signed receipt per ciphertext hash; MemoPay moves fUSD and stores keccak256(ciphertext) only (132-byte calldata, never holds tokens). Post-quantum. The handshake is four X25519 terms plus ML-KEM-1024 encapsulation to a one-time prekey, never to the long-term identity key, then a double ratchet with an ML-KEM step. publish and record call pqcVerify (0x…0a01) and check key status with pqcKeyStatus (0x…0a02) through PqAuth from haven-pq-kit. The client also checks the bundle's ML-KEM key against the chain's KEM registry (IDENTITY_KEM) and the X25519 key against a card signed by the registered ML-DSA-87 key (CARD). QoreChain pieces. QoreSeal (cards, KEM registry), QoreSign (receipts, SIWQ inbox sign-in), deploys and publishes in EVM windows opened by hybrid ML-DSA-87 transactions, keys registered with proof of possession, MCP in npm run evidence, QoreScan in npm run cbom:check. Web. Next.js: /app/try runs the real protocol in the browser and reads the registered ML-KEM key through a read-only same-origin proxy; /app/receipt verifies recorded signatures live. Testing. 66 TypeScript and 40 Foundry tests; npm run evidence 35 passed, 0 failed. Limits. No hosted relay (it can still drop traffic), bundles must be renewed every 7 days, no external audit. README: "Judge it in 5 minutes", "Where the PQC checks are (for jurors)", "Credits". Contracts (qorechain-diana): PrekeyDirectory 0x3d9a5821d0a24220a5f244a63a4a641d2acd9c2d · MemoPay 0x0fef978df64a5516e9f52ba1f4b2bbea6b7bd98c · DeliveryReceipts 0x06b52afc4a151b0efa260e2adcdf2d477632cb56. Catch a lying relay: https://courier-fawn-psi.vercel.app/app/try · every key transaction with explorer links: https://github.com/datharnu/courier#proof-table
Timeline
Comments and questions
- No comments yet.