Skip to content

Jeephoenix/genjury

Repository files navigation

Genjury

License: MIT Node React GenLayer Live

A suite of on-chain mini-games built on GenLayer, where an AI Judge enforces outcomes directly inside the smart contract — no off-chain oracle, no centralised referee.

I started this for the GenLayer mini-games mission and ended up liking the idea too much to stop at one game. The core mechanic — having an LLM deliberate and return a verdict that multiple validator nodes independently verify before it touches anyone's XP — felt genuinely novel. That's the Optimistic Democracy bit, and it's what makes this more than a toy.


What's playable: Mistrial

Two truths and a lie. The AI Judge decides.

3–8 players. Each round, one player writes three statements about themselves — two true, one false. Everyone else votes on which is the lie, staking a confidence level. Then the Intelligent Contract calls an LLM to give its own independent verdict.

Lobby → Writing → Voting → AI Judging → Objection → Reveal

Players can call an objection vote to override the AI if the majority thinks it got it wrong. XP is distributed at reveal based on accuracy and confidence.

The contract (contracts/mistrial.py) handles all game state, the LLM call, objection resolution, and XP math entirely on-chain.


What's next

Game What it is Status
Highstakes Texas Hold'em with verifiable on-chain shuffles UI shell only
Crossfire Head-to-head trivia, AI-graded freeform answers Planned
Oracle Arena Prediction markets settled by on-chain LLM oracle Planned

Stack

  • Intelligent Contracts — Python, GenLayer Bradbury testnet
  • Frontend — React 18 + Vite + Tailwind CSS + Framer Motion
  • Wallet — genlayer-js, multi-wallet (MetaMask, Rabby, Coinbase Wallet)
  • Identity — wallet-linked usernames, ENS resolution, cross-game XP
  • API — Express + Neon Postgres for profiles and ENS cache (Vercel serverless)
  • Realtime — Socket.io for in-game chat

Running locally

You'll need Node 18+, pnpm 8+, and a browser wallet configured for a GenLayer testnet.

git clone https://github.com/Jeephoenix/genjury.git
cd genjury
pnpm install

cp frontend/.env.example frontend/.env
# Set VITE_MISTRIAL_CONTRACT to your deployed contract address

pnpm --filter @workspace/genjury run dev
# → http://localhost:5173

See frontend/.env.example for all required variables.


Smart contract

The Mistrial Intelligent Contract lives in contracts/mistrial.py. To deploy it:

  1. Install the GenLayer CLI
  2. Point your CLI at Bradbury testnet
  3. genlayer deploy contracts/mistrial.py --args 3 0 (3 rounds, 0 entry fee)
  4. Paste the returned address into frontend/.env as VITE_MISTRIAL_CONTRACT

Known issues / WIP

  • Highstakes, Crossfire, and Oracle Arena are UI stubs — contracts not written yet
  • Objection phase majority is currently unweighted (XP-weighted voting planned)
  • Mobile layout breaks on screens narrower than 375px
  • No automated tests yet — contract logic tested manually on Studionet

GenLayer resources

Documentation

Tools

Community

Examples


Contributing

Issues and PRs welcome. All game logic must live in the Intelligent Contract — the frontend only displays state and collects input.


MIT · Built on GenLayer

About

Multiplayer mini-games on GenLayer — AI verdicts enforced by Intelligent Contracts on-chain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors