Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalProof ¶ added in v0.1.4
marshalProof marshals a plonk proof to a binary blob
Types ¶
type CompiledCircuit ¶
type CompiledCircuit struct { Ccs constraint.ConstraintSystem Pk plonk.ProvingKey Vk plonk.VerifyingKey Curve ecc.ID }
CompiledCircuit is a compiled circuit with its proving and verifying keys
func Compile ¶
func Compile(circuit frontend.Circuit, curve ecc.ID, setupConf setup.Conf) ( *CompiledCircuit, error)
Compile generates a CompiledCircuit from a circuit definiton and a curve id. The curves supported by the AVM are ecc.BN254 and ecc.BLS12_381. setupConf specifies whether to run a `Trusted` setup or a `TestOnly' setup, the latter not suitable for production.
func (*CompiledCircuit) Verify ¶
func (cc *CompiledCircuit) Verify(assignment frontend.Circuit, ) (*VerifiedProof, error)
Verify generates a proof from a circuit assignment and verifies it using gnark
func (*CompiledCircuit) WritePuyaPyVerifier ¶
func (cc *CompiledCircuit) WritePuyaPyVerifier(filepath string) error
WritePuyaPyVerifier writes to file python code that the PuyaPy compiler can compile to a smart contract verifier for the circuit.
type VerifiedProof ¶
VerifiedProof is a proof and its witness, generated after verifying the proof
func (*VerifiedProof) ExportProofAndPublicInputs ¶ added in v0.1.4
func (vp *VerifiedProof) ExportProofAndPublicInputs(proofFilePath string, publicInputsFilePath string) error
ExportProofAndPublicInputs writes a proof and its public inputs to files as binary blobs for the AVM verifier
func (*VerifiedProof) WriteProof ¶
func (vp *VerifiedProof) WriteProof(w io.Writer) error
WriteProof writes a proof as a binary blob that can be passed to AVM verifiers
func (*VerifiedProof) WritePublicInputs ¶
func (vp *VerifiedProof) WritePublicInputs(w io.Writer) error
WritePublicInputs writes the public inputs as a binary blob that can be passed to AVM verifiers
Directories ¶
Path | Synopsis |
---|---|
package examples contains examples of circuits and proof verifications that run on the AVM.
|
package examples contains examples of circuits and proof verifications that run on the AVM. |
basic
This example defines a basic circuit that given public variables 'a' and 'b', verifies that the Prover knows a secret 'c' that satisfies the Pythagorean equation: a*a + b*b == c*c
|
This example defines a basic circuit that given public variables 'a' and 'b', verifies that the Prover knows a secret 'c' that satisfies the Pythagorean equation: a*a + b*b == c*c |
merkle
This example defines a circuit that given a public root for a Merkle tree lets the Prover prove the presence in the tree of an element, wihtout revealing it.
|
This example defines a circuit that given a public root for a Merkle tree lets the Prover prove the presence in the tree of an element, wihtout revealing it. |
package setup contains trusted parameters for the supported curves and functions to set up zkp protocols with them.
|
package setup contains trusted parameters for the supported curves and functions to set up zkp protocols with them. |
bls12_381
package main contains the trusted parameters for the bls12_381 curve as described in the doc.go file in the setup package (parent folder).
|
package main contains the trusted parameters for the bls12_381 curve as described in the doc.go file in the setup package (parent folder). |
bn254
package main contains the trusted parameters for the bn254 curve as described in the doc.go file in the setup package (parent folder).
|
package main contains the trusted parameters for the bn254 curve as described in the doc.go file in the setup package (parent folder). |
package tests contains tests and test helper functions To run the tests, a local network with default configuration is expected to be running.
|
package tests contains tests and test helper functions To run the tests, a local network with default configuration is expected to be running. |
algosdkwrapper
package algosdkwrapper provides utility functions to interact with an Algorand local network wrapping the go-algorand-sdk.
|
package algosdkwrapper provides utility functions to interact with an Algorand local network wrapping the go-algorand-sdk. |
package verifier provides functions to generate verifier smart contracts for plonk based circuits.
|
package verifier provides functions to generate verifier smart contracts for plonk based circuits. |