Skip to content
QORECHAIN
Register

Encrypted Apps

Last Light

Post-quantum crypto inheritance. Your seed phrase reaches your heir only after you stop checking in.

Share on X

About

Last Light lets you leave a seed phrase, or any secret you can write down, to someone you trust. The heir and three guardians each publish an ML-KEM-1024 key on QoreChain with MsgRegisterKEMKey. Each key is bound to an ML-DSA-87 key: it is published in a hybrid-signed transaction from an account with a registered ML-DSA-87 key. The owner seals the secret in the browser, encrypted only to those registered keys. The key that opens it is split: half goes to the heir, and the other half is split 2-of-3 across the three guardians. Only ciphertext goes on chain. The owner checks in on a schedule. If they miss a check-in, the vault releases. Two guardians re-encrypt their shares to the heir, and the heir decrypts the secret in their browser. The guardians never see it. Vault actions (seal, check-in, handoff) are approved in the QoreX wallet. Live on QoreChain testnet.

How it's made

Last Light has three parts: an encryption core, a vault contract and a web app. Architecture - Encryption core (TypeScript, runs only in the browser): ML-KEM-1024 encapsulation, HKDF-SHA256 and AES-256-GCM. The vault key is split with XOR into Half A for the heir and Half B, and Half B is split 2-of-3 with Shamir secret sharing over GF(2^8) for the guardians. Every envelope is bound to the chain, contract, vault, role and recipient, so a piece copied from one vault can't be used in another. Secrets are padded to 1024 bytes so the ciphertext doesn't reveal the phrase length. - Vault contract (Solidity, QoreChain EVM, Hardhat): stores owners, heirs, guardians and check-in times, and decides when a vault is released. It accepts guardian handoffs only after release. The encrypted pieces go in events, and the contract stores their hash so the app can verify them. - Web app (React, Vite, wagmi, RainbowKit): owners seal and check in, guardians hand off, heirs recover. It also has a demo mode that runs the full flow in the browser with sample people and the real encryption code. Kits and network features - @qorechain/sdk: ML-DSA-87 key registration with proof of possession, hybrid-signed (secp256k1 + ML-DSA-87) transactions, and MsgRegisterKEMKey to publish each recipient's ML-KEM-1024 key on chain. - The chain's KEM key registry: owners encrypt only to keys read from /qorechain/pqc/v1/kem/{address}. - @qorechain/evm and @qorechain/qorex-rainbowkit: address conversion and QoreX wallet approvals for every vault action. - EVM windows: the contract was deployed from an account with a registered ML-DSA key and an open EVM window. - @noble/post-quantum, @noble/ciphers and @noble/hashes for the cryptography. What was hard - QoreX won't let websites register KEM keys. I solved this with a "key account": the browser creates an eth-native account from a backup phrase, QoreX funds it with 0.5 test QOR, it registers its own ML-DSA-87 key, then publishes its ML-KEM key hybrid-signed. QoreX then links it to the person's 0x address on the contract. - Classic QoreX accounts have different keys and balances on the native side (qor1) and the EVM side (0x). I added a linkNative function to the contract and a banner that shows the EVM-side balance and where to fund it. - QoreX doesn't support wallet_sendTransaction, so the app sends plain eth_sendTransaction. - The RPC limits how many blocks a log query can cover, which broke the guardian handoff. The app now searches vault events in chunks, newest first. - The REST API sends no CORS headers, so the app reads it through a proxy. Everything was tested live on QoreChain testnet with real QoreX approvals: key setup, sealing, check-in, release, two guardian handoffs and the heir opening the vault.

Timeline

Last LightEncrypted Apps

Pushed 1 commit to main

  • 4d615ee README: link the demo video · claude
Last LightEncrypted Apps

New project.

Comments and questions

  • No comments yet.