
Encrypted Apps
KagamiPQ
Certificate Transparency for QoreChain encryption keys: catch a swapped key before anything is sealed to it.
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
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
Comments and questions
- No comments yet.