Magic Chess
Magic Chess is an open-source chess platform where every move is validated on-chain. A Solana program enforces the full FIDE rulebook. Games run on a MagicBlock Ephemeral Rollup so moves confirm in milliseconds and cost players nothing. Wagers sit in program-owned escrow on Solana and pay out automatically to the winner.
ZUG Arena is the reference app built on Magic Chess: playzug.xyz.
:::caution Devnet only The program runs on Solana devnet and has not had a third-party audit. Wagers use devnet tokens. Do not use it with real funds. :::
What you get
| Full rules on-chain | Legal moves, check, checkmate, stalemate, castling, en passant, promotion, fifty-move rule, threefold repetition and insufficient material. See Chess engine. |
| Instant, free moves | The match account is delegated to a MagicBlock rollup. A per-match session key signs moves, so there are no wallet popups. See MagicBlock integration. |
| Escrowed wagers | Both players deposit the same SPL token amount (or play free). The winner takes the pot minus a platform fee; a draw splits it. See Wagers and settlement. |
| Gasless onboarding | Players sign in with email, social or a wallet through Privy. A backend fee payer sponsors base-layer transactions. See Gas sponsorship. |
| Spectating and predictions | Anyone can watch a live game and predict upcoming moves for play points. See Move predictions. |
| Ratings and replays | Elo ratings, player profiles, match history and move-by-move replay. See Ratings and profiles. |
| TypeScript SDK | @magic-chess/sdk wraps every instruction, PDA and rollup routing. See SDK reference. |
How a game works
- Create. White calls
initialize_matchon Solana with a wager, a per-move time limit and a token mint. The wager moves into the match escrow. - Join. Black calls
join_matchwith the same wager. In the same transaction the app registers Black's session key and delegates the match to the rollup. - Play. Both sides send
make_moveto the rollup. The program rejects every illegal move and detects the end of the game. - Finish. The game ends by checkmate, draw, resignation or a timeout claim. The match is committed and undelegated back to Solana.
- Settle.
process_match_settlementpays the escrow out on Solana and closes it.
Project status
| Component | Status |
|---|---|
magic_chess program | Deployed on devnet at FbXiX6xcMRPVuTc7AZkQMSbpKa1uBzQY16NFf5jhJC7h |
| ZUG Arena frontend | Live on Cloudflare Workers |
| Backend (indexer, realtime, sponsor) | Live on Render with Supabase Postgres |
| SDK | @magic-chess/sdk, on npm (ESM, CJS, types, and the zug CLI) |
| Automatic settlement (crank) | Disabled. Players claim timeouts and finalize from the app. See Roadmap |
Where to go next
- Players: How to play
- Contributors: Local setup, then Architecture overview
- Integrators and bot authors: SDK reference and Building agents. AI agents can start from playzug.xyz/skill.md.
- Operators: Deployment
Source code: github.com/amalnathsathyan/magic-chess (MIT).