Lightning-native competitive Snake game. Two players stake sats, grow their on-chain snake by capturing coinbases, and compete in a zero-sum pool until one side's score hits zero. The winner takes the pooled stakes.
Play at game.chainduel.net.
This repo contains two frontends for the same game:
| Directory | Status | Description |
|---|---|---|
chain-duel-react/ |
Active | Modern React + PixiJS frontend — use this for development and production |
| Root (legacy) | Retiring | Original Express + Canvas 2D frontend |
Both frontends connect to marspay — the Lightning + Socket.IO backend that handles sessions, payments, Nostr, tournaments, and authoritative ONLINE multiplayer. marspay lives in a sibling repo (../marspay).
See docs/FEATURES.md for the complete feature guide covering all game modes, Nostr/Lightning integration, and how the three components work together.
Highlights:
- Practice — free play against AI (1v1 or 4P FFA) and ranked challenge bounties (21–4,200 sats)
- P2P duels — Lightning LNURL or Nostr zap buy-ins, double-or-nothing rematches
- Tournaments — 4/8/16/32-player brackets
- ONLINE multiplayer — server-authoritative rooms with Lightning/Nostr seat purchase, replays, Hall of Fame
- Nostr — NIP-07, NIP-46 bunker, NWC wallet, profile, zap payouts
- Live Bitcoin feed — mempool.space block bonuses during play
cd chain-duel-react
npm install
cp .env.example .env # set VITE_SOCKET_URL (e.g. wss://marspay.chainduel.net)
npm run dev # http://localhost:5173marspay must be running for paid/online modes. See chain-duel-react/README.md and chain-duel-react/SETUP.md.
npm installCreate a .env file in the root:
IP_SOCKET=[IP_OF_BACKEND_SERVER]
PORT_SOCKET=[PORT_OF_BACKEND_SERVER]
npm start # http://localhost:3000| Document | Description |
|---|---|
| docs/FEATURES.md | Full feature guide — game modes, architecture, Nostr/Lightning |
| chain-duel-react/README.md | React frontend setup and migration status |
| chain-duel-react/docs/parity-matrix.md | Legacy → React page mapping |
| marspay README | Backend setup and API overview |
| marspay/docs/AGENTS_ONLINE.md | ONLINE mode protocol |
| marspay/docs/AGENTS_CHALLENGE_BOUNTY.md | Challenge bounty protocol |
