Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions acvm-repo/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# ACIR - Abstract Circuit Intermediate Representation
## Project Structure

ACIR is an NP complete language that generalizes R1CS and arithmetic circuits while not losing proving system specific optimizations through the use of black box functions.
This folder is organized into several key components:

# ACVM - Abstract Circuit Virtual Machine
- `acir/` - Definition and implementation of ACIR
- `acvm/` - Implementation of ACVM that executes ACIR
- `brillig/` - Definition and implementation of unconstrained Brillig opcodes
- `brillig_vm/` - Implementation of Brillig VM that executes Brillig

This can be seen as the ACIR compiler. It will take an ACIR instance and convert it to the format required
by a particular proving system to create a proof.
Click into each folder to learn more from their READMEs.

# How to add a new crate to the workspace
## Development

- Create the new crate with the current version of the other crates.
- In root `Cargo.toml`, add the new crate to the workspace members list.
- If you want to import it from multiple packages, you can add it as a dependency in the root `Cargo.toml`.
- In `release-please-config.json`:
- Add a package entry
- Add the crate name to the `linked-versions` plugin list
- If you added the new crate as a dependency in the root `Cargo.toml`, add it to the extra-files of the root package.
- In `.release-please-manifest.json`, add the new crate with the same version of the others.
- In [publish.yml](.github/workflows/publish.yml), add the new crate to the `publish` job after its dependencies.
### Adding a New Crate

To add a new crate to the workspace:

1. Create the new crate with the current version of other crates
2. In root `Cargo.toml`, add the new crate to the workspace members list
3. If you want to import it in other noir-lang packages, add it as a dependency in the root `Cargo.toml`
4. Update `release-please-config.json`:
- Add a package entry
- Add the crate name to the `linked-versions` plugin list
- If added as a dependency in the root `Cargo.toml`, add it to the extra-files of the root package
5. Update `.release-please-manifest.json` with the new crate at the same versioning number as others
6. Update [publish.yml](../.github/workflows/publish-acvm.yml) to include the new crate in the `publish` job
4 changes: 3 additions & 1 deletion acvm-repo/acir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ _Note_: Opcodes operate on witnesses, but we will see that some opcodes work on
So basically, using witnesses or expressions is equivalent,
but the latter can avoid the creation of witness in some cases.

## Brillig
## Documentation

For detailed documentation, visit <https://noir-lang.github.io/noir/docs/acir/index.html>.
14 changes: 14 additions & 0 deletions acvm-repo/acvm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ACVM - Abstract Circuit Virtual Machine

ACVM (Abstract Circuit Virtual Machine) is the virtual machine that processes and executes Abstract Circuit Intermediate Representation (ACIR) instances. It takes in ACIR instances and user inputs, and generate partial witnesses for proving backends to create proofs with.

## Components

The ACVM crate is organized into several key modules:

- `compiler/` - Circuit compilation and optimization
- `pwg/` - Partial witness generation

## Documentation

For detailed documentation, visit <https://noir-lang.github.io/noir/docs/acvm/index.html>.
4 changes: 4 additions & 0 deletions acvm-repo/brillig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,7 @@ Blockchain
---
Another use case for Brillig bytecode is for public execution of a smart contract in a blockchain environment. In that case, the public function has a Brillig runtime and is compiled into Brillig bytecode. This bytecode can then be executed by a dedicated zkVM, which results into a new state of the blockchain along with a proof that this state is the result of applying the public function.
The blockchain can now be updated upon proof verification by the blockchain nodes.

## Documentation

For detailed documentation, visit <https://noir-lang.github.io/noir/docs/brillig/index.html>.
6 changes: 5 additions & 1 deletion acvm-repo/brillig_vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ It serves as the runtime environment for Brillig, which is a bytecode format use

This VM provides a lightweight execution environment for running computational tasks that may be difficult or inefficient to express directly in circuit constraints. This enables Noir programs to perform complex computations outside of the constraint system while still being able to interact with constrained code.

The VM supports various operations including arithmetic operations over fields and integers, memory management, conditional execution, and foreign function calls that can interact with external systems. The VM processes opcodes sequentially, manages memory, and handles control flow, providing the foundation for executing Brillig bytecode generated from Noir programs.
The VM supports various operations including arithmetic operations over fields and integers, memory management, conditional execution, and foreign function calls that can interact with external systems. The VM processes opcodes sequentially, manages memory, and handles control flow, providing the foundation for executing Brillig bytecode generated from Noir programs.

## Documentation

For detailed documentation, visit <https://noir-lang.github.io/noir/docs/brillig_vm/index.html>.
Loading