Skip to content

neromtoobad/bluff-

Repository files navigation

BLUFF

Spot the AI lie. Win up to 5× your bet. Real USDC on-chain on Arc Testnet.

Two AI agents debate a verified crypto claim — one tells the truth, one lies through their teeth. You bet on which one is bluffing. Reveal happens the moment you lock a bet. Streak wins compound up to a 5× jackpot. Sub-minute rounds. No funds at risk.

Live: bluff-alpha.vercel.app


How a round works

  1. Topic drops from a hand-curated pool of 341 pre-verified crypto claims (161 TRUE, 180 deliberately FALSE) across 17 categories — bitcoin, ethereum, solana, layer-2s, DeFi, regulation, hacks, founders, Arc, etc.
  2. Two agents stream their take in parallel. Truth-teller defends the verified fact in a crypto-Twitter voice. Liar fabricates a believable counter with a fake-but-specific number. Both generated by Claude Haiku 4.5 at temperature 0.95 so no two rounds sound the same.
  3. You bet ($1, $2, $5, $10) on whichever agent you think is lying.
  4. Instant reveal. The truth and source URL appear the moment your bet lands. Winners get paid in USDC on Arc Testnet within seconds, signed by the escrow wallet via viem.
  5. Streak compounds. Win → +1. Lose → reset. Multipliers: 1.9× (0–2), 2.5× (3–4), 3× (5–9), 5× jackpot at 10+.

Stack

Layer What
Framework Next.js 14 (App Router, TypeScript, Tailwind)
Agents claude-haiku-4-5 for streaming claims, claude-sonnet-4-6 for fact-check fallback (web search)
Chain Arc Testnet (chain id 5042002, USDC as native gas at 18 decimals + ERC-20 USDC at 6 decimals)
Wallet (browser) MetaMask / OKX / Rabby / Coinbase Wallet via EIP-1193
Wallet (email) Circle user-controlled wallets — ERC-4337 smart account, PIN-gated
Payouts viem writeContract from escrow wallet, Transfer-event verified
Persistence HMAC-signed round tokens (stateless across lambdas on Vercel)
Hosting Vercel (SSE routes get maxDuration: 300)

Sign-in modes

  • Email sign-up. Circle creates a smart-contract account for your email. Set a PIN once, future logins recognise you. No seed phrase, no extension.
  • Connect wallet. MetaMask, OKX, Rabby, or Coinbase Wallet. Auto-adds Arc Testnet if you don't have it.

Local dev

git clone https://github.com/neromtoobad/bluff-.git
cd bluff-
npm install
cp .env.example .env.local   # fill in keys (see below)
npm run dev

Required env vars in .env.local:

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Circle user-controlled wallets
CIRCLE_API_KEY=...
NEXT_PUBLIC_CIRCLE_APP_ID=...

# On-chain escrow (Arc Testnet)
ARENA_ESCROW_PRIVATE_KEY=0x...
NEXT_PUBLIC_ARC_RPC=https://rpc.testnet.arc.network
NEXT_PUBLIC_USDC_ADDRESS=0x36000000000000000000000000000000000000C0

# Stateless round token
ROUND_TOKEN_SECRET=<random-32-bytes>

Get test USDC from faucet.circle.com on the Arc Testnet chain.


Architecture notes

  • Round persistence is stateless. Every /api/round/start response carries an HMAC-signed roundToken. /bet, /stream, /settle hydrate from the token if the in-memory map missed (Vercel routes each request to a fresh lambda).
  • Pre-verified topic pool. Each entry carries {verdict, truthSummary, source}. The truth-teller's opening line is derived server-side ("Yes, it's the truth" vs "No, it's a lie") so both agents are anchored to the correct verdict. Web search is only invoked when a pool entry lacks pre-verified metadata.
  • Refusal-pattern guard. Claude occasionally refuses to fabricate; a regex sweep catches refusals and swaps in one of 22 hand-written [FALLBACK] lies.
  • ERC-4337 quirk. Circle SCA bets route through the EntryPoint, so receipt.to is never the USDC contract. Verification matches Transfer log topics, not the receipt destination.
  • Speed. A round preps in ~2–4 s end-to-end (Haiku + pre-verified pool + dropped Haiku web-search). Claims stream word-by-word over ~10 s. Reveal fires instantly when you bet — no waiting for the full window.

What's not done

  • Mainnet (intentionally out of scope — testnet-only)
  • ERC-8183 settlement (currently kit.send() shim)
  • Mobile-app wrappers
  • Anti-bot / Sybil

Project layout

app/
  page.tsx                 Home (sign-in gate or DEAL ME IN hero)
  play/page.tsx            Live round + agent visualizer + bet panel
  sign-in/page.tsx         Circle email + PIN flow
  rules/ /faq/ /leaders/   Static content + leaderboard
  api/
    round/{start,bet,stream,settle}/route.ts   Game loop + SSE
    auth/{init,verify}/route.ts                Circle user provisioning
    circle/{bet,tx,session,latest-tx}/route.ts SCA transaction challenges
    research/route.ts                          Mock x402 research paywall
components/bluff/          TopNav, AgentCard, Reveal, ConnectButton, Mascots…
lib/
  topics.ts                341-entry pre-verified pool
  bluff-claude.ts          Agent prompts + fallback pools + refusal guard
  round-token.ts           HMAC round persistence
  arc-viem.ts              viem clients + USDC Transfer verification
  circle-wallets.ts        Circle SDK init + REST helpers

Credits

Built by @neromtoobad for the Arc x Circle hackathon.

Mascots are hand-drawn. Sound design is bells, crowd ambience, and fanfare — off by default, toggle in the top-right.

USDC and Arc are trademarks of their respective owners. Nothing in this app is financial advice; it's a testnet game with no real-money stakes.

About

AI agents debating crypto truth. real USDC bets. settled on Arc Network in under a second. powered by Circle.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors