Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mindfeint

One of them is a real person. The rest are AIs pretending to be them. Can you tell?

Mindfeint is a social deduction game built on 0G. The catch that makes it different from every other "spot the bot" game: it can cryptographically prove the AI players were genuine models and that the result was never tampered with.

A feint is a move meant to mislead. Mindfeint is a feint of the mind.

Built for The Zero Cup on 0G (Galileo testnet).


Overview

Every round shows six short answers to one prompt. Five are written by AI personas, one is written by a real person. You either try to spot the human, or you become the human and try to blend in.

Other games like this ask you to trust the house. Was that really an AI, or a human plant? A genuine model, or a cheap script? Is the leaderboard honest? You have no way to know. Mindfeint removes the guesswork, because every AI answer is produced through 0G verifiable inference and every round is recorded on 0G Storage and anchored on 0G Chain. The proof is the product.

Features

  • Two ways to play. Detector mode (spot the human) and Hider mode (be the human and fool everyone).
  • Provably real AI. Each AI answer is generated by a real model and signed inside a TEE, so it carries a verifiable proof.
  • Replayable on-chain history. Every finished round is stored on 0G Storage and anchored on 0G Chain. You can reopen any past round and replay it, pulled straight back out of decentralized storage.
  • Five prompt packs, dozens of prompts. Spicy, Confessions, Intellectual, Casual, and Sci-Fi, with no prompt repeating back to back.
  • Sign in with Google. Firebase auth, with an ERC 4337 smart wallet provisioned per player through account abstraction (see Roadmap for current status).
  • Anti-rig built in. You are never shown your own hider answer, and each hider answer retires after a few uses so it cannot be farmed.
  • Stats and streaks. Local diagnostics, streaks, and a full history page.

How it works

A round is a table of six answers.

  • Detector: read all six, pick the seat you think is the real human, and lock it in. The reveal shows who was who, how many AI answers were verified on 0G, and links to the on-chain record. From your history you can replay the whole round from storage.
  • Hider: you are shown a prompt, you write your own answer, and it gets shuffled anonymously into other players' detector rounds.

Why 0G

You cannot run a fair AI game if you cannot prove the AIs are real. Mindfeint uses all three 0G primitives, and each one is load bearing:

  • 0G Compute provides verifiable inference. Every AI answer is produced by a real model and signed inside a trusted execution environment, so it comes with proof it was not faked.
  • 0G Storage holds the full record of every round, immutable and publicly retrievable. A saved round can be downloaded and replayed by anyone with its root.
  • 0G Chain anchors each stored record with an attestation, so a result cannot be quietly rewritten later.

Take 0G out of the picture and the whole "provably fair" promise collapses into "trust me."

Tech stack

  • Frontend: React, Vite, TypeScript, Tailwind, Framer Motion, lucide icons. Firebase auth and ZeroDev ERC 4337 smart wallets (viem).
  • Backend: Node, Express, TypeScript, ethers. Holds the 0G wallet and runs all on-chain work.
  • 0G: Compute for verifiable inference (model qwen/qwen2.5-omni-7b), Storage for round records, and a Solidity contract on 0G Chain (Galileo testnet, chain id 16602).

Project structure

mindfeint/
  backend/    Node and Express. The 0G wallet, verifiable inference, the round engine,
              storage and chain records, the API, and the attestation contract.
  frontend/   React and Vite. Login, lobby, the table, the reveal, history and pages.
  package.json  Root orchestrator that runs and builds both halves.

A deeper tour of the request flow, the answer pipeline, and the reliability decisions lives in ARCHITECTURE.md.

Getting started

Requirements: Node 20 or newer, and a wallet funded with 0G Galileo testnet tokens.

# 1. install the root orchestrator, then both workspaces
npm install
npm run install:all

# 2. configure the backend
cp backend/.env.example backend/.env
#    set PRIVATE_KEY (and ATTEST_ADDRESS once you deploy the contract)

# 3. configure the frontend
cp frontend/.env.example frontend/.env
#    set the Firebase and ZeroDev values

# 4. (optional) deploy the attestation contract and paste the address into backend/.env
npm run deploy:attest

# 5. run backend and frontend together
npm run dev

The API serves on http://localhost:8787 and the app on http://localhost:5173.

Environment variables

Backend (backend/.env):

Variable Required Purpose
PRIVATE_KEY yes Wallet that pays for inference and signs storage and chain transactions
ATTEST_ADDRESS no Deployed MindfeintLog contract address (enables the on-chain attestation)
RPC_URL no 0G RPC, defaults to the Galileo testnet endpoint
INDEXER_RPC no 0G Storage indexer, defaults to the public turbo indexer

Frontend (frontend/.env, baked in at build time):

Variable Purpose
VITE_FIREBASE_API_KEY and the other VITE_FIREBASE_* Google sign in
VITE_ZERODEV_PROJECT_ID ERC 4337 smart wallet provisioning

Scripts

Run from the project root:

Command What it does
npm run dev runs backend and frontend together
npm run build installs everything and builds the frontend for production
npm start runs the backend, which also serves the built frontend
npm run ledger shows your 0G balances (flags exist on the backend script for deposit and reclaim)
npm run deploy:attest compiles and deploys the attestation contract
npm run test:round plays one full round end to end against live 0G

Backend-only helpers (run from backend/):

Command What it does
npx tsx scripts/providers.ts lists live 0G inference providers
npx tsx scripts/fetch-round.ts <root> downloads and prints a stored round from 0G Storage
npx tsx scripts/ledger.ts --deposit 0.5 moves funds into the compute ledger
npx tsx scripts/ledger.ts --reclaim-provider <address> reclaims an idle provider sub-account

Deployment

The app deploys as a single Node service: the backend serves the API and the built frontend from one origin, so there is no CORS to manage and only one domain to authorize in Firebase.

On a host like Render:

  • Build command: npm install && npm run build
  • Start command: npm start
  • Set every backend and frontend environment variable in the host's dashboard.
  • After it is live, add your deployment domain to Firebase authorized domains, or Google sign in will fail.

The wallet in PRIVATE_KEY pays for every player, so keep its compute ledger and native balance funded.

Roadmap

Recently shipped: replayable rounds from 0G Storage, an expanded prompt pool with no back-to-back repeats, English-only short answers, and Google sign in.

Next:

  • Points and a provable leaderboard. Score for spotting the human and for fooling detectors as the hider, computed and stored server side, with anti-rig safeguards. (Exact point values still to be decided.)
  • Account abstraction fully on 0G. Finish provisioning the smart wallet on 0G and let it sign and pay for play, so onboarding needs no seed phrase and no gas.
  • Own your personas. Write your own AI persona and mint it as an iNFT (ERC 7857 style).
  • Cross-device sync. Persist history and stats per account so they follow you across devices.
  • Live multiplayer. Public async tables and a community feed.

A note on fairness

The AIs are good. They will fool you. That is the fun, and it is also the point: the only honest way to play a game like this is to be able to prove the players on the other side were real. That proof is what Mindfeint is built around.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages