Skip to main content

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)