← Protocols
EZKL
AI Agent / Web3·Ethereum · EVM L2s

EZKL

01Description

zkML toolkit that compiles PyTorch, TensorFlow, and sklearn models (via ONNX) into Halo2 zk-SNARK circuits with auto-generated Solidity verifiers. CLI, Python, and JS bindings.

02Best for
  • 01verifiable ML inference
  • 02ONNX to zk circuit compilation
  • 03on-chain Solidity verifiers
  • 04zkML oracles
  • 05private model inputs
03Install
  • pip install ezkl
  • pnpm add @ezkljs/engine
04Environment variables
VariableScopeDescription
EZKL_HUB_API_KEYServerAPI key for the hosted EZKL Hub remote proving service (optional; CLI also runs locally).
05Prompt snippet
Use EZKL to turn an ONNX model into a verifiable circuit. Pipeline: `ezkl gen-settings model.onnx`, `ezkl calibrate-settings`, `ezkl compile-circuit`, `ezkl setup` (KZG SRS), then `ezkl prove` to produce a SNARK and `ezkl create-evm-verifier` to emit a Solidity contract. From JS, use `@ezkljs/engine` `prove()` and `verify()` for browser/Node proving. Public inputs encode the model output commitment so a contract can call `verifier.verify(proof, publicInputs)` and gate logic on the result.
06Gotchas
  • Proof generation cost scales with circuit row count — large models (>10M params) need significant RAM (32GB+) and minutes-to-hours of proving time; use the hosted EZKL Hub for production.
  • Model quantization to fixed-point loses precision; calibrate `scale` and `bits` carefully or accuracy diverges from the float reference.
  • On-chain verifier gas is ~300k-700k per proof depending on circuit size; aggregate proofs off-chain (EVM Aggregator) before settlement to amortize cost.
  • Not every ONNX op is supported — check the supported-ops table; non-linearities like softmax may require lookup tables that blow up circuit size.
  • KZG ceremony parameters (SRS) must match between setup and verifier; mismatched `logrows` silently produces invalid proofs.
07Alternatives