Crate plonk_pallet[][src]

Expand description

Plonk Pallet


The Plonk pallet provides functions for:

  • Setup public parameters API
  • Get public parameters RPC
  • Verify zkp proof API


  • 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.


There four steps to use plonk-pallet.

  1. Import plonk-pallet to your substrate runtime and node
  2. Define your custom circuit and overwride circuit type
  3. Use plonk-pallet in your pallet
  4. 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


pub use pallet::*;



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 Commitments 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.


Defines all possible errors that can be encountered in PLONK.



Trait that should be implemented for any circuit function to provide to it the capabilities of automatically being able to generate, and verify proofs as well as compile the circuit.

Abstraction over a plonk zk-SNARKs system