Skip to content
QORECHAIN
Register

Encrypted Apps

PharmaWatch

Catch bad drug batches early, privately.

Share on X

About

Bad drug batches usually show up first at the pharmacy counter: a rash, a reaction, or medicine that just doesn't work. But one pharmacy can't prove a pattern on its own, sharing patient cases is a privacy risk, and official reports take months. PharmaWatch lets pharmacies warn each other fast without exposing anyone. Each pharmacy seals its report so only the watchtower can open it. When 3 different pharmacies report the same batch within about an hour, a signed public alert goes out, and anyone can verify it from chain data. No names, no IDs, nothing about the patient ever goes public. It runs as a post-quantum rollup on QoreChain, and you can try it yourself at pharmawatch-pink.vercel.app/try.

How it's made

PharmaWatch lets pharmacies flag bad drug batches without leaking patient data. A pharmacy reports a bad reaction, and when enough different pharmacies report the same batch, a public alert goes out that anyone can check. How it's built • The rollup. It's a QoreChain RDK rollup (qledger-v1, based sequencing), built in TypeScript on @qorechain/rdk. It handles deposits, batches, withdrawals and fraud challenges. • Pharmacy keys. Each pharmacy gets an ML-DSA-44 key, and that key is also its rollup account. It locks 1 QOR before its reports count, so spamming costs money. • Sealed reports. Reports are encrypted with ML-KEM-1024 to the watchtower's key, which is registered on chain. The chain only ever sees a lock and a commitment, never the case. • The watchtower. A small Node service opens the reports, counts different staked pharmacies per batch, and signs an ML-DSA-87 alert once 3 report the same batch within 600 blocks (about an hour). It also replays batches and challenges a wrong state root, which slashes the operator's bond. • The site. A static site on Vercel. The playground runs the same post-quantum crypto in your browser, so you can file a report, trigger an alert and try to fake one. What was hard • QoreChain's private rollup mode drops deposits and fraud checks, so we couldn't use it. Instead, the encrypted reports sit in the normal rollup inbox. The inbox skips data it can't parse, so they get batched and signed without being executed. • Keeping patient data out by design: the report format has no name, ID or address fields, and anything extra gets rejected. • Test QOR. Running the rollup needs about 11,000 QOR and the faucet gives 100 a day. The code and keys are ready, but the full onchain run is waiting on a grant.

Timeline

PharmaWatchEncrypted Apps

Pushed 12 commits to master

  • aff107f Fix fake buttons being undone by the re-render · DaveTech2
  • 6a102b8 Fix playground edge cases · DaveTech2
  • be7c9ce Trigger first Git deploy on Vercel · DaveTech2(not counted: no real change)
  • c1a97d1 Add /try/ playground: run a pharmacy in the browser with real post-quantum keys · DaveTech2
  • 2d44b23 Tighten homepage spacing: shorter hero, denser sections · DaveTech2

and 7 more commits

Comments and questions

  • No comments yet.