DSL for Halo2 circuits
Chiquito is a high-level structured language for implementing zero knowledge proof applications.
Chiquito is being implemented in the DSL Working Group of PSE, Ethereum Foundation.
Most ZKP DSLs are based on writing constraints, witness generation and some abstraction for DRY like templates or gadgets.
Chiquito allows the developer to think in more high-level and structured abstractions that most ZKP DSLs, while not sacrificing performance.
Chiquito starts from the idea that every zero knowledge proof represents a program (the setup), which can have many computations (the trace) that is proven for a certain input, output and intermediate values (the witness).
The main structured abstraction in chiquito is the step. Any computation can be divided in individual steps. A program is represented by a circuit that has one or many step types, a particular computation is represented as a series of step instances that can have arbitrary order.
A step type contains:
A chiquito circuit contains a trace function that for a given input will generate the step instances in a particular order and use the step type witness generation.
Another important piece of Chiquito are the signals. They represent elements of the witness.
There are several types:
a == a.rot(2) which means that a is equal to a in the next of the next step (super rotation +2).a == a.next() but you could not assert a == a.prev(). Forward signal has the advantage of allowing for witness size optimisations.Chiquito has many more features, but these are enough to start writing basic circuits.
Currently Halo2 backend is implemented, but we are looking into implementing other backends.
Chiquito frontend comes in two flavours: rust and python, so you can write Chiquito applications in either Rust or Python. PyChiquito, and any other language interface in the future, uses ChiquitoCore for most of its work, so adding new languages is easy.
PLONKish-specific features:
Planned:
In research:
But better see for yourself:
…This is explained in more detail in the tutorial, but you can see already how concise and clear it is.
All located in the tutorial folder.
Follow Part 2: Quick Start of the tutorial folder.
To use chiquito in Python, just need to install it with pip:
pip install chiquitoTo use chiquito in Rust (TODO)
Chiquito is built in Rust. First install Rust. Then clone this repo and enter the repo directory.
git clone https://github.com/privacy-scaling-explorations/chiquito
cd chiquitoThen to build Python chiquito with maturin
python -m venv .env
source .env/bin/activate
pip install -r requirements.txt
maturin developAPI documentation: cargo doc --no-deps --package chiquito --open
Also auto-published here for the latest commit to main: docs.pecadorplonkish.xyz/
MIT OR Apache-2.0
No open issues yet, or sync has not completed.