Documentation ¶
Index ¶
- func CircuitDigest(circuit constraint.ConstraintSystem) (string, error)
- func ProveCheck(setup *Setup, assignment frontend.Circuit, opts ...any) (plonk.Proof, error)
- func ReadVerifyingKey(path string, into plonk.VerifyingKey) error
- func SerializeProofRaw(proof plonk.Proof) string
- func SerializeProofSolidityBn254(proof plonk.Proof) string
- type Builder
- type CircuitID
- type MockCircuitID
- type ProveCheckOption
- type SRSProvider
- type SRSStore
- type Setup
- type SetupManifest
- type UnsafeSRSProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CircuitDigest ¶
func CircuitDigest(circuit constraint.ConstraintSystem) (string, error)
CircuitDigest computes the SHA256 digest of the circuit.
func ProveCheck ¶
Generates a PlonkProof and sanity-checks it against the verifying key. Can take a list of options which can of either backend.ProverOption of backend. VerifierOption.
func ReadVerifyingKey ¶
func ReadVerifyingKey(path string, into plonk.VerifyingKey) error
func SerializeProofRaw ¶
Serializes the proof in an 0x prefixed hexstring
func SerializeProofSolidityBn254 ¶
Serializes the proof in an 0x prefixed hexstring
Types ¶
type Builder ¶
type Builder interface {
Compile() (constraint.ConstraintSystem, error)
}
type CircuitID ¶
type CircuitID string
CircuitID is a type to represent the different circuits. It is used to identify the circuit to be used in the prover.
const ( ExecutionCircuitID CircuitID = "execution" ExecutionLargeCircuitID CircuitID = "execution-large" BlobDecompressionV0CircuitID CircuitID = "blob-decompression-v0" BlobDecompressionV1CircuitID CircuitID = "blob-decompression-v1" AggregationCircuitID CircuitID = "aggregation" EmulationCircuitID CircuitID = "emulation" EmulationDummyCircuitID CircuitID = "emulation-dummy" ExecutionDummyCircuitID CircuitID = "execution-dummy" BlobDecompressionDummyCircuitID CircuitID = "blob-decompression-dummy" PublicInputInterconnectionCircuitID CircuitID = "public-input-interconnection" )
type MockCircuitID ¶
type MockCircuitID int
MockCircuitID is a type to represent the different mock circuits.
const ( MockCircuitIDExecution MockCircuitID = 0 MockCircuitIDDecompression MockCircuitID = 6789 MockCircuitIDEmulation MockCircuitID = 1 )
type ProveCheckOption ¶
type ProveCheckOption func(*proveCheckSettings)
func WithCachedProof ¶
func WithCachedProof(path string) ProveCheckOption
type SRSProvider ¶
type SRSProvider interface {
GetSRS(ctx context.Context, ccs constraint.ConstraintSystem) (kzg.SRS, kzg.SRS, error)
}
type SRSStore ¶
type SRSStore struct {
// contains filtered or unexported fields
}
func NewSRSStore ¶
NewSRSStore creates a new SRSStore
type Setup ¶
type Setup struct { Manifest SetupManifest Circuit constraint.ConstraintSystem ProvingKey plonk.ProvingKey // this is not serialized to disk VerifyingKey plonk.VerifyingKey }
Setup contains the proving and verifying keys of a circuit, as well as the constraint system. It's a common structure used to pass around the resources associated with a circuit.
func MakeSetup ¶
func MakeSetup( ctx context.Context, circuitName CircuitID, ccs constraint.ConstraintSystem, srsProvider SRSProvider, extraFlags map[string]any, ) (Setup, error)
MakeSetup returns a setup for a given circuit that is either downloaded from the S3 bucket or generated in an unsafe manner.
func (*Setup) VerifyingKeyDigest ¶
type SetupManifest ¶
type SetupManifest struct { CircuitName string `json:"circuitName"` Timestamp time.Time `json:"timestamp"` // Sha256 of the associated assets Checksums struct { VerifyingKey string `json:"verifyingKey"` VerifierContract string `json:"verifierContract"` Circuit string `json:"circuit"` } `json:"checksums"` NbConstraints int `json:"nbConstraints"` CurveID string `json:"curveID"` ExtraFlags map[string]any `json:"extraFlags"` }
SetupManifest is the human-readable manifest of the assets generated by the prover setup command
func NewSetupManifest ¶
func NewSetupManifest( circuitName string, nbConstraints int, curveID ecc.ID, extraFlags map[string]any, ) SetupManifest
NewSetupManifest creates a new manifest.
func ReadSetupManifest ¶
func ReadSetupManifest(filePath string) (*SetupManifest, error)
ReadSetupManifestFromFile reads a manifest from a json file
func (*SetupManifest) GetInt ¶
func (m *SetupManifest) GetInt(key string) (int, error)
GetInt returns the value of an int flag set in the ExtraFlags map
func (*SetupManifest) GetStringArray ¶
func (m *SetupManifest) GetStringArray(key string) ([]string, error)
func (*SetupManifest) WriteTo ¶
func (m *SetupManifest) WriteTo(filePath string) error
writeToJSONFile writes a manifest to a json file
type UnsafeSRSProvider ¶
type UnsafeSRSProvider struct { }
func NewUnsafeSRSProvider ¶
func NewUnsafeSRSProvider() UnsafeSRSProvider
NewUnsafeSRSProvider returns a new UnsafeSRSProvider if tau is provided, it will be used as the tau value for the SRS (slow path) otherwise, a random tau will be generated (fast path)
func (UnsafeSRSProvider) GetSRS ¶
func (u UnsafeSRSProvider) GetSRS(ctx context.Context, ccs constraint.ConstraintSystem) (kzg.SRS, kzg.SRS, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
The bw6circuit package provides an implementation of the BW6 proof aggregation circuit.
|
The bw6circuit package provides an implementation of the BW6 proof aggregation circuit. |
The bn254 package provides an implementation of a gnark circuit that can recursively verify a PLONK proof on the BW6 field with an arithmetization over the BN254 curve.
|
The bn254 package provides an implementation of a gnark circuit that can recursively verify a PLONK proof on the BW6 field with an arithmetization over the BN254 curve. |