Skip to content
You are reading gnark development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.

Updated on March 30, 2022

Compile a gnark circuit

Use frontend.Compile, to convert a circuit definition into an arithmetic representation.

The frontend.Compile method takes a high-level program and translates it to a sequence of constraints which have a simple mathematic form.

var myCircuit Circuit
r1cs, err := frontend.Compile(ecc.BN254, r1cs.NewBuilder, &myCircuit)
Questions or feedback? You can discuss issues and obtain free support on gnark discussions channel.
For paid professional support by Consensys, contact us at [email protected].