kbfold
Reference implementation of KBFold, a hash-based multilinear polynomial commitment scheme built on the Boolean-kernel basis: the table of a multilinear polynomial is encoded in the basis of kernel polynomials, and FRI folding acts natively on evaluation form over multiplicative domains.
- Paper: The Boolean-Kernel Basis (PDF).
- The mathematics of the paper is machine-checked in Lean 4
(
lean/).
Usage
use ;
use ;
// m = 16 variables, rate 1/4, 12 folding rounds, 148 queries
let p = Params ;
let table: = .map.collect; // f on {0,1}^16
let z: = .map.collect;
let = commit;
let = open; // v = f(z)
assert!;
Modules
| Module | Contents |
|---|---|
field |
Goldilocks F_p, p = 264 - 232 + 1, and the quadratic extension F_p[u]/(u^2 - 7) |
poly |
kernel and monomial transforms, Moebius transform, restriction, multilinear evaluation, NTT |
merkle |
Merkle trees (one leaf per fibre, BLAKE3 in keyed mode) and the Fiat-Shamir transcript |
pcs |
Params, commit, open, verify, verify_detail; kernel form (Basis::Kernel) and the coefficient-form baseline (Basis::Monomial) |
Commands
Status
Research code: single-threaded, no SIMD, not audited, not constant-time. The post-quantum corollary of the paper applies to the compiler of Chiesa-Di-Hu-Zheng (salted Merkle trees); this code uses unsalted trees, so the corollary is not claimed for it. Zero knowledge is not provided.
License
MIT or Apache-2.0, at your option.