dusk-plonk is a pure Rust implementation of the PLONK ZK proving system over BLS12-381 with a KZG10 polynomial commitment scheme and custom gates. Single crate, no workspace.
| Directory | Purpose |
|---|---|
src/ |
Library source |
src/composer/ |
Circuit building, constraint system, gates |
src/proof_system/ |
Proving and verification, widgets |
src/commitment_scheme/ |
KZG10 polynomial commitments |
src/fft/ |
Fast Fourier Transform, polynomial arithmetic |
tests/ |
Integration tests |
benches/ |
Benchmarks |
examples/ |
Usage example (circuit.rs) |
docs/ |
PLONK specs PDF |
Run make help to list all available targets. Key points:
- Always use
maketargets: the Makefile is the source of truth for build, test, lint and docs commands. Each CI job runs one target. - Tests MUST use
--release: debug mode takes up to an hour for proof tests.make testdoes this. Run a single test withcargo test --release <test_name>. make fmtneeds the nightly toolchain.- Before a PR, run
make cqandmake test.
Widget-based prover with a Turbo composer. Circuits implement the Circuit trait, which defines circuit(&self, composer: &mut Composer) to build constraints. The Compiler takes a circuit + public parameters and produces prover/verifier pairs.
Core flow: Circuit -> Composer (constraint system) -> Compiler -> ProverKey/VerifierKey -> Proof -> Verify.
Widget types (in proof_system/widget/): arithmetic, logic, range, ECC, permutation — each handles a category of constraints during proving and verification.
Commitment scheme: KZG10 with a structured reference string (SRS). The PublicParameters type holds the SRS and is needed for compilation.
| Feature | Purpose | Default |
|---|---|---|
std |
Enables rayon parallelism | Yes |
alloc |
Core feature for proof construction/verification | No |
debug |
Runtime debugger with CDF output | No |
rkyv-impl |
rkyv serialization support | No |
This is a cryptographic crate — soundness bugs break consensus and privacy. Work with extra diligence.
- Verify:
make test(covers both default and all-features) andmake no-std - Watch: polynomial arithmetic, commitment opening proofs, transcript (Fiat-Shamir) binding, gate constraint enforcement
no_stdcompatible: the crate supportsno_stdwithalloc. Don't addstdimports outside feature gates.- Release mode testing: always
--releasefor proof tests - Feature gating: don't pull gated dependencies into default features
- Clippy: don't suppress warnings — fix the underlying issue
Changes to plonk ripple to downstream crates — phoenix/circuits, poseidon-merkle, rusk to name a few. Keep this in mind when making code changes, but no need to verify downstream for non-code changes.
Branches: branch from master. Don't push to master directly.
Commits: follow the style of recent commits in the repo.
Update CHANGELOG.md under [Unreleased] for user-visible changes only. Exclude tests, CI, tooling, and refactors.
- One fact per entry. Name the public item and behavior, including the affected released item if breaking. Leave implementation, rationale, consequences, and migration to the linked issue.
- Use existing
Added,Changed, orRemovedsections. UseFixedonly for released bugs. Correct unreleased bugs in their original entry. - Link only the GitHub issue, not the PR. Match existing link style and define references below. Preserve other entries and follow Keep a Changelog and Markdown blank-line spacing.