VeritasX
Private prediction markets with AI-powered settlement on Chainlink CRE.
What it is
VeritasX is a privacy-preserving prediction market built on Ethereum (Sepolia) that uses Chainlink CRE for workflow orchestration, Chainlink Confidential Compute (ACE) for private token transfers, and Google Gemini AI for automated market settlement.
The Problem:
On-chain prediction markets expose everything — who bet, how much, and on which side. This enables front-running, discourages honest participation, and leaks sensitive positioning data. Existing solutions either sacrifice privacy for transparency or sacrifice verifiability for privacy.
How VeritasX Solves It:
VeritasX keeps all individual bet data private while maintaining full verifiability of market outcomes. Markets are created on-chain, but bets flow as private token transfers inside a Chainlink ACE Vault — the blockchain only ever sees aggregate pool totals, never individual positions. When a market closes, a Chainlink CRE workflow automatically triggers: it calls Gemini AI (with Google Search grounding) to resolve the question, settles the market on-chain with the AI verdict and confidence score, and pays winners through private token transfers — all in one atomic execution. The escrow that holds bet deposits is hardcoded as non-withdrawable at the smart contract level, so even a compromised key cannot drain funds. Every private transfer is EIP-712 signed and compliance-checked by the ACE PolicyEngine. The result is a prediction market where bets, payouts, and token flows stay private, while settlement outcomes and evidence remain publicly verifiable on-chain.
How it Works
VeritasX is built with three core layers:
Smart Contracts (Solidity + Foundry): A SimpleMarket.sol contract on Ethereum Sepolia manages market creation, aggregate pool tracking, and settlement. It inherits from a Chainlink ReceiverTemplate that accepts signed settlement reports from the CRE Forwarder. A separate SimpleToken.sol (PREDICT/PRED) is deployed as a compliant ERC-20 registered on the Chainlink ACE Vault, with the escrow address hardcoded as blocked from withdrawals at the contract level.
CRE Workflows (TypeScript → WASM): Three Chainlink CRE workflows handle the entire lifecycle. The market creation workflow accepts an HTTP trigger and writes a new market on-chain via EVM Write. The private bet workflow receives an EIP-712 signed bet via HTTP trigger, executes a private token transfer (bettor → escrow) through the ACE API using Confidential HTTP, writes the bet record to Firebase Firestore, and updates only aggregate pool totals on-chain. The settlement workflow is triggered by an on-chain SettlementRequested EVM log event — it queries Gemini AI (with Google Search grounding) to resolve the market question as YES/NO/INCONCLUSIVE with a confidence score, uses CRE consensus aggregation to ensure all nodes agree on the result, settles the market on-chain, loads all private bets from Firestore, calculates proportional payouts, and executes private token transfers (escrow → each winner) via the ACE API. All workflows are written in TypeScript, bundled with Bun, and compiled to WASM for execution in the CRE runtime. A custom pure-BigInt secp256k1 implementation handles EIP-712 signing inside WASM to avoid runtime limitations.
Off-Chain Data (Firebase Firestore): Individual bet records and settlement audit trails are stored in Firestore, accessible only by the CRE workflows. This keeps private bet data off-chain while maintaining a complete audit trail. Firebase Anonymous Auth and security rules restrict access.
Links
Created by
- Yagnesh