Encrypted Apps
Cista
Sealed payroll on QoreChain: everyone gets paid, only you see your payslip.
About
Cista is payroll on QoreChain where payslips stay private but pay can still be proven. A payslip is one of the most sensitive files a company holds. On a public chain, paying salaries normally publishes them; encrypting them with today's cryptography only delays that, because anything copied now can be opened once quantum computers break the key exchange. And confidential payroll creates a new problem: employees still have to prove their income, and a hidden salary is one nobody can verify. How Cista works: - Sealed payslips. Each payslip is sealed in the employer's browser with ML-KEM-1024 + X25519 (QoreSeal) to the employee and the employer. Cista's server stores ciphertext only. Employees publish their keys in a key card signed with their ML-DSA-87 key, so a server can't swap in its own key. - Signed once, paid once. The employer signs the pay run's fingerprint in QoreX with ML-DSA-87. One hybrid-signed multi-send pays the whole team in fUSD and carries that fingerprint in its memo. Next month, the employer starts from any earlier run: their key opens their own sealed copy and fills the team in. Year-to-date totals add themselves up. - Proof of pay, without the payslip. The employee picks a standard proof type (employment, income above an amount, income in a range, earned this year, exact pay) or a custom set of lines, names who it's for and until when, and signs it. Whoever receives it opens a link and checks it with no wallet: the fields are unchanged, both signatures verify against keys registered on chain, and the chain paid that run. - On-chain proof of income. The CistaVerifier contract checks the same proof with QoreChain's own PQC precompiles, so another contract can trust it without trusting Cista. - Keys and recovery. Keys come from a 24-word recovery phrase, checked back before set-up finishes. The key is locked with Argon2id or unlocked with a passkey. The employer can re-seal past payslips for an employee who loses their key. Proven on testnet: pay runs in QOR and fUSD paid by QoreX, proofs checked, and a team of three paid in one transaction with every payslip and an "earned this year" proof checked (16 of 16). CistaVerifier at 0xF26924d19029d1F1A253a3e079b16fD68B8519d8 verifies a real QoreX signature on chain. In a Q-Day drill, an attacker with only a stolen classical key tried 8 attacks on the chain, the server, a forged proof and the contract: all 8 were refused (audit.md). Honest limits: payment amounts are public, like every transfer, so each person's net pay is visible in the payment. Who is paid, gross pay, tax, deductions and role stay sealed.
How it's made
TypeScript monorepo: a core library (payslip model, salted SHA-256 field commitments in two Merkle trees, QoreSeal sealing, signature and payment checks, the full proof check, an Argon2id key vault), a Hono + SQLite server on my VPS (sign-in by QoreX signature, key cards, ciphertext-only payslips, pay runs, payments), a React web app (light and dark themes, passkey unlock with WebAuthn PRF), and a Solidity contract (CistaVerifier, solc 0.8.28) that calls the PQC Key Status (0x…0a02) and PQC Verify (0x…0a01) precompiles. QoreChain features used: QoreX signArbitrary (hybrid ML-DSA-87 text signatures for sign-in, pay runs, key cards and proofs) and signAndBroadcast (one MsgMultiSend paying fUSD's native denom to the whole team); hybrid ML-DSA-87 transactions; the PQC key registry (every signature is checked against the registered key, never one the signature brings along); QoreSeal ML-KEM-1024 + X25519 and its recipient cards; an EVM window and the PQC precompiles for the contract. What was hard: - QoreX refuses MsgRegisterKEMKey from websites, so the ML-KEM key travels in a QoreSeal card signed with the account's ML-DSA-87 key instead. - Making the contract rebuild, byte for byte, the exact text QoreX signs, and keeping Solidity and TypeScript in step with shared test values. - Recovery without a backdoor: a recovery phrase for the employee (checked back before set-up finishes), and employer re-sealing. - Next month's run and year-to-date totals without storing the team in the clear: the employer's key reopens its own sealed copies of earlier runs in the browser. New payslip fields were added so that older payslips keep exactly the same fingerprints and proofs. 239 automated tests, a browser check of the proof page, a live check of the contract against a real QoreX-signed run, a live team pay run (three people paid in one transaction, 16 of 16 checks), and the live Q-Day drill (8 of 8 attacks refused). No accessibility issues found by axe-core (WCAG 2.1 AA) in either theme. Built AI-natively with Claude; AI_USAGE.md has the details.
Timeline
Comments and questions
- No comments yet.