ZeroPath is a Hidato puzzle game that uses zero-knowledge proofs to verify solutions without revealing them. This project demonstrates how privacy-preserving technologies can be applied to gaming.
Hidato is a logic puzzle game where you need to fill a grid with consecutive numbers that connect horizontally, vertically, or diagonally. Some numbers are given as clues, and you need to fill in the rest to create a valid path from the smallest to the largest number.
This project combines:
- A playable Hidato puzzle game built with Next.js and TypeScript
- Zero-knowledge proof verification using Noir (a domain-specific language for ZK proofs)
- Client-side proof generation for a seamless user experience
- Node.js (v16+)
- Yarn package manager
- Noir toolchain (for ZK proof integration)
- Clone the repository:
git clone https://github.com/ankit875/zeropath.git
cd zeropath- Install dependencies:
yarn install- Run the development server:
yarn dev- Open http://localhost:3000 in your browser to see the game.
- You'll see a 4x4 grid with some numbers filled in (the clues)
- Fill in the empty squares with numbers from 1 to 16
- Numbers must form a continuous path where consecutive numbers are adjacent (horizontally, vertically, or diagonally)
- Click "Verify Solution" to check if your solution is correct
This project uses Noir for zero-knowledge proof generation and verification. The basic workflow is:
- User solves the Hidato puzzle
- When they click "Verify", the app generates a ZK proof that:
- Proves they have a valid solution
- Without revealing what that solution is
- The proof can be verified by anyone, confirming the user has a valid solution
zeropath/
├── app/ # Next.js app directory
├── components/ # React components
│ └── hidato/ # Game-specific components
├── context/ # React context for state management
├── utils/ # Utility functions
├── circuit/ # Noir circuit for ZK proofs
- Multiple puzzle difficulties
- Competitive mode with time tracking
- On-chain verification
- Leaderboard