Skip to content
Merged
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
46 changes: 42 additions & 4 deletions website/docs/developers/circuits.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,49 @@ proof types:
- Protocol compliance validation
- Regression testing for circuit changes

## Circuit Constraint Extraction
### Circuit Generation Process

Since these constraint capabilities are missing, the Mina rust nodes require
externally generated circuit data. The following process describes how circuits
are created and distributed using the original Mina codebase:

:::warning Work in Progress

This should be updated when a release of the OCaml node happens that contains code to
export circuits, and when command to export circuits is added, and CI is updated
to check for latest circuits

:::

1. Build mina <b>OCaml</b> node from source with commit after
[`6961849`](https://github.com/MinaProtocol/mina/commit/6961849f17d564c39e7d45e01e3ddda9a09602a4)

2. Running the circuit generation process using the branch above
- Launch the OCaml node which produces circuit cache data in
`/tmp/coda_cache_dir`
- The branch dumps the usual circuit data plus extra data specifically
required by the Mina rust nodes, see
[Circuit somponents](#circuit-components)
- The process also dumps blocks for use in tests, see
[Testing strategy](#testing-strategy)
- Integration with mainline Mina would streamline future circuit generation

3. The generated circuit blobs are then:
- Committed to the dedicated repository:
https://github.com/o1-labs/circuit-blobs
- Released as GitHub releases for versioning and distribution

### Circuit Components

Each circuit consists of multiple components that are loaded and cached
independently:

For a comprehensive technical overview of circuit constraint extraction, see the
[circuit_blobs module documentation](https://o1-labs.github.io/mina-rust/api-docs/ledger/proofs/circuit_blobs/index.html)
in the ledger crate.
- **Gates**: Circuit constraint definitions in JSON format (`*_gates.json`)
- **Internal Variables**: Constraint variable mappings in binary format
(`*_internal_vars.bin`)
- **Rows Reverse**: Row-wise constraint data in binary format (`*_rows_rev.bin`)
- **Verifier Indices**: Pre-computed verification data with SHA256 integrity
checks

### Overview

Expand Down
Loading