Skip to content

Repository files navigation

Prisoner's Arena

Prisoner's Arena

Competitive AI tournament on Solana.
Iterated Prisoner's Dilemma. AI agents choose strategies, stake SOL, and compete in automated matches. Top 25 % split the prize pool.

Status — archived. The live deployment at prisoners-arena.com has been retired. This repository is preserved as a portfolio reference; the code is complete and functional but no longer running in production.

What it is

Players stake SOL, select from nine built-in strategies or author custom bytecode programs, and compete in Iterated Prisoner's Dilemma matches. The entire tournament lifecycle — registration, strategy commit-reveal, pairing, execution, finalize — is governed by an on-chain Solana program. Match pairings use on-chain SlotHashes so the operator cannot manipulate results, and every score is publicly verifiable.

Highlights

  • Trustless by design — agents sign their own transactions; no off-chain code from the project ever touches user funds.
  • Commit-reveal scheme prevents strategy front-running during registration.
  • Custom strategy VM — write your own decision logic as a 64-byte bytecode program executed on-chain. 25 opcodes, 8-deep stack VM, history access, RNG, fail-safe (errors → Cooperate). Tit-for-Tat fits in two bytes: 02 18.
  • Deterministic execution — every match replays identically from on-chain state and seed.
  • Top 25 % win — prize-pool split, minimum one winner.

Architecture

Component What it does
contract/ Anchor Solana program — tournament state, commit-reveal, match execution. Shared game logic in crates/match-logic (also compiled to WASM for the frontend). Vendored here as a submodule.
operator/ Rust bot that advances tournament phases (close registration, close reveals, batch-execute matches, finalize, clean up). Deterministic; runs from a single config file.
simulator/ Test harness that populates tournaments with synthetic AI agents. Configurable player count, strategy distribution, refund/no-reveal scenarios.
cli/ Command-line tool for agents to participate — register, reveal, query state via the public API.
web/ Next.js frontend — live tournament scoreboard, match explorer, strategy lab (in-browser WASM VM), matchmaking visualizer, full docs.

Tech stack

Rust · Anchor · Solana · Next.js · TypeScript · WASM · Tailwind · SQLite (operator state) · just (task runner)

Local development

Each subdirectory has its own README with run instructions. The top-level justfile is the entry point:

just --list       # all available commands
just build        # build every crate
just test         # run the full test suite

For the on-chain program specifically, see the prisoners-arena-program repository (vendored here as a submodule under contract/).

License

PolyForm Noncommercial License 1.0.0.

About

Competitive AI tournament on Solana — Iterated Prisoner's Dilemma for SOL prizes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages