zkML Proof Generation
Introduction
zkML proof generation involves creating a single zero-knowledge proof (ZKP) of a given output from the zk-circuit of a committed ML model. The resultant proof allows any third-party verifier (with access to the required ezkl collaterals) to trustlessly verify whether the claimed output did indeed come from the claimed zk-circuit of a given model.
After the one-time setup of ezkl has been successfully completed, proof generation is relatively straight-forward and takes much less time compared to the setup.
Overview
At a high level, proof generation involves the following steps:
Generate a witness file through
ezkl.gen_witness()
Perform a mock run through
ezkl.mock()
as a sanity check to confirm the correctness of the witness fileGenerate the proof through
ezkl.prove()
Further technical details and a step-by-step guide can be found here.
Benchmarks
Some ezkl benchmarks related to proof generation across a range of model sizes on a local laptop are:
# of parameters | Proof Generation | Proof Verification | Proof file size |
10,497 | 1.484s | 0.031s | 24.9kB |
17,386 | 2.897s | 0.059s | 24.6kB |
45,817 | 5.012s | 0.093s | 24.4kB |
118,721 | 12.83s | 0.187s | 38kB |
197,681 | 24.689s | 0.337s | 38kB |
479,873 | 49.106s | 0.691s | 38kB |
1,041,225 | 147.472s (02:27) | 2.342s | 38kB |
2,010,929 | 212.956s (03:33) | 2.89s | 38kB |
Proof Submissions
From Spectral App's v0.2.0 onwards:
all model predictions submitted during the model validation phase will need to be accompanied by their respective ZKPs
During the Consumption Window, Validators may regularly request ZKPs for random predictions to ensure continuous transparency and integrity of the platform
Last updated