zk-bench

zk-bench

PolylangMidenRisc ZeroNoir
Frontend
Typescript-likeMASM (Assembly)Rust, C, C++Rust-like
ZK
STARKSTARKSTARKSNARK
External Libraries
GPU
✅ Metal✅ Metal✅ Metal, CUDA
Assert
0.03s0.03s6.94s0.01s
SHA-256
1 byte
0.64s0.64s6.72s1.86s
10 bytes
0.65s0.65s6.78s1.81s
100 bytes
2.54s2.54s28.06s1.87s
1000 bytes
22.14s22.14s3.81s
Fibonacci
1
0.03s0.03s6.73s0.01s
10
0.03s0.03s6.72s0.01s
100
0.03s0.03s6.72s0.01s
1,000
0.09s0.09s6.73s0.01s
10,000
0.64s0.64s13.72s0.01s
100,000
10.49s10.49s115.34s0.01s

Last Updated:

17 hours ago ()

FAQ

What is ZK?

ZK (Zero Knowledge) is a type of cryptography that allows a proof (a kind of certificate) to be generated that allows one party to prove to another that they know a value (or that some condition holds true), without revealing any information about the value itself.

There are two main components to ZK:

  1. Zero Knowledge - the ability to run computation without revealing all of the inputs, but having the output be trusted
  2. Provable computation - proves the code ran as designed, and therefore the output can be trusted

Here's a simple example to demonstrate the idea of provable computation. Below the code checks if the input provided is over 18. If we ran this in zero knowledge, we could generate a proof that the input value was > 18 without revealing the actual number:

function isOver18(age: number): boolean {
  return age > 18;
}

What’s the difference between a STARK and a SNARK?

These are two different approaches to provable zero knowledge computation.

FeatureSNARKSTARK
DefinitionSuccinct Non-interactive ARguments of KnowledgeScalable Transparent ARguments of Knowledge
Setup PhaseTypically requires a trusted setup to generate a shared secret key. Parameters must be kept secretDoes not require a trusted setup
Turing CompletenessProgram must be bounded at compile timeFully Turing complete
TransparencyLess transparent due to the trusted setupMore transparent due to the lack of a trusted setup
Proof SizeGenerally produces shorter proofsGenerates longer proofs, proof size is still non-linear
Verification TimeUsually offers faster verification timesSlower verification, especially with larger data. Not suitable for Ethereum
Prover TimeGenerally efficient but depends on the specific constructionProving time can be longer, particularly for larger datasets
Cryptographic AssumptionsRelies on stronger, more specific assumptionsRelies on lesser cryptographic assumptions, more "future-proof"
Quantum ResistanceGenerally not quantum-resistantGenerally quantum-resistant

How do you run the benchmarks?

We run the benchmarks using a Github Action using a self-hosted runner, running on a dedicated AWS instance. We use a dedicated instance to ensure that the performance calculations are not degraded by other users that might otherwise be using a shared instance. Benchmarks are updated automatically whenever we add, update benchmarks or the versions on the underlying frameworks.

Which is the best framework?

There is no “best” framework. As you can see from the table above, there are a lot of caveats and trade offs. You should choose the framework that best meets your needs, which will depend on what kind of application you are building.

Can you benchmark X or add framework X?

Sure, just submit a PR 😉

Why did you make this?

We made ZK-bench to help the ZK community to better understand the trade-offs and performance of different frameworks.