On-chain territory conquest game built with Noir and NextJS, offering a novel approach to classic Risk-style gameplay with cryptographic privacy guarantees.
A strategic territory control game where players battle for map dominance through zero-knowledge circuits. Noir enables client-side proving, allowing players to generate cryptographic proofs locally that verify their moves are valid without revealing strategy. The multi-party computation (MPC) framework ensures fair gameplay while maintaining the "fog of war" element essential to strategy games without central server trust.
- Initial Placement: Players take turns placing armies on their assigned territories
- Attack Phase: Attack adjacent enemy territories using dice rolls
- Fortify Phase: Redeploy troops to strengthen your position
- Win Condition: Capture all territories on the map!
Supports 2-6 players with varying game dynamics based on player count.
- Frontend: NextJS application with PhaserJS game engine
- Circuits: Noir zero-knowledge circuits in the
game_circuitsfolder - Multiplayer: Realtime gameplay via Colyseus.js (in development)
The game's core logic is implemented as zero-knowledge circuits using the Noir language. These circuits handle game state transitions while maintaining player privacy.
The following circuits handle all game mechanics:
initialise_game_state: Sets up the initial game board stateassign_initial_territories: Randomly distributes territories among playersinitialize_player_state: Sets up a player's initial game stateregister_all_players: Registers all players in the game sessioncommit_to_user_secrets: Securely stores player secretscreate_risk_adjacency_map: Establishes territory connectionsplace_troops: Allows players to place troops on territoriesexecute_attack: Handles attack mechanics between territoriesexecute_fortify: Allows redeployment of troopsend_turn: Processes end-of-turn state changescount_player_territories: Tallies territories owned by each playercheck_win_condition: Determines if a player has won
Test cases covering the full game journey for a two-player game are available in:
game_circuits/src/test.nr
Run the test suite with:
nargo test --show-outputTo compile and export the circuits for use in the frontend:
nargo export
./generate_ts_bindings.sh # Generates TypeScript bindingsGate count reports for circuit complexity are available in game_circuits/gates_report.json.
The game frontend is built with modern web technologies:
- NextJS: React framework for the application
- Tailwind CSS: For styling components
- PhaserJS: Game engine for rendering and interaction
- Radix UI: Component library for UI elements
- Colyseus.js: Multiplayer functionality (in development)
To run the game locally:
# Install dependencies (requires Bun)
bun install
# Start development server
bun devThe application will be available at http://localhost:3000.
Watch the gameplay demonstration and learn about the technical implementation:
The game circuits use the MPC library for zero-knowledge computations:
mpclib = { tag = "main", git = "https://github.com/zac-williamson/mpclib" }
- Persistent game state using decentralized storage
- Complete multiplayer implementation with matchmaking
Your feedback is valuable! Feel free to:
- Open an issue for bugs or feature requests
- Submit a pull request with improvements
- Share your thoughts and suggestions
Connect with the developer:
- Twitter: @satyambnsal
- Telegram: satyambnsal
Project Slides Deck
This project is licensed under the MIT License.
Made with ❤️ by Satyam Bansal



