MCPcopy Index your code
hub / github.com/PolyhedraZK/ExpanderCompilerCollection

github.com/PolyhedraZK/ExpanderCompilerCollection @v1.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.0 ↗ · + Follow
2,147 symbols 8,359 edges 272 files 221 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Expander

ExpanderCompilerCollection

Expander is a proof generation backend for the Polyhedra Network. The ExpanderCompilerCollection is a component of the Expander proof system. It transforms circuits written in gnark into an intermediate representation (IR) of a layered circuit. This IR can later be used by the Expander prover to generate proofs.

Documentation

Documentation is available at Expander Compiler Collection Documentation.

Using this Library

To incorporate the compiler into your Go project, include the following import statement in your code:

import "github.com/PolyhedraZK/ExpanderCompilerCollection"

We also have a Rust frontend similar to gnark.

Example

Refer to this example for a practical demonstration of our compiler. In this example, we illustrate how a gnark circuit can be compiled using ExpanderCompilerCollection. The output of this example includes a circuit description file "circuit.txt" and a corresponding witnesses file "witness.txt". Our prover, Expander, utilizes these IRs to generate the actual proof.

Acknowledgement

We extend our gratitude to the following projects, whose prior work has been crucial in bringing this project to fruition:

gnark: our frontend language is based on gnark's frontend.

Future Roadmap

As a compiler collection, we will support more circuit frontend languages in the near term.

Features in Progress

  • On-chain verifier generation
  • Extended in-circuit randomness generation

Extension points exported contracts — how you extend this code

FieldRaw (Interface)
This trait exist only for making Rust happy If we use arith::Field, Rust says upstream may add more impls [9 implementers]
expander_compiler/src/field.rs
Gate (Interface)
A generic gate interface [4 implementers]
ecgo/layered/circuit.go
StdCircuit (Interface)
All std circuits must implement the following trait [3 implementers]
circuit-std-rs/src/traits.rs
API (Interface)
API encapsulates the ecgo's frontend.API along with two new APIs added to facilitate direct invocation of ecgo.API withi [1 …
ecgo/api.go
SimpleField (Interface)
(no doc) [3 implementers]
ecgo/utils/buf.go
API (Interface)
API defines a set of methods for interacting with the circuit builder. [1 implementers]
ecgo/builder/api.go
Field (Interface)
(no doc) [3 implementers]
ecgo/field/field.go
Field (Interface)
(no doc) [8 implementers]
expander_compiler/src/field.rs

Core symbols most depended-on inside this repo

iter
called by 792
expander_compiler/src/circuit/layered/mod.rs
to_vec
called by 659
expander_compiler/src/circuit/layered/mod.rs
push
called by 586
expander_compiler/src/circuit/ir/dest/mul_fanout_limit.rs
clone
called by 464
circuit-std-rs/src/gnark/element.rs
clone
called by 446
expander_compiler/src/zkcuda/proving_system/traits.rs
new_internal_element
called by 430
circuit-std-rs/src/gnark/element.rs
len
called by 423
expander_compiler/src/utils/pool.rs
map
called by 212
expander_compiler/src/utils/pool.rs

Shape

Method 1,030
Function 841
Class 144
Struct 58
Interface 46
Enum 24
TypeAlias 3
FuncType 1

Languages

Rust78%
Go22%
Python1%
C++1%

Modules by API surface

expander_compiler/src/frontend/debug.rs53 symbols
expander_compiler/src/frontend/builder.rs47 symbols
expander_compiler/src/circuit/layered/mod.rs45 symbols
expander_compiler/src/zkcuda/context.rs39 symbols
expander_compiler/src/builder/basic.rs37 symbols
circuit-std-rs/src/gnark/emulated/sw_bls12381/g2.rs36 symbols
circuit-std-rs/src/gnark/emulated/field_bls12381/e2.rs36 symbols
expander_compiler/src/circuit/ir/expr.rs35 symbols
circuit-std-rs/src/gnark/field.rs35 symbols
expander_compiler/src/zkcuda/shape.rs33 symbols
expander_compiler/src/builder/final_build_opt.rs31 symbols
ecgo/builder/builder.go31 symbols

For agents

$ claude mcp add ExpanderCompilerCollection \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact