Skip to content
QORECHAIN
Register

Encrypted Apps

SoKham

Post-quantum medical records: lab results encrypted in your browser with ML-KEM-1024, shared with exactly one doctor, ev

Share on X

About

Medical records have to stay secret for decades, and that makes them a prime target for "harvest now, decrypt later": ciphertext stolen today and opened once a large quantum computer exists. A blood test taken in 2026 still matters in 2056. SoKham ("medical book" in Vietnamese) is an encrypted health-record app built on QoreChain's post-quantum stack: The lab uploads a result. It is encrypted in the browser with ML-KEM-1024 to the patient's encryption key, which is read from QoreChain's on-chain key registry. Only ciphertext leaves the browser. The chain stores just a hash. The patient decrypts it locally and decides who else can read it. Sharing re-encrypts the record to one doctor's registered key and is anchored on-chain as a hybrid-signed (secp256k1 + ML-DSA-87) transaction. The authorized doctor can open it. Any other doctor cannot, because they hold the wrong key. This is cryptography, not an access-control flag. The patient can revoke access, and the revoke is anchored on-chain too. Every add, grant and revoke appears in an audit timeline with links to the explorer. Nothing here is a mock. Keys are registered with MsgRegisterKEMKey, recipients are looked up from the chain before every encryption, and every event is a real transaction on the qorechain-diana testnet.

How it's made

Encryption: @qorechain/qoreseal (ML-KEM-1024 envelopes, mlkem mode). Each persona generates its encryption keys in the browser. Secret keys never leave it. Recipient keys: public keys are registered on-chain with /qorechain.pqc.v1.MsgRegisterKEMKey. Before encrypting anything, senders fetch the recipient's key from the registry (/qorechain/pqc/v1/kem/{address}), so you can only encrypt to a key that is bound to that QoreChain account. ML-DSA key binding: each account first registers its ML-DSA-87 key with proof of possession (MsgRegisterPQCKeyV2). After that, every transaction, including the encryption-key registration, is hybrid-signed (secp256k1 + ML-DSA-87) through @qorechain/sdk (EthNativeSigner). That binds the encryption key to the post-quantum identity. On-chain audit: add, grant and revoke events are native hybrid-signed transactions. They carry a compact memo: operation, record id, recipient, and a hash of the encrypted envelope. App: React + Vite (scaffolded with create-qorechain-dapp) and a small Node/Express signer service. QoreX currently rejects MsgRegisterKEMKey from dApps, so for this demo a local service signs on behalf of the four personas (Lab, Patient, two Doctors). It only ever holds signing keys, never encryption keys or plaintext. In production, the wallet takes over that role. Honest limits: revoking stops future access but cannot make a doctor "un-see" a record they already decrypted. Blob storage is local for the demo (IPFS or an encrypted store is the next step). The full threat model is in THREAT_MODEL.md. AI-native: planned and supervised with Claude Code, implemented with Codex agents in phases. Every QoreChain API was taken from the installed kit sources, not guessed. The workflow and the human decisions are in AI_USAGE.md.

Timeline

SoKhamEncrypted Apps

Pushed 4 commits to main

  • 087ef3b README: live demo link · cuongpvdev
  • 73a29fb Vercel: single API function with rewrite for nested paths · cuongpvdev
  • 9ade8da Public read-only Vercel demo: snapshot API, demo keyring, banner · cuongpvdev
  • f4961fc Cover images (AI-generated via Codex image generation) · cuongpvdev
SoKhamEncrypted Apps

Newly verified on chain: Hybrid ML-DSA-87 transactions, PQC key registration with proof of possession, QoreSeal and the encryption key registry

SoKhamEncrypted Apps

Pushed 12 commits to main

  • 1caf8ce Notes: package audit · cuongpvdev
  • ad154b3 Explorer links open on testnet · cuongpvdev
  • 291d3fc Phase 5: README, threat model, AI usage, license, video script, submission checklist · cuongpvdev
  • 20ef7b3 Phase 6: ML-DSA recipient cards + hybrid sealing, on-chain verify checklist, attacker view; UI e2e passes · cuongpvdev
  • 576f51b fund: top-up targets · cuongpvdev

and 7 more commits

SoKhamEncrypted Apps

New project.

Comments and questions

  • No comments yet.