An educational implementation of the sumcheck protocol in Rust, using the arkworks ecosystem for finite fields and multivariate polynomials.
The sumcheck protocol is a fundamental building block in modern zero-knowledge proof systems such as SNARKs.
A good reference for the theory is Justin Thaler's book Proofs, Arguments, and Zero-Knowledge.
- Defines
ProverandVerifierstructs that exchange messages innrounds - Implements the boolean hypercube enumeration
- Implements partial evaluation of multivariate polynomials
- Performs all arithmetic in the finite field F₁₀₁ (integers mod 101), instantiated via
ark-ff - Runs a concrete example with a 4-variable polynomial and prints the full protocol transcript
src/
├── main.rs # Entry point; defines the example polynomial and runs the protocol
├── protocol.rs # Core logic: Prover, Verifier, hypercube, polynomial evaluation
└── tests.rs # Unit tests for helper functions
| Crate | Purpose |
|---|---|
ark-ff |
Finite field arithmetic |
ark-poly |
Sparse multivariate and univariate polynomials |
rand / rand_chacha |
Randomness for verifier challenges |
Prerequisites: Rust (edition 2021)
git clone https://github.com/msmirnov18/mysumcheck
cd mysumcheck
cargo runRun the tests:
cargo test