aggregation

package
v0.0.0-...-50d4516 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

The bw6circuit package provides an implementation of the BW6 proof aggregation circuit. This circuits can aggregate several PLONK proofs.

Index

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

func NewBuilder(
	maxNbProofs int,
	allowedInputs []string,
	pi circuits.Setup,
	vKeys []plonk.VerifyingKey,
) *builder

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

func (*Circuit) Define

func (c *Circuit) Define(api frontend.API) error

type PiInfo

type PiInfo struct {
	Proof         plonk.Proof
	PublicWitness witness.Witness
	ActualIndexes []int
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL