2023-08-22 10:48:36 +07:00
2023-08-22 10:48:36 +07:00
2023-08-21 07:48:22 +00:00
2023-08-21 07:48:22 +00:00
2023-08-21 07:48:22 +00:00
2023-08-21 07:48:22 +00:00
2023-05-03 03:52:59 +00:00
2023-08-21 07:48:22 +00:00
2023-08-21 07:48:22 +00:00
2023-08-21 07:48:22 +00:00
2023-08-21 07:48:22 +00:00
2023-04-04 16:57:17 +07:00
2023-05-03 05:46:39 +00:00

Chiquito

Project Description

Chiquito is a step-based high-level rust DSL (pychiquito is a python DSL for chiquito) that provides better syntax and abstraction for constraint building and column placement when writing plonkish circuits and has a Halo2 backend, and other backends are in the works. It allows the user to manipulate an AST thats compiled to a Chiquito Halo2 backend, which can be integrated into any Halo2 circuit.

It's HIGHLY RECOMMENDED that you read the design principles, architecture, and specific terms of a Chiquito circuit before getting started.

You can also learn about the project's current status and its next steps.

Getting Started

Setup

Run the following in command line to add Chiquito as a dependency for your project:

cargo add --git https://github.com/privacy-scaling-explorations/chiquito

Use the following examples to understand how Chiquito works or use them as starting templates for building your own Chiquito circuit.

Refer to the Appendix on the exposed user functions and overall workflow of a Chiquito circuit.

Refer to Testing and Links on detailed API documentations.

Example: Fibonacci Circuit

Run the following in command line:

cargo run --example fibonacci

This example demonstrates how to construct signals, step types, constraints, and witness generation in Chiquito. Best for first time Chiquito users.

Example: MiMC7 Circuit

TODO: annotate this code example

This example demonstrates how to construct a lookup table and use external inputs as trace arguments in Chiquito, besides covering concepts in the Fibonacci example. MiMC7 is a zk-friendly hashing function.

Example: zkEVM Bytecode Circuit

https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1348

This example rewrites the zkEVM bytecode circuit using Chiquito and passes all original tests. It demonstrates how Chiquito can standardize and simplify larger scale circuits on the production level.

Python bindings

There are 2 ways to install chiquito python bindings

Install chiquito with pip

To use chiquito in Python, just need to install it with pip

pip install chiquito

Build from source

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 chiquito

Then build the python bindings with maturin

python -m venv .env
source .env/bin/activate
pip install maturin
maturin develop

Testing and Links

API documentation: cargo doc --no-deps --package chiquito --open

Currently API documentation is only written for exposed user functions, which are scattered across the DSL, constraint builder, compiler, and AST. Refer to the following subdirectories for specific functions:

Licenses

MIT OR Apache-2.0

Description
No description provided
Readme 14 MiB
Languages
Rust 64.2%
Jupyter Notebook 27.5%
Python 8.1%
Makefile 0.2%