Skip to content
QORECHAIN
Register

Post-Quantum dApp

Ebb

Sixteen tries with a stolen key. Nothing moved.

Share on X

About

Ebb is a Dutch-auction intents exchange on QoreChain where the maker's order is signed with ML-DSA-87 and checked on chain by pqcVerify, and funds wait in the settlement contract instead of the wallet. On testnet, an attacker holding a maker's stolen ECDSA key with the maker's EVM window open tried 16 attacks: all 16 were refused and 0 tokens moved.

How it's made

Drill report, not a real incident. QoreChain testnet qorechain-diana, 2026-11-28, 23:33 UTC. Tokens moved: 0. What was at stake. Ebb is a Dutch-auction intents exchange. The maker never sends the trade; a solver sends it later, carrying a signature the maker made earlier, so that signature is the maker's whole authority. In Ebb it is ML-DSA-87, checked on chain by the pqcVerify precompile against the key pqcKeyStatus reports at call time. The maker's funds wait in the settlement contract, because in a wallet a stolen ECDSA key would simply call transfer. QoreChain also rules out the classical route: since v3.2.8, ecrecover of a signature from a PQC-registered account returns address(0) unless that account keeps an EVM window open that admits the verifying contract. We confirmed that on testnet. The attacker. Holds the victim's secp256k1 key and a second stolen solver key; the victim's unscoped EVM window is open. Sixteen attempts, every one after the first a mined, reverted transaction with its hash in the README: withdraw with an ECDSA signature (BadSignatureLength), withdraw or forge an order with the attacker's own registered ML-DSA key (BadPqcSignature: the contract asks the chain for the victim's key), lower the floor or redirect the proceeds of a really signed order (BadPqcSignature: both are inside the signed hash), cancel or wipe the victim's orders, replay on a second deployment, fill below the curve or jump an exclusivity window with the stolen solver key, call transferFrom on the token directly (InsufficientAllowance: the settlement approves nobody). Opening a new window with the stolen key was refused at admission (codes 20 and 21). Result: 16 refused, 0 tokens moved, victim state unchanged, and the honest fill afterwards went through. What went wrong first. At 23:27 the same drill ran against our first deployment and scored 14 of 16. Ebb would credit a balance to an address with no PQC key, and on QoreChain whoever registers that address first owns it. Our internal review (an agent that had not written the code) found it (M-1); the fix is commit 45c4b5b. The cost: proceeds can no longer go to a fresh cold wallet. How it trades. The maker deposits once, then signs orders with ML-DSA-87: in the browser through QoreX signArbitrary or a demo key file (the recorded testnet runs signed with local keys through the SDK). The amount owed falls linearly from start to the maker's floor; competing solvers fill when it beats the AMM, paying gas from EVM windows scoped to the settlement and their tokens. In the testnet run, a 1 qETH order falling from 3,400 to 3,000 qUSD over 90 s was filled about 50 s in, when it stood at 3,177.777778 qUSD by the solver's reckoning. Partial fills reuse a verify-once cache bound to keccak256(pubkey): 103,656 gas instead of 357,478 for the cold fill. Cancels, epoch bumps and withdrawals are ML-DSA-signed and anyone can relay them; msg.sender is never an authority. Every signed message binds the EVM chain id, the settlement address and the Cosmos chain id. QoreChain features used: pqcVerify (0x…0a01) and pqcKeyStatus (0x…0a02) behind gas-capped wrappers that fail closed (mainnet's precompiles are inactive, so Ebb reverts PqcUnavailable there); scoped EVM windows (solver: settlement, AMM, tokens; relay: settlement only) opened by hybrid-signed MsgOpenEVMWindow; QoreX signArbitrary (wired in, not yet checked against a live QoreX signature); QoreX RainbowKit. Checks: 256 Foundry tests, passing with fixtures and again with real ML-DSA-87 signing and verification through vm.ffi, including a Q-Day attacker suite and invariants; cross-language vectors pin the TypeScript SDK to the Solidity bytes. Internal review: 0 Critical, 0 High, 1 Medium (M-1), 3 Low, all fixed or documented. QCAI AI audit, run twice: 85/100, risk MEDIUM on the draft and again on the deployed code; all 10 findings answered with a test in docs/AUDIT.md, none needed a code change. Not protected: funds left in the maker's wallet. In the drill the victim's wallet held 7 qETH and 18,000 qUSD that the stolen key could have taken at any time. Stack: Solidity 0.8.28 and Foundry; a TypeScript SDK and CLI (viem, @qorechain/sdk, @noble/post-quantum); a Fastify relay; a solver bot; a React, wagmi and RainbowKit web app. MIT.

Timeline

EbbPost-Quantum dApp

Pushed 136 commits to main

  • 51161e8 docs(ai-usage): who did what for the audits, video and project page · LeonardoRyuta
  • 0d0487b docs: link the demo video · LeonardoRyuta
  • fb9c5d5 docs(submission): form fields as entered; accurate QoreX signing wording · LeonardoRyuta
  • 15aaec9 docs(submission): fresh-clone run done · LeonardoRyuta
  • 308686e docs(readme): fixes from the fresh-clone run (pnpm 10 port flag, forge on PATH, bash on Windows, approve-builds warning); sdk: drop unused ORDER_TUPLE · LeonardoRyuta

and 131 more commits

EbbPost-Quantum dApp

Pushed 1 commit to main

  • 7507e0b docs(status): submitted state · LeonardoRyuta
EbbPost-Quantum dApp

Pushed 1 commit to main

  • 6d16249 docs(video): published · LeonardoRyuta
EbbPost-Quantum dApp

Pushed 1 commit to main

  • a2209b9 docs(ai-usage): my review, testing and iteration; sign-off; no TODOs left · LeonardoRyuta
EbbPost-Quantum dApp

Earned a Ship Weeks badge.

EbbPost-Quantum dApp

New project.

Comments and questions

  • No comments yet.