Installation
Prerequisites
- Go 1.21 or later
- 32+ GB RAM (64GB recommended for production)
- 16+ CPU cores
- 100+ GB disk space for proving keys
Building from Source
Quick Start
Local Development
Start the prover server with minimal configuration:- Start the HTTP server on port 3001
- Auto-download proving keys as needed
- Enable lazy loading (keys loaded on first use)
The
--auto-download flag enables automatic downloading of missing proving keys. Without this flag, you must manually download keys using the download command.Production Setup
Configuration
Command Line Flags
HTTP server listen address
Prometheus metrics server address
Directory for storing proving key files
Redis connection URL for queue mode (e.g.,
redis://localhost:6379)Preload keys at startup:
none, all, or a run mode (rpc, forester, full)Specific circuits to enable (e.g.,
update, append, address-append)Run only queue workers (no HTTP server)
Run only HTTP server (no queue workers)
Automatically download missing key files
Downloading Proving Keys
Proving keys are large pre-computed files needed for proof generation.By Run Mode
Download keys for specific deployment scenarios:By Circuit Type
Download specific circuit keys:Verify Existing Keys
Run Modes
Run modes determine which circuits are available:| Mode | Circuits | Use Case |
|---|---|---|
local-rpc | Test circuits (small batch sizes) | Local development |
rpc | Inclusion, non-inclusion, combined | RPC nodes serving stateless.js |
forester | Batch append, update, address append | Forester tree maintenance |
forester-test | Test batch circuits | Forester testing |
full | All production circuits | Full nodes |
full-test | All circuits including tests | Development |
API Endpoints
POST /prove
Generate a zero-knowledge proof.GET /prove/status
Check proof job status.GET /health
Health check endpoint.Redis Queue Mode
Architecture
Redis queue mode enables horizontal scaling:- Multiple Workers: Run multiple prover instances processing the same queue
- Circuit-Specific Workers: Each worker type processes specific circuit types
- Job Persistence: Jobs survive server restarts
- Result Caching: Completed proofs cached for client retrieval
Starting Queue Workers
Queue Cleanup
The prover automatically cleans up old data:- Stuck Jobs: Every 10 seconds, requeue jobs stuck in processing state
- Old Requests: Every 10 minutes, remove proof requests older than 1 hour
- Failed Jobs: Every 30 minutes, remove failed jobs older than 1 hour
- Old Results: Every 30 minutes, remove results older than 1 hour
Metrics
Prometheus metrics exposed on--metrics-address:
Key Metrics
prover_proof_generation_duration_seconds- Time to generate proofs by circuit typeprover_proof_requests_total- Total proof requests by circuit and statusprover_active_jobs- Currently processing jobsprover_queue_depth- Pending jobs in queue by circuit typeprover_key_load_duration_seconds- Time to load proving keys
Example Prometheus Scrape Config
Monitoring
Logs
The prover outputs structured logs:Health Checks
Troubleshooting
Out of Memory Errors
Out of Memory Errors
Symptom: Server crashes or proofs fail with OOM errorsSolutions:
- Increase available RAM (minimum 32GB, 64GB recommended)
- Reduce concurrent proof generation
- Use smaller batch sizes during development
- Close other memory-intensive applications
Missing Proving Keys
Missing Proving Keys
Symptom: Error: “proving key file not found”Solutions:
- Download keys:
./light-prover download --run-mode forester - Enable auto-download:
--auto-downloadflag - Check disk space (keys require 100+ GB)
- Verify keys directory permissions
Slow Proof Generation
Slow Proof Generation
Symptom: Proofs taking much longer than expectedSolutions:
- Ensure adequate CPU cores (16+ recommended)
- Check system CPU throttling (thermal issues)
- Reduce concurrent proof jobs
- Use SSD storage for key files (not HDD)
- Monitor system load with
toporhtop
Constraint Errors
Constraint Errors
Symptom: “constraint system error” in proof generationCauses:
- Invalid circuit inputs (wrong tree height, incorrect proofs)
- Mismatched Merkle proof length and tree height
- Invalid public input hash
- Circuit input validation failed
- Verify input data matches circuit parameters
- Check that Merkle proofs are correct
- Ensure public input hash is calculated correctly
- Review circuit documentation for input requirements
Next Steps
Circuit Details
Learn about circuit implementations and input formats
Forester Integration
Use the prover with the Forester service