Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
appendix
Browse files Browse the repository at this point in the history
  • Loading branch information
qwang98 committed Oct 25, 2023
1 parent 4aed761 commit d96a7dd
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 91 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
__pycache__
*.so
.ipynb_checkpoints
/_build
82 changes: 0 additions & 82 deletions Appendix.md

This file was deleted.

6 changes: 2 additions & 4 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ parts:
- file: part3_chapter4
- caption: Appendix
chapters:
- file: part3_chapter1
- file: part3_chapter2
- file: part3_chapter3
- file: part3_chapter4
- file: appendix_chapter1
- file: appendix_chapter2
9 changes: 9 additions & 0 deletions book/appendix_chapter1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Design Principles

**Abstraction**. As circuit complexity increases, abstraction is inevitable. By abstracting constraint building and column placement, Chiquito improves the readability and learnability of Halo2 circuits, which can not only standardize and simplify the code base for complex projects such as the zkEVM, but also onboard more circuit developers.

**Composability**. Chiquito circuits are fully composable with Halo2 circuits, which allows developers to write any part or the entirety of a circuit in Chiquito and integrate with other Halo2 circuits.

**Modularity**. The AST and IR representations of a circuit allow Chiquito to integrate any frontend that can compile into the AST data structure and any backend that can compile from the IR data structure. For example, we can have a Python frontend that compiles to Chiquito AST/IR, which compiles to a Sangria backend. Modularity allows for future extensions.

**User Experience**. Chiquito simplifies and optimizes user experience. For example, annotations for constraints are automatically generated for debugging messages.
22 changes: 22 additions & 0 deletions book/appendix_chapter2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Chiquito vs Halo2

There are two major architectural differences between Chiquito and Halo2:

- Chiquito circuit is composed of “step” instances. Each step type defines the constraints among witnesses, fixed columns, and lookup tables. Step instances are also called “super rows”, each composed of one or multiple rows in a PLONKish table. We made this design choice to allow for more complex constraints, which sometimes require allocating multiple Halo2 rows.
- Chiquito DSL is based on “signals” rather than columns in order to abstract away column placements. One signal can be placed in different columns across different steps, all handled by Chiquito’s compiler.

Chiquito circuit has the following architecture

- Circuit
- Setup
- Forward signals
- Shared signals
- Fixed signals
- Step types
- Setup
- Internal signals
- Constraints
- Transition constraints
- Lookup
- Witness generation
- Trace
17 changes: 13 additions & 4 deletions book/part1_chapter3.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,16 @@ There is a special type of signal called **fixed**, that is not part of the witn
| Fixed | All step types | Any | Setup |

## Putting everything together

TODO: Diagram


- Circuit
- Setup
- Forward signals
- Shared signals
- Fixed signals
- Step types
- Setup
- Internal signals
- Constraints
- Transition constraints
- Lookup
- Witness generation
- Trace
2 changes: 1 addition & 1 deletion book/part1_chapter4.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Python syntax
# Python Syntax

## Constraint builder

Expand Down

0 comments on commit d96a7dd

Please sign in to comment.