Live link π -> Shadow Mafia
Code : github
An on-chain take on the classic Mafia party game. Players stake SOL to join a lobby, get assigned a hidden role (Mafia / Citizen / Doctor) via verifiable randomness, and play through night and day phases. The cryptographic twist: roles are sealed in a vault β the server itself canβt see who is Mafia.
How it works
- Stake SOL to join a lobby
- Roles are dealt through verifiable randomness and kept private from the server
- Night phase β private votes & eliminations; Day phase β discussion & voting
- The SOL pot is paid out automatically on-chain to the winning faction
Tech Stack used
- Solana β L1
- Anchor β Rust framework for on-chain programs
- MagicBlock Ephemeral Rollups β privacy for hidden state
- Next.js + React β frontend
- Socket.io β real-time game events
- Phantom Wallet β wallet integration