Skip to content
QORECHAIN
Register

Encrypted Apps

KagamiPQ

Certificate Transparency for QoreChain encryption keys: catch a swapped key before anything is sealed to it.

Share on X

About

Encrypted apps on QoreChain seal data to whatever ML-KEM-1024 key an address has registered. But keys can change. If an account is compromised and its key swapped, or someone registers a copy of another person's key, senders keep sealing to it and nobody notices. The chain only shows the current key, with no history. KagamiPQ is a public, append-only log of every KEM key registration on QoreChain, with ML-DSA-87-signed tree heads anyone can verify. A monitor flags key swaps and copied keys within seconds, on a live alert feed. The kagami-pq SDK is a drop-in replacement for QoreSeal's seal call: it refuses to seal to a key that is unbound, copied or freshly swapped, and gives the reason. Every log tree head is anchored on QoreChain daily, so anyone can check the log was never rewritten. Try it with no wallet: a guided demo at https://kagami.ajkadri.dev, or get your own test identity at https://kagami.ajkadri.dev/seal and take over your own account to watch it get flagged. npm: https://www.npmjs.com/package/kagami-pq

How it's made

KagamiPQ is a key-transparency layer for ML-KEM encryption keys on QoreChain, in the spirit of Certificate Transparency. Architecture - Log: an append-only Merkle log of every ML-KEM key registration on QoreChain. An indexer follows the chain; the log signs its tree heads with ML-DSA-87 and serves inclusion and consistency proofs. Clients verify everything themselves. - Recipient cards: each account publishes a card, signed with its ML-DSA account key, binding its encryption key to the account. A key without a card is "unbound". - Monitor: watches the log and raises an alert within seconds when a key is replaced, copied from another account, or registered without a card. In 20 of 20 scripted swaps the alert came within 2.5 s. - safeSeal (npm: kagami-pq): wraps QoreSeal's seal-to-addresses with the checks the log makes possible. It verifies the log against its signed root, reads the key from the chain, checks the card, and refuses a swapped, copied or unbound key. A changed key is held for five minutes, and a team vault waits for the admin to approve it. - Anchoring: a contract on QoreChain's EVM stores the log's tree heads daily. The R4 check (in the browser or from the command line) proves the log was never rewritten. - Demo: a guided story with fictional people on testnet, and /seal, where anyone gets a throwaway test identity in the browser (funded from a rate-limited faucet), joins the log, seals a note to themselves, opens it, then takes over their own account and watches it get flagged. Kits and network features QoreChain SDK, create-qorechain-dapp, pqc, QoreSeal. Hybrid transactions, PQC key registration with proof of possession (run in the browser for test identities), the QoreSeal registry, and an EVM window for the anchor contract. What was hard - Running the whole registration chain (ML-DSA key with proof of possession, then the ML-KEM key, then the card) in a browser, with no wallet, reliably. - Separating "the log was rewritten" from "the network was slow": a timeout must never look like a failed check. - The public RPC endpoint is several nodes that don't always agree on the latest block, so the log can briefly look behind; safeSeal refuses until it catches up, and the UI retries. - Getting alerts to the browser in seconds and matching each one to the right transaction. - We found and reported two platform bugs along the way: an out-of-scope EVM window refusal reported as "exhausted" (qorechain-core), and reverted EVM transactions shown as "success" in the explorer (qorechain-explorer #1).

Timeline

KagamiPQEncrypted Apps

Pushed 1 commit to main

  • ae303a4 docs: demo video link · AjKadri
KagamiPQEncrypted Apps

Pushed 7 commits to main

  • 5b2c9f5 feat(faucet): two test identities per visitor per hour · AjKadri
  • 1c73a0c fix(identity): show a returning identity at once while the chain code loads · AjKadri
  • dabaa59 fix(identity): show progress while the chain code loads; unit loads the faucet credential · AjKadri
  • e0ff637 feat(identity): the Get a test identity section on /seal, with tests · AjKadri
  • ebf70b0 chore(faucet): smoke script against the real faucet · AjKadri

and 2 more commits

KagamiPQEncrypted Apps

Pushed 1 commit to main

  • a08503a docs: test identity in the judge path · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 87aa2ca chore(faucet): script to check the live per-visitor limit · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 3e502e6 fix(web): wait for a lagging log to catch up before reporting log-stale · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • e2b91c7 chore(kagami-pq): publishable build, package README and npm build script · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 90dec48 chore: favicon and link previews · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 2e38c8e feat(web): link to the seal page from the landing page, the demo and the README · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • bf2ad8b fix(web): a slow or failed log download in step 6 is no longer reported as an R4 mismatch · AjKadri
KagamiPQEncrypted Apps

Pushed 2 commits to main

  • 84c5f5a feat(web): seal a note to any address on its own /seal route · AjKadri
  • 56c0a42 feat(web): approved copy for the seal page and its story link · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 71523b2 docs: fix code links, note shared demo state · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • cc65857 chore: keep local agent notes out of the repo · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 017e634 fix(web): hide the waiting line once the step's result shows · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • ae3235d fix(web): close the alert stream while the page is hidden and fetch missed alerts on return · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • aa21395 test(web): cover what the account thief can open, including the key put on Bea's account · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 70f8623 feat(web): check any address's registered key and log status without a wallet · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • dcdc951 feat(web): six-step guided story, free play and the actions it needs · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 6cb9128 feat(web): turn the demo into a guided three-step story · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 18f9578 fix(web): make buttons look clickable, with clear primary, secondary and text weights · AjKadri
KagamiPQEncrypted Apps

Pushed 1 commit to main

  • 0bed60f feat(web): full-height landing with a live radar, scroll story, bento grid and reveals · AjKadri

Comments and questions

  • No comments yet.