A sybil-resistant, privacy-preserving prediction market protocol powered by Chainlink CRE and World ID.
π Built for Convergence: A Chainlink Hackathon
Mirage Market is a prediction market protocol where positions are hidden, identities are verified, and settlements are automated.
The Problem: Existing prediction markets expose user positions publicly, enabling front-running, social pressure, and privacy violations. Most markets also rely on centralized resolution oracles that can be manipulated.
Our Solution:
- Privacy-Preserving Commitments β Users commit positions as encrypted hashes (commit-reveal scheme). Amounts and choices remain hidden until settlement.
- Sybil Resistance β World ID verification via Chainlink CRE ensures one-person-one-vote without exposing personal data on-chain.
- Automated AI Settlement β When a market closes, a CRE workflow fetches real-world data via Confidential HTTP, resolves the outcome deterministically, and writes the settlement on-chain β no human oracle needed.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MIRAGE MARKET β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββ βββββββββββββββββββββββββββββββββββ β
β β Next.js 14 ββββββΆβ Ethereum Sepolia Smart Contractsβ β
β β App Router β β β β
β β + Wagmi v2 β β β’ ShadowMarketV2.sol β β
β βββββββββββββββ β β’ IdentityGate.sol β β
β β β β’ PrivatePayouts.sol β β
β β β β’ SettlementReceiver.sol β β
β βΌ ββββββββββββββ¬βββββββββββββββββββββ β
β βββββββββββββββ β β
β β World ID β β β
β β IDKit v2 β βΌ β
β ββββββββ¬βββββββ βββββββββββββββββββββββββββββββββββ β
β β β CHAINLINK CRE (DON) β β
β β β β β
β βββββββββββββΆβ Identity Workflow: β β
β β HTTP β WorldID API β onchain β β
β β β β
β β Settlement Workflow: β β
β β EVM Log β Confidential HTTP β β
β β β Deterministic Resolve β β
β β β onchain write β β
β βββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
All files that use Chainlink CRE:
| File | Purpose |
|---|---|
settlement-workflow/main.ts |
Core CRE workflow β EVM log trigger β Confidential HTTP (CoinGecko) β deterministic resolution β SettlementReceiver onchain write |
settlement-workflow/workflow.yaml |
Workflow definition β triggers, consensus (identical), targets |
settlement-workflow/cre.config.json |
Runtime configuration β contract addresses, chain, API URL |
identity-workflow/main.ts |
Identity CRE workflow β HTTP trigger β World ID API verify β IdentityGate onchain write |
identity-workflow/workflow.yaml |
Workflow definition β HTTP trigger, identical consensus |
identity-workflow/cre.config.json |
Runtime configuration β World ID app ID, IdentityGate address |
| File | Purpose |
|---|---|
SettlementReceiver.sol |
Receives settlement data from CRE DON β calls settleMarket() on ShadowMarketV2 |
ShadowMarketV2.sol |
V2 market contract β upgraded with CRE-compatible settlement + proportional claims |
| File | Purpose |
|---|---|
settlements/page.tsx |
Settlements feed showing CRE workflow activity and tx hashes |
contracts.ts |
ABI definitions + Sepolia addresses for all CRE-connected contracts |
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router), TypeScript, Tailwind CSS |
| Wallet | Wagmi v2, viem, WalletConnect |
| Identity | World ID (IDKit v2), Chainlink CRE Identity Workflow |
| Oracle / Settlement | Chainlink CRE (TypeScript SDK β WASM), Confidential HTTP |
| Smart Contracts | Solidity 0.8.24, Hardhat, OpenZeppelin |
| Network | Ethereum Sepolia Testnet |
| Privacy | Commit-Reveal scheme, Merkle proof payouts |
Deployed on: 2026-03-04
Deployer: 0x6602130E170195670407CeE93932C1B0b9454aDD
| Contract | Address | Etherscan |
|---|---|---|
| IdentityGate | 0x50DF50C761bA75Da4d5edf29943e7da310A8E135 |
View |
| ShadowMarketV2 | 0x54576aC5a0cF7566287d7fcb410c8f523357889d |
View |
| PrivatePayouts | 0x34eb886073984C7c3a063351530D057886FA78Af |
View |
| SettlementReceiver | 0x25Fb1b433Db1dFAfF1C73Dd189E7183d8fDe0FC4 |
View |
| WorldID Router | 0x469449f251692e0779667583026b5a1e99512157 |
View |
- Node.js v18+
- Bun v1.3+ (for CRE workflows)
- CRE CLI (
curl -sSL https://cre.chain.link/install.sh | bash)
npm installcp .env.example .env
# Fill in:
# NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
# NEXT_PUBLIC_WORLD_ID_APP_ID
# PRIVATE_KEY (for contract deployment)cd apps/web
npm run dev
# β http://localhost:3000cd packages/contracts
npx hardhat run scripts/deploy.ts --network sepolia# Install CRE CLI
curl -sSL https://cre.chain.link/install.sh | bash
# Login to CRE
cre login
# Simulate Settlement Workflow
cd cre-workflows/settlement-workflow
bun install
cre workflow simulate .
# Simulate Identity Workflow
cd ../identity-workflow
bun install
cre workflow simulate .mirage/
βββ apps/web/ # Next.js 14 frontend
β βββ app/
β β βββ markets/[id]/ # Market detail + commit position
β β βββ markets/[id]/reveal/ # Reveal & claim winnings
β β βββ markets/create/ # Create new market
β β βββ portfolio/ # User portfolio dashboard
β β βββ settlements/ # CRE settlement feed
β βββ components/web3/ # WorldIDButton, CommitPosition, ClaimWinnings
β βββ lib/ # contracts.ts, types.ts, wagmi.ts
βββ packages/contracts/ # Solidity smart contracts
β βββ contracts/
β β βββ ShadowMarketV2.sol # V2 prediction market
β β βββ IdentityGate.sol # World ID sybil gate
β β βββ PrivatePayouts.sol # Merkle proof payouts
β β βββ SettlementReceiver.sol # CRE settlement target
β βββ scripts/deploy.ts # Hardhat deployment script
βββ cre-workflows/ # β
Chainlink CRE Workflows
β βββ settlement-workflow/ # EVM Log β API β Settle
β β βββ main.ts # Handler logic (CRE SDK)
β β βββ workflow.yaml # Workflow definition
β β βββ cre.config.json # Runtime config
β βββ identity-workflow/ # HTTP β WorldID β Onchain
β βββ main.ts # Handler logic (CRE SDK)
β βββ workflow.yaml # Workflow definition
β βββ cre.config.json # Runtime config
βββ README.md
| Track | How Mirage Qualifies |
|---|---|
| Chainlink CRE & AI ($17k) | Settlement workflow uses CRE with Confidential HTTP, deterministic resolution, and EVM log triggers |
| Prediction Markets ($16k) | Full prediction market with commit-reveal privacy, proportional payouts, and automated settlement |
| Privacy ($16k) | Encrypted commitments, Merkle proof payouts, Confidential HTTP β positions never visible on-chain |
| World ID + CRE ($5k) | Identity workflow brings World ID verification to Sepolia via CRE, enabling sybil resistance on any chain |
MIT