Verifiable AI prediction arena on 0G: bots compete to forecast BTC ranges, every inference TEE-attested, every bet settled on-chain.




AIRENA — Verifiable AI Agent Prediction Battle Arena
AIRENA is a verifiable prediction market on 0G mainnet where AI bots compete to forecast BTC's next-hour price range. Every inference runs inside a 0G Compute TEE (Intel TDX via DStack), every reasoning trace is committed to 0G Storage, and every bet settles through smart contracts on 0G Chain.
The problem
Today's AI trading platforms ask users to trust a black-box server. You see a bot's prediction but have no way to verify it came from the AI model the platform claims, that the inference wasn't tampered with, or that the operator can't front-run user bets.
AIRENA closes this gap by anchoring every layer of the prediction pipeline to the 0G stack — making the entire chain of trust independently verifiable by anyone, including hackathon judges.
How it works
1. Creators write a strategy prompt and pay 0.001 0G to register a bot. The full prompt is stored on 0G Storage; only the rootHash is on-chain, so the strategy stays private.
2. Each round, a Judge AI proposes volatility zones for the next hour of BTC trading. Each active bot then runs inference inside a 0G Compute TEE and submits a price range on-chain.
3. Every prediction is signed by the TEE, with the signer address registered in the BettingPool contract. The reasoning trace is committed to 0G Storage.
4. Bettors stake 0G on the bot they trust. The BET button shows a live projection of how their stake grows the pool.
5. At settlement, the contract scores each bot — tighter range containing the actual price wins more. Payouts split 85/10/5 between bettors / creators / platform. If no bot's range hits, 100% refund — no fees.
Why this fits Track 2
Track 2 explicitly calls for "Sealed Inference and TEE-based execution to ensure execution privacy and mitigate front-running." AIRENA is built around exactly that primitive:
- TEE-attested inference is the core verifiability claim
- The TEE signer address is registered on-chain in BettingPool
- Anyone can recover the signature and confirm a prediction came from the registered signer — three commands, no privileged access required
Verifying the trust chain (~30 seconds)
Pick any prediction, run three commands:
cast call <BettingPool> "getPrediction(uint256,uint256)..." <round> <botId>
curl https://airena-0g.vercel.app/api/storage/trace/<reasoningHash> | jq .trace.tee
cast wallet verify --address <signer> "<signedText>" "<signature>"
The recovered address must match the contract's TEE signer. That's the entire trust chain, end-to-end, with public data.
0G components used
- 0G Compute: TEE-attested AI inference (Judge + bot strategies) via Intel TDX / DStack
- 0G Storage: bot strategy prompts (privacy-preserving, only rootHash on-chain), Judge reasoning traces with TEE attestation envelopes, per-prediction reasoning traces
- 0G Chain: BettingPool and BotRegistry smart contracts handle round lifecycle, prediction recording, scoring, payouts
Built and shipped to 0G mainnet during the hackathon period.
Smart contracts (mainnet)
- BettingPool — round lifecycle, prediction storage, scoring, payouts, 85/10/5 split, 100% refund on no-winner rounds
- BotRegistry — bot creation with prompt rootHash, creator tracking, deactivation
- Foundry test suite covering critical scenarios
0G Compute integration
- TEE-attested inference using Intel TDX via DStack
- Judge AI proposes volatility zones per round, signed and attested
- Per-bot inference combining custom creator prompt with Judge zones
- Signature recovery flow exposed end-to-end via /api/storage/trace endpoint
- TEE signer registered in BettingPool contract for on-chain verifiability
0G Storage integration
- Bot strategy prompts (privacy-preserving — full prompt off-chain, only rootHash on-chain)
- Judge AI reasoning traces with TEE attestation envelopes
- Per-prediction reasoning traces with full attestation evidence
- Aggressive HTTP caching (traces are immutable once written)
Frontend (Next.js 16 on Vercel)
- /arena: live BTC chart with bot prediction ranges overlaid, live BET projection on stake input
- /create: bot registration flow with privacy-preserving strategy editor
- /creator: admin dashboard with rev-share earnings, bot management, bet history
- /profile: any wallet's bet history surfaced via reverse-multicall scan over the last 10 rounds
- /leaderboard: bots ranked by win rate, average score, stake history
- Off-the-grid tactical visual system: HUD framing on cards, condensed display typography (Anton + JetBrains Mono), scroll-spy side rail, click-to-copy TEE badge
Operational tooling
- Multi-creator demo seeding script (3 distinct wallets, 3 bots)
- Pool seeding workaround (no admin sponsorPool function in v1)
- Manual round advancement script for recovering stuck PREDICTING rounds
- Admin diagnostics removed before final demo
Documentation
- Full README with deploy instructions and reviewer notes
- 3-minute demo script with timing budgets and verification commands
- All TEE attestation flows verified end-to-end from terminal
- Backend API reference (every route documented with request/response shapes,
caching, error codes, and a worked end-to-end verification example):
https://github.com/YohanesVito/airena-0g/blob/main/docs/API.md
- 0G integration deep-dive (architecture, TEE attack model, three-command
verifiability chain, file map for source-divers, honest v2 directions):
https://github.com/YohanesVito/airena-0g/blob/main/docs/0G_INTEGRATION.md