MCPcopy Index your code
hub / github.com/dusk-network/plonk

github.com/dusk-network/plonk @v0.22.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.22.1 ↗ · + Follow
497 symbols 1,507 edges 76 files 175 documented · 35%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PLONK

Build Status Repository Documentation

This is a pure Rust implementation of the PLONK proving system over BLS12-381.

This library contains a modular implementation of KZG10 as the default polynomial commitment scheme. Moreover, it includes custom gates for efficiency purposes. The details on our specific implementation can be found here. An audit can be found here.

DISCLAIMER: This library is currently unstable. A security audit has been completed, though further in-depth analysis and testing are encouraged. Use at your own risk.

Usage

To see how to use this library, check the 'examples' directory.

Features

This crate includes a variety of features which are briefly explained below: - alloc: Enables the usage of an allocator, allowing for Proof constructions and verifications. Without this feature it IS NOT possible to prove or verify anything. Its absence only makes dusk-plonk export certain fixed-size data structures such as Proof. This is useful in no_std environments that also do not make use of an allocator. - std: Enables std usage as well as rayon parallelization in some proving and verifying operations. It also uses the std versions of the elliptic curve dependencies, utilizing the parallel feature from dusk-bls12-381. This feature is enabled by default. - debug: Enables the runtime debugger backend, outputting CDF files to the path defined in the CDF_OUTPUT environment variable. When used, the binary must be compiled with debug = true. For more info, check the cargo book. It is recommended to derive the std output and std error and then place them in a text file for efficient gate analysis.

Documentation

The crate documentation provides information about all the functions that the library provides, as well as the documentation regarding the data structures that it exports. To check this, visit the documentation page or run make doc or make doc-internal.

Performance

Benchmarks taken on Apple M1, for a circuit-size of 2^16 constraints:

  • Proving time: 7.871s
  • Verification time: 2.821ms (This time does not vary depending on the circuit-size.)

For more results, please run cargo bench to get a full report of benchmarks in respect of constraint numbers.

Acknowledgements

  • Reference implementation by Aztec Protocol/Barretenberg.
  • FFT Module and KZG10 Module were adapted from ZEXE/Zcash and SCIPR Lab, respectively.

Licensing

This code is licensed under the Mozilla Public License Version 2.0 (MPL-2.0). Please see LICENSE for more information.

About

This implementation is designed by the Dusk team.

Contributing

  • If you want to contribute to this repository/project, please check our CONTRIBUTING.md.
  • If you want to report a bug or request a new feature addition, please open an issue on this repository.

Extension points exported contracts — how you extend this code

Circuit (Interface)
Circuit implementation that can be proved by a Composer The default implementation will be used to generate the proving [29 …
src/composer/circuit.rs
TranscriptProtocol (Interface)
Transcript adds an abstraction over the Merlin transcript For convenience [1 implementers]
src/transcript.rs

Core symbols most depended-on inside this repo

check_satisfied_circuit
called by 106
tests/common/mod.rs
append_witness
called by 86
src/composer.rs
iter
called by 84
src/fft/polynomial.rs
check_unsatisfied_circuit
called by 68
tests/common/mod.rs
append_scalar
called by 67
src/transcript.rs
append_commitment
called by 55
src/transcript.rs
challenge_scalar
called by 48
src/transcript.rs
evaluate
called by 45
src/fft/polynomial.rs

Shape

Method 301
Function 126
Class 62
Enum 6
Interface 2

Languages

Rust100%

Modules by API surface

src/composer.rs45 symbols
src/fft/polynomial.rs34 symbols
src/commitment_scheme/kzg10/key.rs31 symbols
src/composer/constraint_system/constraint.rs29 symbols
src/fft/domain.rs26 symbols
src/composer/permutation.rs19 symbols
src/proof_system/widget.rs18 symbols
src/fft/evaluations.rs17 symbols
src/compiler/prover.rs17 symbols
src/proof_system/proof.rs15 symbols
src/commitment_scheme/kzg10/srs.rs11 symbols
src/compiler/verifier.rs10 symbols

For agents

$ claude mcp add plonk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact