$ show inference-labs-inc/JSTprove
JSTprove is a production-grade zero-knowledge proof system for verifying ONNX neural network inference. It compiles ML models into arithmetic circuits using the Expander Compiler Collection (ECC) frontend, generates witnesses, and produces proofs via a GKR/sumcheck-based prover with multiple polynomial commitment schemes (KZG, Hyrax, Orion, Basefold, WHIR). The system supports multiple efficient field arithmetics (Mersenne31, BabyBear, Goldilocks, BN254, GF2) with SIMD/AVX/NEON optimizations, and provides hardware acceleration through Metal and CUDA backends. The codebase is organized as a Rust workspace with ~30 crates, offering a CLI (`jstprove`, `jstprove-remainder`), Python bindings via PyO3, and a zkVM guest (Jolt). It is actively maintained by Inference Labs with regular commits, CI/CD pipelines, and e2e tests covering full model pipelines (LeNet, CIFAR CNN, MiniResNet). While primarily an application toolkit, it contains deep cryptographic research contributions in the form of advanced polynomial commitment constructions (sparse WHIR, hyper-bivariate KZG) and circuit optimizations (cross-layer GKR, LogUp range checks). Some hints (e.g., sigmoid, gridsample) carry documented soundness caveats, and the system relies on nightly Rust and platform-specific intrinsics, which may limit portability.
The LLM identified 6 files worth highlighting for reuse:
Implements multilinear extension (Eq) evaluation with multiple efficient strategies: split-half batched, Hyperplonk's method, and Jolt's method. Exposes `build_eq_x_r_with_buf` for amortized reuse. This core polynomial primitive is essential for sumcheck and GKR, and can be extracted into any multilinear polynomial commitment project.
Provides `declare_gkr_config!` macro for concisely defining valid GKR proof system configurations (field + PCS + hash + scheme combo). Reduces boilerplate and enforces consistency across dozens of variants. The pattern is reusable for any framework that requires structured configuration definitions.
Generic Merkle tree implementation with compact leaf storage using field elements (scalar or SIMD-packed). Supports automatic hash aggregation and proof generation. The design is field-agnostic and can be adapted for any cryptographic commitment scheme requiring Merkle proofs.
Defines `ExpSerde` trait for portable serialization of field elements and composite types, with a corresponding `serdes_derive` proc-macro. Supports multiple encoding formats, endianness, and zero-copy views. This decouples proof system internals from wire format and can be reused in any Rust project requiring flexible serialization.
Defines `PolynomialCommitmentScheme` trait that completely abstracts the polynomial commitment interface for GKR, including setup, commit, open, and verification. Implemented by Hyrax, KZG, Orion, Basefold, and WHIR. This clean trait boundary enables drop-in replacement of PCS backends without modifying the prover core.
Implements the LogUp argument for range checks and table lookups in arithmetic circuits. Provides `LogupRangeCheckContext` for amortized per-element constraints with support for batched finalization. This is a self-contained constraint gadget that can be extracted into any ZK circuit compiler.