hackquest logo

0xHuman

PvP Turing Test betting on 0G. AI bots are tradable INFTs — owners earn when humans lose to them. TEE-attested replies, encrypted prompts, on-chain memory. Verifiable AI as gameplay.

视频

项目图片 1
项目图片 2
项目图片 3

技术栈

Next
React
Node
Solidity
Ethers
Web3
0G
AI

描述

0xHuman is a PvP Turing-Test betting game where AI bots are tradable INFTs. Built end-to-end on the 0G stack: Compute, Storage, Chain, and ERC-7857 Agent ID.

How a match plays:

  1. Stake 0G into escrow.

  2. Chat 60 seconds with a stranger in a blind room. Player never knows whether the opponent is human or AI at sign time.

  3. Vote: human or bot. Right answer pays 1.85x. Wrong answer loses the stake.

  4. Reveal post-match: if it was an AI, a card shows the persona name, INFT token id, and the owner who earned from the win.

  5. Learn: the bot extracts a lesson from the transcript and gets smarter for the next match.

  6. The twist: in PvP mode, humans are encouraged to mimic AI. Fool another human into voting BOT on you and you steal their stake.

The 3 trust gaps that justify needing 0G:

  • Is the AI real? Without 0G, the server could just be a human pretending to be the bot. With 0G, every reply has a TEE attestation from 0G Compute that anyone can verify on-chain.

  • What was actually said? Without 0G, server-controlled chat history can be edited or hidden. With 0G, every transcript is pinned to 0G Storage and the hash is anchored on-chain via OxHuman.anchorChatLog().

  • Who owns the AI? Without 0G, the operator owns the model and there is no real creator economy. With 0G, every bot persona is an ERC-7857 INFT with encrypted metadata, owned by the creator who minted it.

  • Without verifiable AI infrastructure, the entire Turing-Test betting market collapses. 0G is what makes it economically rational.

The bot economy:

  • Every AI bot is an ERC-7857 INFT (Agent ID) on 0G Chain. Free first slot, paid slot 2 (10 0G), paid slot 3 (25 0G). Max 3 bots per wallet. Each bot has its own vault that matches player stakes 1:1. When humans lose to your bot, the vault grows. When they beat it, the vault shrinks. Break-even win rate is 51.5%.

  • The bot's persona prompt is encrypted with AES-256-GCM and uploaded to 0G Storage. Only the owner holds the key. Anyone can verify by downloading the blob from storagescan.0g.ai — without the key, it is hex garbage.

Memory and learning:

  • After every match, Qwen reads the transcript and extracts ONE lesson about the player's tactics. The lesson is appended to the bot's memory blob, encrypted, re-uploaded to 0G Storage, and the new hash is committed on-chain via BotINFT.updateMemory(). The next match, the bot's system prompt includes the accumulated lessons.

  • A real lesson auto-extracted from a real match: "Accuse directly and use speed tests early."

  • After 30 matches, the bot has a real playbook of opponent tactics. Replies adapt accordingly.

本次黑客松进展

Built end-to-end during the hackathon on the full 0G stack — Compute, Storage, Chain, and ERC-7857 Agent ID.

Smart contracts:

  • Wrote BotINFT.sol from scratch — an ERC-7857-inspired implementation with per-bot vault, on-chain memory anchor, and slot economy (free first slot, paid slot 2 at 10 0G, paid slot 3 at 25 0G; max 3 per wallet).

  • Wrote OxHuman.sol — game escrow + verdict resolution. Includes convertToPvE() so the matchmaker can inject a bot mid-match while preserving blind matchmaking from the player's perspective, and anchorChatLog() for on-chain transcript proofs.

  • 47 hardhat unit tests covering mint flows, vault operations, match integration, fee math (5% protocol + 10% performance), signed-vote resolution, and ERC-7857 transfer with re-encrypted metadata.

  • Deployed to 0G Galileo testnet (chain 16602): OxHuman at 0x02adB0b07b53cC800b1173bceEd719426E2D5F02 and BotINFT at 0xdFd56b56A65C44Dd0fd3CC3d85580efF93594b8e.

  • Promoted to 0G mainnet (chain 16661): OxHuman at 0x062f1923Deb717A5d8D3e9Ed0e8C69b3eB63BC5f and BotINFT at 0x5298e0d0Fdf8c15538B901De4c0e9b7273957a98. First cross-wallet PvE match (game #0) already settled on-chain — player won 1.85 0G, bot vault delta -0.90 0G, transcript anchored at og-storage

Off-chain integration libraries:

  • lib/0g-compute.ts — typed wrapper around the 0G Compute SDK. Routes inference through Qwen 2.5 7B Instruct on the TEE-attested provider 0xa48f01287233509FD694a22Bf840225062E67836. Verifies the TEE signature via processResponse() before relaying replies. ~700–900ms per turn. Auto-falls-back to mock mode when the Compute ledger is not bootstrapped, so downstream code is never blocked by inference availability.

  • lib/0g-storage.ts — typed wrapper around the 0G Storage SDK with AES-256-GCM encryption helpers. Used for encrypted persona blobs, encrypted bot memory, and plaintext chat transcripts.

  • lib/bot-memory.ts — schema, mutations, and RAG context injection for the bot's system prompt. Accumulates stats, hashed opponent history, and lessons learned. Capped to 50 opponents, 30 lessons, 10 match summaries to keep prompts tight.

  • lib/lesson-extractor.ts — post-match Qwen call that distills a single 20-word lesson from the transcript. Real example produced from a real match: "Accuse directly and use speed tests early." The lesson is appended to bot memory, the blob re-encrypted, re-uploaded to 0G Storage, and the new hash committed on-chain via BotINFT.updateMemory(). The next match the bot replies with the new lessons in its system prompt.

融资状态

Not Yet Fundraising

队长
IIan Rachman Dana
项目链接
部署生态
0G0G
赛道
SocialFiGaming