STARK prover for ZK IR using Plonky3 with Baby Bear field.
ZK IR Prover generates STARK proofs from execution traces of ZK IR programs. It uses a multi-chip architecture optimized for the 32-bit ZK IR instruction set.
- 32-bit only - No field registers, all operations on 32-bit integers
- Baby Bear field - 31-bit prime (p = 2^31 - 2^27 + 1)
- Syscall-based crypto - Dedicated chips for Poseidon2, SHA256
- ~32 trace columns - Minimal CPU chip design
┌─────────────────────────────────────────────────────────────────────────┐
│ ZK IR Prover │
├─────────────────────────────────────────────────────────────────────────┤
│ ExecutionTrace Multi-Chip Machine Proof │
│ ┌──────────────┐ ┌─────────────────────┐ ┌──────────────┐ │
│ │ Steps │ │ ┌───────────────┐ │ │ STARK Proof │ │
│ │ Syscalls │──────►│ │ CPU Chip │ │──────►│ │ │
│ │ Memory Log │ │ │ (32 columns) │ │ │ ~50-100 KB │ │
│ │ I/O │ │ └───────────────┘ │ │ │ │
│ └──────────────┘ │ ┌───────────────┐ │ │ Verify: ~10ms│ │
│ │ │ Memory Chip │ │ └──────────────┘ │
│ │ └───────────────┘ │ │
│ │ ┌───────────────┐ │ │
│ │ │ Syscall Chips │ │ │
│ │ │ (Poseidon,etc)│ │ │
│ │ └───────────────┘ │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
git clone https://github.com/seceq/zkir-prover
cd zkir-prover
cargo build --releasezkir-prover prove --trace execution.zktrace -o proof.zkproofzkir-prover verify proof.zkproofzkir-prover info proof.zkproof--security fast- ~80 bits, for testing--security default- ~100 bits--security high- ~128 bits
| Trace Size | Prove Time | Verify Time | Proof Size |
|---|---|---|---|
| 2^16 (64K) | ~0.3s | ~10ms | ~50KB |
| 2^20 (1M) | ~5s | ~15ms | ~80KB |
| 2^24 (16M) | ~1.5min | ~20ms | ~120KB |
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.