Home

Awesome

OlaVM

LICENSE CI checks issues

OlaVM is a STARK-based ZK-friendly ZKVM, it is built on a small finite field called Goldilocks field. As the most important component of the Ola system, OlaVM is mainly used to execute a program and generate a valid proof for the programmable scalable case and the programmable private case.

Warning: This repository shouldn't be used for production case, as it is still in development phase and has not been audited, so it might contain many bugs and security holes..

Overview

OlaVM is a Turing complete VM, which means that it can execute any computation on it and at the same time it could generate a valid proof for it. For getting a smaller proof time, we have many powerful designs that are relevant with ZK-friendly.

Key Features

There are a lot of tricks to get a very ZK-friendly ZKVM in OlaVM. We would like to highlight some of them:

Status

FeaturesStatus
Algebraic RISC$\color{Green}{Done}$
Small finite field$\color{Green}{Done}$
Builtins - bitwise$\color{Green}{Done}$
Builtins - rangecheck$\color{Green}{Done}$
Builtins - cmp$\color{Green}{Done}$
Builtins - poseidon$\color{Green}{Done}$
Storage$\color{Green}{Done}$
Cross-contract call$\color{Green}{Done}$
Prover optimization$\color{Green}{Done}$
Builtins - ecdsa$\color{Yellow}{Doing}$
Prophet libs$\color{Yellow}{Doing}$
u32/u64/u256 lib$\color{Yellow}{Doing}$
Support privacy$\color{Yellow}{Doing}$

Project structure

This project consists of several crates:

CrateDescription
coreDefine instruction structure and instruction sets
circuits1. Constraints for instruction sets, builtins, memory; 2. Generate proof
executorExecute the programme and generate the execution trace for the Ola-prover
clientSome commands can be used by developers
plonky2A SNARK implementation based on techniques from PLONK and FRI techniques
infrastructureWrite the execution trace to an Excel file

Performance

Many optimizations have not yet been applied, and we expect to see some speed improvements as we devote more time to performance optimization. The benchmarks below should only be used as a rough guide to expected future performance.

AlgorithmExecution InstructionsLines in CPU TableMac(8-cpu 16GB-Mem) Execution and Generate trace TimeMac(10-cpu 32GB-Mem) Prove TimeLinux(64-cpu 128GB-Mem) Execution and Generate Trace TimeLinux(64-cpu 128GB-Mem) Prove Time
Calculate the 47th Fibonacci number 1000 times.8661152^200.275s, 0.571s80.524s0.315s, 0.95s39.767 s
Calculate the sqrt of 1,073,741,824 16000 times.5441132^200.892s, 0.572s65.758s1.185s, 0.955s29.935 s

Overall, we don't expect the benchmarks to change significantly, but there will definitely be some deviation from the numbers below in the future.

A few general notes on performance:

Software:

Hardware:

References

OlaVM runs based on the Goldilocks field and uses STARK to generate proofs for the inner layer and more will use Plonky2 to generate recursive proofs for inner proofs. There are some resources to learn more about it.

Goldilocks field & plonky2

STARK

Vitalik Buterin's blog series on zk-STARKs:

Alan Szepieniec's STARK tutorials:

Sin7Y's STARK explanation:

Privacy:

License

This project is under MIT licensed.