A proof generation system for Flappy Bird game scores using ZisK. This project generates proofs for game score's that can be verified without revealing the original game data.
This system lets you play Flappy Bird, submit your scores, and automatically generates proofs that verify your score's are real, Anyone can verify these proofs without seeing your actual gameplay.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend API │ │ ZisK Engine │
│ (React) │◄──►│ (Flask) │◄──►│ (Proof Gen) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Frontend: Port 5173 (React + Vite)
- Backend API: Port 8000 (Flask)
- Python 3.8+
- Node.js 16+
- Rust toolchain
- ZisK installation
git clone <repository-url>
cd flappy_birdpip install flask flask-corscd flappy-bird-game
npm installcd flappy_zisk
cargo build --release3. Configure ZisK: Before proceeding, ensure ZisK is installed by following the official installation guide, ZisK Installation Instructions
python3 api_server.pyAPI Endpoints:
GET /api/health- System health checkGET /api/system-status- Check if system is ready for submissionsPOST /api/submit-score- Submit a game score for proof generationGET /api/proof-status/{job_id}- Check proof generation statusGET /api/leaderboard/{difficulty}- View leaderboard
cd flappy-bird-game
npm run devAccess the game at: http://localhost:5173
# Manual proof generation
./generate_zk_proof_fixed.sh <score>
# Example: Generate proof for score 5
./generate_zk_proof_fixed.sh 5- User plays Flappy Bird and achieves a score
- Frontend submits score to backend API
- Backend validates score and creates proof generation job
- System checks if ZisK is available (global execution lock)
- Input Generation: Create binary input file with score data
- ZisK Compilation: Compile Flappy Bird game with ZisK
- Execution: Run game in ZisK environment
- Proof Creation: Generate proof
- Verification: Verify proof integrity
Game Score → API Validation → Job Creation → ZisK Processing → Proof Generation → Status Updates
export FLASK_ENV=development export FLASK_DEBUG=1
### Customization Options
- **Timeouts**: Adjust timeout values in API server
- **Worker Count**: Change worker thread count
- **Deduplication Window**: Modify `DEDUP_WINDOW_SECONDS`
## API Reference
### Submit Score
```bash
POST /api/submit-score
Content-Type: application/json
{
"player_id": "player_123",
"score": 15,
"difficulty": 1
}
{
"success": true,
"job_id": "uuid-here",
"message": "Score submitted successfully",
"proof_status": "pending"
}- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
# Test backend API
python3 -m pytest tests/
# Test frontend
cd flappy-bird-game
npm test
# Test ZisK integration
./generate_zk_proof_fixed.sh 5Happy Gaming and Proof Generation with ZisK!