Skip to content
QORECHAIN
Register

Post-Quantum dApp

Rivet

Make cryptographic integrations hold: ML-DSA-87 conformance lab with on-chain attestations on QoreChain

Share on X

About

Post-quantum signatures get made in one place and checked in another: a wallet, a server, a contract. Each library can be correct on its own and still disagree with the others. Rivet tests that. It signs with @noble/post-quantum and OpenSSL, checks every signature against both and against QoreChain's pqcVerify precompile on the Diana testnet, then throws tampered and replayed signatures at all of them. Each run produces a report that's signed with ML-DSA-87 and published on-chain, so anyone can verify it from their own browser. Along the way it caught a real bug: pqcVerify was rejecting valid signatures over an empty message. QoreChain changed that at block 10,654,800, and we have reports on-chain from before and after. https://rivetpq.vercel.app

How it's made

Rivet has three parts. A TypeScript engine runs the tests: it signs with @noble/post-quantum and OpenSSL, and verifies with both plus QoreChain's pqcVerify precompile through eth_call. A Solidity contract, RivetRegistry, stores the reports. A Next.js app lets anyone run the labs and re-check reports straight from the chain. The contract only accepts a report if its ML-DSA-87 signature passes pqcVerify, and the signing key has to be the attester's own QoreChain key, checked with pqcKeyStatus. Signatures are tied to the chain, the contract, a nonce and a deadline, so they can't be replayed. On the QoreChain side we used @qorechain/sdk to register the PQC key with proof of possession and to open hybrid-signed EVM windows. Every report is published inside a window scoped to the registry only. The contract has 36 Foundry tests, and pqcVerify runs on a real ML-DSA verifier in them, not a mock. We ran QCAI twice, plus a third time after a fix. Stage 2 found a real issue (a revoked key could come back after switching keys), so we fixed it and redeployed. Every finding is answered here: https://github.com/Megacollins/rivet/blob/main/docs/AUDIT.md The hardest parts were getting EVM transactions admitted at all, since QoreChain needs a registered PQC key and an open window, and a scoped window won't deploy contracts. The other was proving the empty-message bug was the chain's and not ours: we reproduced it with plain cast calls and found the exact block where the behaviour changed.

Timeline

RivetPost-Quantum dApp

Pushed 20 commits to main

  • f112e5f README: credit open-source dependencies, as the hackathon rules require · Megacollins
  • e840d00 QCAI third run on v2: stage 2 fix confirmed, 4 findings answered · Megacollins
  • ab97b86 Fix revoked-key revival (QCAI stage 2) and redeploy RivetRegistry v2 · Megacollins
  • 93f3aa5 Mark PDFs and images as binary so line-ending conversion never touches them · Megacollins
  • ef40944 QCAI stage 1: answer all 4 findings, add 5 regression tests · Megacollins

and 15 more commits

RivetPost-Quantum dApp

Earned a Ship Weeks badge.

RivetPost-Quantum dApp

New project.

Comments and questions

  • No comments yet.