A proof-of-concept system that uses cryptographic proofs to verify fair gameplay and detect cheating in video game speedrunning.
ZK-AntiCheat demonstrates how zero-knowledge proofs can be used to create tamper-proof anti-cheat systems that:
- Monitor game memory states cryptographically
- Generate proofs of fair gameplay
- Detect unauthorized memory modifications
- Maintain player privacy through ZK proofs
The project consists of three main components:
- Language: Rust
- Purpose: Memory monitoring and state capture
- Features:
- Process memory dumping and analysis
- Merkle tree generation from memory chunks
- Static vs. dynamic memory region profiling
- Continuous state monitoring
- Language: TypeScript (Node.js)
- Purpose: ZK proof generation and verification
- Features:
- Noir.js circuit execution
- Barretenberg backend integration
- Recursive proof aggregation
- Whitelist validation
- Language: Noir
- Purpose: ZK circuit definitions
- Components:
gamePlayProver: Recursive proof aggregationmerkleProof: Memory integrity verificationstateTransition: State machine validationwhitelist: Memory region validation
- Rust 1.70+
- Node.js 18+
- Bun (for serverProver)
- Nargo (for circuit compilation)
-
Clone the repository
git clone <repository-url> cd fairfy
-
Setup Client
cd client cargo build -
Setup Server Prover
cd ../serverProver bun install -
Compile Circuits
cd ../circuits # Compile each circuit individually cd gamePlayProver && nargo compile cd ../merkleProof && nargo compile cd ../stateTransition && nargo compile cd ../whitelist && nargo compile cd ../recursiveWhitelist && nargo compile
-
Start the ZK Prover Server
cd serverProver bun run -
Run the Memory Monitor Client
cd client cargo run
POST /- Submit game state for proof generationGET /health- Health check and status
PORT- Server port (default: 9000)HOST- Server host (default: 0.0.0.0)
CHUNK_SIZE- Memory chunk size for hashing (default: 2048)PATH_LENGTH- Merkle tree path length (default: 64)MEMORY_DUMP_INTERVAL_SECONDS- Monitoring interval (default: 40)
# Client tests
cd client && cargo test
# Server tests
cd server && cargo test
# TypeScript compilation check
cd serverProver && npx tsc --noEmit- No input validation or sanitization
- Hardcoded cryptographic values
- No authentication or authorization
- Memory safety concerns
- No rate limiting
- Submit a pull request