Documentation ¶
Overview ¶
The bw6circuit package provides an implementation of the BW6 proof aggregation circuit. This circuits can aggregate several PLONK proofs.
Index ¶
- func MakeCS(maxNbProofs int, piSetup circuits.Setup, vKeys []plonk.VerifyingKey) (constraint.ConstraintSystem, error)
- func MakeProof(setup *circuits.Setup, maxNbProof int, proofClaims []ProofClaimAssignment, ...) (plonk.Proof, error)
- func NewBuilder(maxNbProofs int, allowedInputs []string, pi circuits.Setup, ...) *builder
- type Circuit
- type PiInfo
- type ProofClaimAssignment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeCS ¶
func MakeCS( maxNbProofs int, piSetup circuits.Setup, vKeys []plonk.VerifyingKey, ) (constraint.ConstraintSystem, error)
Initializes the bw6 aggregation circuit and returns a compiled constraint system.
func MakeProof ¶
func MakeProof( setup *circuits.Setup, maxNbProof int, proofClaims []ProofClaimAssignment, piInfo PiInfo, publicInput fr.Element, ) ( plonk.Proof, error, )
Make proof runs the prover of the aggregation circuit and returns the corresponding proof.
func NewBuilder ¶
Types ¶
type Circuit ¶
type Circuit struct { // The list of claims to be provided to the circuit. ProofClaims []proofClaim `gnark:",secret"` PublicInputProof emProof `gnark:",secret"` PublicInputWitness emWitness `gnark:",secret"` // ordered for the PI circuit PublicInputWitnessClaimIndexes []frontend.Variable `gnark:",secret"` // general public input PublicInput frontend.Variable `gnark:",public"` // contains filtered or unexported fields }
The Circuit is used to aggregate multiple execution proofs and aggregation proofs together.
func AllocateCircuit ¶
func AllocateCircuit(nbProofs int, pi circuits.Setup, verifyingKeys []plonk.VerifyingKey) (*Circuit, error)
Instantiate a new Circuit from a list of verification keys and a maximal number of proofs. The function should only be called with the purpose of running `frontend.Compile` over it.
func AssignAggregationCircuit ¶
func AssignAggregationCircuit(maxNbProof int, proofClaims []ProofClaimAssignment, piInfo PiInfo, publicInput fr.Element) (c *Circuit, err error)
Assigns the proof using placeholders
type ProofClaimAssignment ¶
type ProofClaimAssignment struct { CircuitID int Proof plonk.Proof PublicInput fr.Element VerifyingKeyShasum types.FullBytes32 }
Assignment collects all the arguments that are necessary to produce a circuit assignment for the BW6 aggregation circuit. As the number of required arguments is large, it is more convenient to pack them in a struct instead of passing them flat.