Skip to content

Commit 627edbd

Browse files
markosg040xAndoroid
authored andcommitted
feat: add HyperKZG zero-knowledge openings
1 parent 131c07b commit 627edbd

25 files changed

Lines changed: 4899 additions & 572 deletions

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ members = [
3434
"crates/jolt-sumcheck",
3535
"crates/jolt-openings",
3636
"crates/jolt-verifier",
37+
"crates/jolt-prover",
38+
"crates/jolt-witness",
39+
"crates/jolt-backends",
3740
"crates/jolt-dory",
41+
"crates/jolt-dory-assist-verifier",
3842
"crates/jolt-hyrax",
3943
"crates/jolt-hyperkzg",
44+
"crates/jolt-wrapper-verifier",
4045
"crates/jolt-riscv",
4146
"crates/jolt-transcript",
4247
"crates/jolt-profiling",
@@ -389,9 +394,15 @@ jolt-blindfold = { path = "./crates/jolt-blindfold" }
389394
jolt-claims = { path = "./crates/jolt-claims" }
390395
jolt-crypto = { path = "./crates/jolt-crypto" }
391396
jolt-field = { path = "./crates/jolt-field" }
397+
jolt-hyperkzg = { path = "./crates/jolt-hyperkzg" }
392398
jolt-openings = { path = "./crates/jolt-openings" }
393399
jolt-hyrax = { path = "./crates/jolt-hyrax" }
400+
jolt-dory-assist-verifier = { path = "./crates/jolt-dory-assist-verifier" }
401+
jolt-wrapper-verifier = { path = "./crates/jolt-wrapper-verifier" }
394402
jolt-verifier = { path = "./crates/jolt-verifier" }
403+
jolt-prover = { path = "./crates/jolt-prover" }
404+
jolt-witness = { path = "./crates/jolt-witness" }
405+
jolt-backends = { path = "./crates/jolt-backends" }
395406
jolt-poly = { path = "./crates/jolt-poly" }
396407
jolt-r1cs = { path = "./crates/jolt-r1cs" }
397408
jolt-transcript = { path = "./crates/jolt-transcript" }

crates/jolt-hyperkzg/Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "jolt-hyperkzg"
33
version = "0.1.0"
44
edition = "2021"
55
license = "MIT"
6-
description = "HyperKZG multilinear polynomial commitment scheme for the Jolt zkVM"
6+
description = "HyperKZG Gemini-style multilinear polynomial commitment scheme for the Jolt zkVM"
77

88
[lints]
99
workspace = true
@@ -15,21 +15,31 @@ jolt-poly = { path = "../jolt-poly" }
1515
jolt-transcript = { path = "../jolt-transcript" }
1616
jolt-openings = { path = "../jolt-openings" }
1717
serde = { workspace = true, features = ["derive"] }
18+
bincode = { workspace = true }
1819
tracing.workspace = true
1920
num-traits = { workspace = true }
2021
rayon = { workspace = true }
2122
thiserror = { workspace = true }
2223
rand_core = { workspace = true, features = ["getrandom"] }
2324
rand_chacha = { workspace = true }
2425

26+
[features]
27+
default = []
28+
zk = []
29+
2530
[dev-dependencies]
2631
jolt-field = { path = "../jolt-field", features = ["bn254"] }
2732
criterion = { workspace = true }
2833
rand = { workspace = true }
34+
memory-stats = { workspace = true }
2935

3036
[[bench]]
3137
name = "hyperkzg"
3238
harness = false
3339

40+
[[bench]]
41+
name = "hyperkzg_zk_profile"
42+
harness = false
43+
3444
[package.metadata.cargo-machete]
3545
ignored = ["rand_core", "rand_chacha", "rand"]

crates/jolt-hyperkzg/README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,34 @@ This crate is generic over `PairingGroup` from `jolt-crypto` and implements `Com
1616
2. **Open** (Gemini reduction) — fold the multilinear polynomial `ℓ-1` times producing intermediate commitments, derive challenge `r`, batch KZG open at `[r, -r, r²]`.
1717
3. **Verify** — evaluation consistency check, then batch KZG pairing check.
1818

19+
With the `zk` feature, HyperKZG uses commitment blinding plus KZG proof
20+
randomization: ZK hints carry one scalar blind, hidden evaluations are group
21+
commitments, and the verifier checks Gemini over group elements without seeing
22+
raw evaluations.
23+
24+
## SRS Generation and Import
25+
26+
HyperKZG uses a **structured** reference string with a KZG trapdoor `beta`.
27+
Production provers/verifiers should import an SRS generated by a separate trusted
28+
setup ceremony, rather than generating `beta` in the live proving process.
29+
30+
The canonical prover SRS filename is:
31+
32+
```text
33+
hyperkzg_{k}.srs
34+
```
35+
36+
Here `k` is the exponent for the supported polynomial size: `hyperkzg_20.srs`
37+
supports multilinear polynomials with up to `2^20` evaluations. The serialized
38+
prover setup stores one additional G1 power internally, following the KZG SRS
39+
convention used by this crate.
40+
41+
SRS files use a versioned envelope with a `Plain`/`Zk` discriminant so loaders do
42+
not silently accept the wrong ceremony output. `HyperKZGScheme::setup` and
43+
`HyperKZGScheme::setup_from_secret` are intended for tests or trusted setup
44+
tooling only. The runtime import path is `HyperKZGScheme::read_srs_file(path)`
45+
or `HyperKZGScheme::read_srs_from_dir(dir, k)`.
46+
1947
## Public API
2048

2149
- **`HyperKZGScheme<P>`** — Main entry point. Implements `CommitmentScheme` and `AdditivelyHomomorphic`.
@@ -42,7 +70,8 @@ Used by `jolt-zkvm`.
4270

4371
## Feature Flags
4472

45-
This crate has no feature flags.
73+
- **`zk`** — Enables ZK HyperKZG surface area. Transparent HyperKZG remains the
74+
default path.
4675

4776
## License
4877

crates/jolt-hyperkzg/benches/hyperkzg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn bench_verify(c: &mut Criterion) {
9494
let poly = Polynomial::<Fr>::random(nv, &mut rng);
9595
let point: Vec<Fr> = (0..nv).map(|_| Fr::random(&mut rng)).collect();
9696
let eval = poly.evaluate(&point);
97-
let (commitment, ()) = TestScheme::commit(poly.evaluations(), &pk);
97+
let (commitment, _) = TestScheme::commit(poly.evaluations(), &pk);
9898
let mut transcript =
9999
jolt_transcript::Blake2bTranscript::new(b"bench-verify");
100100
let proof = <TestScheme as CommitmentScheme>::open(
@@ -138,7 +138,7 @@ fn bench_combine(c: &mut Criterion) {
138138
let commitments: Vec<_> = (0..count)
139139
.map(|_| {
140140
let poly = Polynomial::<Fr>::random(num_vars, &mut rng);
141-
let (c, ()) = TestScheme::commit(poly.evaluations(), &pk);
141+
let (c, _) = TestScheme::commit(poly.evaluations(), &pk);
142142
c
143143
})
144144
.collect();

0 commit comments

Comments
 (0)