Crate plonk_pallet[−][src]
Expand description
Plonk Pallet
Overview
The Plonk pallet provides functions for:
- Setup public parameters API
- Get public parameters RPC
- Verify zkp proof API
Terminology
-
Custom Circuit The circuit type should be replaced with your own circuit. This circuit should be defined on both blockchain runtime and offchain client.
-
Public Parameter The parameter generated during setup. The users can use this parameter to prove their transaction validity. This parameter can be gotten throught RPC client.
Intruduce
There four steps to use plonk-pallet
.
- Import
plonk-pallet
to your substrate runtime and node - Define your custom circuit and overwride circuit type
- Use
plonk-pallet
in your pallet - Open
get_public_parameters
RPC
get_public_parameters
is the RPC method and, trusted_setup
and verify
are
the dispatchable function and API for other pallet.
You can see the details with tutorial
Re-exports
pub use pallet::*;
Modules
Structs
Represents an element of the scalar field $\mathbb{F}_q$ of the BLS12-381 elliptic curve construction.
Constraint representation containing the coefficients of a polynomial evaluation
An Xorshift random number generator.
This represents a Jubjub point in the affine (x, y)
coordinates.
Represents an element of the scalar field $\mathbb{F}_r$ of the Jubjub elliptic curve construction.
A Proof is a composition of Commitment
s to the Witness, Permutation,
Quotient, Shifted and Opening polynomials as well as the
ProofEvaluations
.
Structure that represents a PLONK Circuit Public Input converted into it’s
&[BlsScalar
] repr.
The Public Parameters can also be referred to as the Structured Reference String (SRS). It is available to both the prover and verifier and allows the verifier to efficiently verify and make claims about polynomials up to and including a configured degree.
The struct for Merlin transcript and used for proof verify
The TurboComposer is the circuit-builder tool that the dusk-plonk
repository provides so that circuit descriptions can be written, stored and
transformed into a Proof
at some point.
Collection of structs/objects that the Verifier will use in order to
de/serialize data needed for Circuit proof verification.
This structure can be seen as a link between the Circuit
public input
positions and the VerifierKey
that the Verifier needs to use.
Enums
Defines all possible errors that can be encountered in PLONK.