Skip to content
QORECHAIN
Register

Post-Quantum dApp

Redzone

A public crash-test arena for AI robots, with bounties protected by post-quantum signatures.

Share on X

About

RedZone is a public crash-test arena for AI robot brains. A robot owner registers an AI brain and locks a bounty in a smart contract on QoreChain. Players connect their QoreX wallet and get a few attempts per day to trick the robot into entering a forbidden "red zone" in a 2D simulation. If a player breaks the robot, the contract pays them the bounty automatically. If the robot defends itself, its public safety rating goes up. Ratings combine safety (attacks defended) and utility (normal tasks completed), so a robot that refuses everything scores zero. Every action that moves money needs an ML-DSA-87 post-quantum signature verified on-chain: bounty claims, owner withdrawals and admin changes. A leaked or quantum-broken ECDSA key alone cannot drain the vault.

How it's made

Contracts (Solidity 0.8.28 + Foundry, live on qorechain-diana) - RobotRegistryV3: robots, attack sessions, breaches in the order they were recorded, safety and utility scores. EscrowVaultV2: bounties in native QOR. - PQAccess and MLDSA87 call the pqcVerify (0x0A01) and pqcKeyStatus (0x0A02) precompiles directly. - Every action that matters needs an ML-DSA-87 signature verified on chain: registering a robot, starting a session, the referee's verdict, withdrawing a bounty, admin changes. msg.sender is never used for authorisation, so a stolen ECDSA key gets nothing. Signed messages carry chain id, nonce and deadline. - Both contracts check a real ML-DSA-87 signature from the deployer in the constructor, so a key-format mismatch fails the deploy instead of locking funds later. - Fair payouts: a bounty always pays the earliest eligible breach, whoever calls claim. Breaches expire after 1 day. Withdrawals take two steps with a 3-hour delay and wait for any pending win. The admin can pause (7 days at most) but can never move funds. Backend (Node + TypeScript + Fastify) - Robot brain: an LLM (OpenRouter free models, with Groq and other fallbacks) or a rule brain turns a player's prompt into a motion plan. - Referee: a deterministic simulator checks the path against red-zone polygons and signs the verdict with ML-DSA-87. Replays are stored off chain; their hash goes on chain. - Relayer: QoreX can't send transactions to contracts yet, so a relayer submits the user's QoreX-signed (ML-DSA) actions through a scoped EVM window. - Leaderboard, sign-ups and bounties are read from chain events, so the chain is the source of truth. Website (React + Vite) - QoreX wallet connect with ML-DSA signArbitrary, a 2D arena with animated replays, practice mode, a 3-step flow for robot makers, and leaderboards. Kits: @qorechain/sdk and @qorechain/evm 0.14.0; create-qorechain-dapp (foundry template) for the scaffold and the EVM window helper. Testing and audits (all in the repo under audits/) - 167 Foundry tests, including fuzz tests and invariant tests (100,000 random calls, 0 violations); 99.7% line coverage of the v3 contracts; Slither: no High or Medium. - QCAI two-stage audit: Stage 2 rated QUANTUM-SAFE; every finding fixed or answered, with a test. - Exploit-driven adversarial audit: 1 Medium and 2 Lows proven and fixed before the final deploy. - Q-Day Drill rehearsal: 22 of 22 attacks with the leaked ECDSA key were blocked. What was hard - Making payouts fair: an early design let the caller choose which breach got paid; now the earliest eligible breach always wins. - QoreX can't call contracts yet, hence the relayer and scoped EVM window. - The PQC precompiles don't exist in local simulation, so deploys go straight to testnet and verify a live signature on the way.

Timeline

RedzonePost-Quantum dApp

Pushed 2 commits to main

  • 148b340 Redeploy v3 after adversarial audit; audit write-up · ponram06
  • 2928da3 v3: fix adversarial audit findings (earliest-breach payout, claim window, no ECDSA shortcuts) · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • 9594fe6 audits: QCAI re-run on deployed v3 (try 2) and answers · ponram06
RedzonePost-Quantum dApp

Pushed 3 commits to main

  • 99a9570 audits: re-flatten the deployed v3 contracts · ponram06
  • 9e89ba1 Deploy RobotRegistryV3 and EscrowVaultV2 to qorechain-diana · ponram06
  • cf0d868 v3: store only the referee key hash (QoreChain deploy write limit), deploy tooling · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • 3a6b6b6 v3: deploy-time ML-DSA-87 proofs, referee key proof, stronger invariants · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • e757383 v3: answer QCAI stage 2 findings, invariant tests, 99.7% coverage · ponram06
RedzonePost-Quantum dApp

Pushed 2 commits to main

  • b2ced04 v3: spell out why ML-DSA checks replace msg.sender checks · ponram06
  • a0e4d45 Contracts v3: fix every QCAI stage 1 finding and the self-review items · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • b16eeac audits: drop a stray line at the end of the flattened bundle · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • 7ba6362 README: clearer note on robot #1's brain fingerprint and the pre-drill change freeze · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • cb1961a README: how to use it and an architecture diagram; keep Sign in at the right on phones · ponram06
RedzonePost-Quantum dApp

Pushed 2 commits to main

  • 2dce5b6 Pre-audit self-review and one-file audit bundle; block bounty take-back during a pending win · ponram06
  • d442170 Play page asks players to sign in first; clearer robot loading states · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • 0bb1894 Make the chain the source of truth for everything the website shows · ponram06
RedzonePost-Quantum dApp

Pushed 2 commits to main

  • 0857554 Required bounty when adding a robot; say "bounty" on the website · ponram06
  • 96576c1 Simpler robot makers page · ponram06
RedzonePost-Quantum dApp

Pushed 2 commits to main

  • d64f469 Leaderboard and bring-your-own-AI brains for robot makers · ponram06
  • 6e17c2f Simple website for players, robot makers and buyers; owner flow on the backend · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • ecd8cd2 One-time player sign-up paid from QoreX · ponram06
RedzonePost-Quantum dApp

Pushed 2 commits to main

  • bf2fcb6 Website: real attempts with QoreX · ponram06
  • fa09a61 Backend: QoreX-signed sessions and attempts, relayer with scoped window · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • a790265 Deploy RobotRegistryV2 and switch the referee to it · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • 8a6dc05 RobotRegistryV2: QoreX-signed, relayable sessions and robot registration · ponram06
RedzonePost-Quantum dApp

Pushed 2 commits to main

  • 78e0126 Website: arena view, robot list and practice mode · ponram06
  • 459fc0c Add Deploy GLM-5.3-Flash to the backup chain before local Ollama · ponram06
RedzonePost-Quantum dApp

Pushed 1 commit to main

  • beece12 Backup model chain: numbered fallbacks across providers · ponram06
RedzonePost-Quantum dApp

Pushed 7 commits to main

  • 092ab34 Local Ollama fallback brain and model benchmark · ponram06
  • 5ab05be Backend docs, env example and project tracker · ponram06
  • 6089dac Referee API: attempts, utility, practice, replays · ponram06
  • ebeb349 Referee ML-DSA-87 signer and chain reads, with live parity test · ponram06
  • 257f7d6 Robot brains: rule brain, OpenAI-compatible LLM brain, brain registry · ponram06

and 2 more commits

Comments and questions

  • No comments yet.