Skip to content
QORECHAIN
Register

Post-Quantum dApp

Vachan

Quantum-safe udhari: IOUs signed with ML-DSA-87 and verified on chain

Share on X

About

Across India, small credit runs on trust and a notebook: the kirana shopkeeper who lets a regular customer "pay later". That is udhari. It is fast and humane, but the record is fragile: notebooks get lost, the two sides remember different amounts, and a good repayer has nothing to show for it. Vachan ("a promise") puts that promise on chain. The shopkeeper records a debt and signs it with their ML-DSA-87 post-quantum key. The customer accepts it on their phone with their own ML-DSA-87 signature, which the contract checks with QoreChain's pqcVerify precompile. Repayments in fUSD go straight to the lender. The lender can forgive the rest, again with a post-quantum signature. Every address builds a public credit history from debts it actually agreed to. Why post-quantum: an IOU and a credit history must last for years. If a quantum computer later recovers someone's classical key, it still cannot create, accept or forgive a debt in their name. Even ordinary EVM transactions are only admitted during an EVM window that only the post-quantum key can open. Vachan opens one per action, limited to Vachan and fUSD, and closes it straight after.

How it's made

Contract. - Vachan.sol (Foundry, OpenZeppelin 5). - Creating, accepting and forgiving a debt each need an ML-DSA-87 signature. The contract reads the signer's key from pqcKeyStatus, requiring proof of possession, then checks the signature with pqcVerify. - Each payload binds the action, chain, contract, terms and a nonce, so a signature can't be replayed or reused. - Repayments go straight to the lender. There is no admin. Tests. - 48 Foundry tests covering the flow and the attacks: a classical-key thief, replay, cross-debt and cross-chain reuse, reentrancy. - Real ML-DSA-87 signature tests. Frontend. - React and wagmi, scaffolded with create-qorechain-dapp, with the QoreX connector. - The page signs with @qorechain/qoresign. - Using @qorechain/sdk, it opens a scoped EVM window for each action and closes it straight after. On testnet. - Three debts were run end to end in the browser. - A forged forgive, a key without proof of possession, a send outside the window's scope, and a classical-only transfer with no window open were all refused by the chain. What was hard. - Matching the exact bytes pqcVerify checks. - The window sharing the account's nonce. - Converting faucet fUSD to ERC-20 by hand-encoding MsgConvertCoin. Docs. THREAT_MODEL.md, AI_USAGE.md, and the QCAI audit with responses in contracts/audit/.

Timeline

VachanPost-Quantum dApp

Pushed 17 commits to main

  • 04368c5 Redesign the app as a khata ledger · niyatinehal
  • 7136951 README: debt #3 on testnet with one window per action · niyatinehal
  • a03bc20 Open a scoped EVM window per action and close it straight after · niyatinehal
  • 0fa68cc Add THREAT_MODEL.md · niyatinehal
  • 7b76505 Web: loading state, closed-debt amounts, singular 'debt', wrap long address · niyatinehal

and 12 more commits

VachanPost-Quantum dApp

New project.

Comments and questions

  • No comments yet.