Module 09: Capstone — Designing a Full Lattice Proof System

In Modules 01–08, we built every gear in the machine. Now let's assemble the entire machine from scratch, pick real concrete parameters, and check all the subtle failure modes that can silently break a lattice proof system.


1. End-to-End Architecture: A Complete Post-Quantum Plonk / R1CS SNARK

Suppose you want to build a transparent, post-quantum, succinct ZK-SNARK for N=220N = 2^{20} arithmetic gates over Fq\mathbb{F}_q.

Here is a clean, modern blueprint (combining Plonk/CCS arithmetization + Gadget-decomposed Ajtai/BDLOP commitments + Sumcheck/LaBRADOR folding + JL norm checks + Fiat-Shamir with aborts):

Layer 1: Ring & Modulus Setup

  • Cyclotomic ring: R=Z[X]/(Xd+1)R = \mathbb{Z}[X]/(X^d + 1) with d=64d = 64.
    • Why d=64d = 64? Small enough that d=8\sqrt{d} = 8 keeps norm expansion tiny, yet big enough for fast NTTs and compact vectors.
  • Modulus qq: Choose a 32-bit or 64-bit prime, e.g. q≈232q \approx 2^{32} with q≡5(mod8)q \equiv 5 \pmod 8 (so X64+1X^{64} + 1 splits into k=2k = 2 irreducible factors of degree 3232: Rq≅Fq322R_q \cong \mathbb{F}_{q^{32}}^2).
    • Why k=2k = 2? Every slot is a 1024-bit field (Fq32\mathbb{F}_{q^{32}}), giving <2−1000< 2^{-1000} Schwartz-Zippel error for single-challenge checks, AND Lyubashevsky–Seiler guarantees every nonzero difference c1−c2c_1 - c_2 with ∥c1−c2∥∞<q1/2/2≈46,340\|c_1 - c_2\|_\infty < q^{1/2}/\sqrt{2} \approx 46{,}340 is invertible in RqR_q!
    • (Alternative if you want Plonk natively over Fq\mathbb{F}_q with q≈264q \approx 2^{64}: pick q≡1+2d/k(mod4d/k)q \equiv 1 + 2d/k \pmod{4d/k} with k=4k = 4 or k=1k = 1, or embed Fp\mathbb{F}_p wires into coefficients of RqR_q as in Neo.)

Layer 2: Arithmetization & Witness Decomposition

  • Represent your NN gate wires as a vector w∈ZqN\mathbf{w} \in \mathbb{Z}_q^N.
  • Base-bb decomposition: Choose b=16b = 16 (balanced digits in [−8,8][-8, 8]), so t=⌈log⁡16q⌉=8t = \lceil \log_{16} q \rceil = 8 digits per Fq\mathbb{F}_q element.
  • Pack the digits into M=(N⋅t)/dM = (N \cdot t) / d polynomials in RR (here N=220  ⟹  M=217N = 2^{20} \implies M = 2^{17} ring elements, each with ∥⋅∥∞≤8\|\cdot\|_\infty \le 8).
  • Reshape into r=256r = 256 chunks s1,…,sr∈Rn\mathbf{s}_1, \dots, \mathbf{s}_r \in R^n where n=M/r=512n = M / r = 512!
    • Notice: each chunk si\mathbf{s}_i has Euclidean norm ∥si∥2≤512⋅64⋅8≈1448\|\mathbf{s}_i\|_2 \le \sqrt{512 \cdot 64} \cdot 8 \approx 1448.
  • Plonk / R1CS gates become quadratic + linear equations over the digits (plus gadget relations w=∑bjdjw = \sum b^j d_j and range checks if needed), all expressed in LaBRADOR's Principal Relation!

Layer 3: Commitments (Ajtai / ABDLOP + Zero-Knowledge Masking)

  • Want Zero-Knowledge? Add a random short blinding vector s0←χn\mathbf{s}_0 \leftarrow \chi^n (masked via M-LWE/BDLOP) so linear combinations revealed during folding or JL projections are masked!
  • Inner Commitments: ti=Asi mod q∈Rqκ\mathbf{t}_i = A \mathbf{s}_i \bmod q \in R_q^\kappa (i=1,…,ri = 1, \dots, r).
  • Outer Commitment ("Commit to the Commitments"): Decompose (t1,…,tr)(\mathbf{t}_1, \dots, \mathbf{t}_r) via G−1G^{-1} and commit with u1=B⋅G−1(t1,…,tr)∈Rqκ\mathbf{u}_1 = B \cdot G^{-1}(\mathbf{t}_1, \dots, \mathbf{t}_r) \in R_q^\kappa. Send ONLY u1\mathbf{u}_1 to the verifier (size: κ\kappa ring elements ≈2\approx 2 KB)!

Layer 4: Constraint Batching, JL Norm Proof, and Folding Recursion

For each recursive round (reducing rr vectors of length nn down until r⋅nr \cdot n is small):

  1. Quadratic Batching (Fiat-Shamir): Hash transcript to derive random batching weights αk∈Rq\alpha_k \in R_q (large, for Schwartz-Zippel in Fq322\mathbb{F}_{q^{32}}^2!). Collapse all quadratic constraints into one aggregate inner-product relation.
  2. JL Norm Projection (Fiat-Shamir): Derive Πi←{−1,0,1}256×nd\Pi_i \leftarrow \{-1, 0, 1\}^{256 \times nd}. Compute p=∑Πisi\mathbf{p} = \sum \Pi_i \mathbf{s}_i (masked by Π0s0\Pi_0 \mathbf{s}_0 + Gaussian noise y3\mathbf{y}_3 with rejection sampling if ZK!). Verifier checks ∥p∥2≤Bp\|\mathbf{p}\|_2 \le B_p. Checking p=∑Πisi\mathbf{p} = \sum \Pi_i \mathbf{s}_i becomes 256 linear constraints folded into Step 1!
  3. Cross-Term Commitment: Compute cross-terms gi,j=⟨si,sj⟩g_{i,j} = \langle \mathbf{s}_i, \mathbf{s}_j \rangle (and linear terms hi=⟨φi,si⟩h_i = \langle \boldsymbol{\varphi}_i, \mathbf{s}_i \rangle). Commit to G−1(gi,j,hi)G^{-1}(g_{i,j}, h_i) in u2∈Rqκ\mathbf{u}_2 \in R_q^\kappa.
  4. Folding: Derive short challenges c1,…,cr∈Cc_1, \dots, c_r \in \mathcal{C} (e.g. ternary {−1,0,1}\{-1, 0, 1\} with weight 16, ∥c∥op≤8\|c\|_{\text{op}} \le 8). Compute folded witness: z=∑i=1rcisi∈Rn.\mathbf{z} = \sum_{i=1}^r c_i \mathbf{s}_i \in R^n.
  5. Norm Reset & Recurse: Form the new smaller witness s′=(z,  G−1(t),  G−1(g,h))\mathbf{s}' = \big(\mathbf{z}, \; G^{-1}(\mathbf{t}), \; G^{-1}(g, h)\big), reshape into r′r' vectors of length n′n', and repeat! (In practice, after 3–5 rounds, the witness shrinks from 2202^{20} gates down to ∼500\sim 500 ring elements, which are sent in the clear at the final round with a norm check ∥zfinal∥2≤Bfinal\|\mathbf{z}_{\text{final}}\|_2 \le B_{\text{final}}!)

Layer 5: Fiat-Shamir with Aborts

If any ZK rejection-sampling check fails (either on JL mask p\mathbf{p} or final masked response zfinal\mathbf{z}_{\text{final}}), rewind to the start of the corresponding round, sample fresh masking randomness, and retry!


2. How Parameters Are Actually Chosen (Security Estimation)

How do cryptographers pick (κ,d,q,βSIS,σLWE)(\kappa, d, q, \beta_{\text{SIS}}, \sigma_{\text{LWE}}) for 128-bit post-quantum security?

2.1 M-SIS Hardness: The Root Hermite Factor δ0\delta_0

Suppose an attacker tries to solve M-SISκ,m,q,βSIS\text{M-SIS}_{\kappa, m, q, \beta_{\text{SIS}}} by running the BKZ lattice reduction algorithm (with blocksize bBKZb_{\text{BKZ}}) on Λq⊥(A)\Lambda_q^\perp(A).

  • Recall from Module 01: Λq⊥(A)\Lambda_q^\perp(A) has rank M=m⋅dM = m \cdot d and determinant qκdq^{\kappa d}.
  • Actually, the attacker doesn't even have to use all mm columns of AA! They can drop columns and choose an optimal sub-dimension m′≤mm' \le m to balance two competing forces:
    • Smaller m′m'   ⟹  \implies easier BKZ, but larger Minkowski bound qκ/m′q^{\kappa / m'}.
    • Larger m′m'   ⟹  \implies smaller qκ/m′q^{\kappa / m'}, but higher lattice dimension!
  • What is the shortest nonzero vector BKZ produces in dimension D=m′dD = m' d? Empirically (Gama–Nguyen, Chen–Nguyen), BKZ with root Hermite factor δ0\delta_0 finds a vector of ℓ2\ell_2-norm: ∥v∥2≈δ0D⋅det⁡(L)1/D=δ0m′d⋅qκ/m′.\|\mathbf{v}\|_2 \approx \delta_0^{D} \cdot \det(\mathcal{L})^{1/D} = \delta_0^{m' d} \cdot q^{\kappa / m'}.
  • Differentiating with respect to m′dm' d to minimize ∥v∥2\|\mathbf{v}\|_2 gives the classic optimal attacker sub-dimension: Dopt=κdln⁡qln⁡δ0,min⁡∥v∥2≈exp⁡(2κdln⁡qln⁡δ0)!D_{\text{opt}} = \sqrt{\frac{\kappa d \ln q}{\ln \delta_0}}, \qquad \min \|\mathbf{v}\|_2 \approx \exp\left(2 \sqrt{\kappa d \ln q \ln \delta_0}\right)!

Check the Rule of Thumb for 128-bit PQ Security:

  • Core-SVP cost of BKZ with blocksize bBKZb_{\text{BKZ}}:
    • Classical sieving: ≈20.292⋅bBKZ\approx 2^{0.292 \cdot b_{\text{BKZ}}}.
    • Quantum sieving: ≈20.265⋅bBKZ\approx 2^{0.265 \cdot b_{\text{BKZ}}} (so 128-bit PQ security needs bBKZ≥483b_{\text{BKZ}} \ge 483, or conservatively bBKZ≈450b_{\text{BKZ}} \approx 450–500500).
  • At bBKZ≈480b_{\text{BKZ}} \approx 480, the root Hermite factor is: δ0≈(bBKZ2πe(πbBKZ)1/bBKZ)12(bBKZ−1)≈1.0040.\delta_0 \approx \left( \frac{b_{\text{BKZ}}}{2\pi e} (\pi b_{\text{BKZ}})^{1/b_{\text{BKZ}}} \right)^{\frac{1}{2(b_{\text{BKZ}} - 1)}} \approx 1.0040.
  • Plug that into our bound! We need the extracted SIS norm βSIS\beta_{\text{SIS}} to be strictly smaller than BKZ's best vector: βSIS<exp⁡(2κdln⁡qln⁡(1.0040)).\beta_{\text{SIS}} < \exp\left(2 \sqrt{\kappa d \ln q \ln(1.0040)}\right).

Let's plug in real numbers! Say d=64d = 64, q=232q = 2^{32} (ln⁡q≈22.18\ln q \approx 22.18), δ0=1.0040\delta_0 = 1.0040 (ln⁡δ0≈0.00399\ln \delta_0 \approx 0.00399):

  • Try κ=8\kappa = 8 (underlying lattice rank κd=512\kappa d = 512): 2512×22.18×0.00399=245.3≈13.46  ⟹  e13.46≈701,000≈219.4.2\sqrt{512 \times 22.18 \times 0.00399} = 2\sqrt{45.3} \approx 13.46 \implies e^{13.46} \approx 701{,}000 \approx 2^{19.4}. So if your extracted slack norm βSIS\beta_{\text{SIS}} is around 2182^{18} (e.g., 250,000250{,}000), κ=8\kappa = 8 is insecure (too close)!
  • Bump κ=14\kappa = 14 (κd=896\kappa d = 896): 2896×22.18×0.00399≈17.81  ⟹  e17.81≈5.4×107≈225.7!2\sqrt{896 \times 22.18 \times 0.00399} \approx 17.81 \implies e^{17.81} \approx 5.4 \times 10^7 \approx 2^{25.7}! Now ANY extracted SIS vector with norm βSIS≤224\beta_{\text{SIS}} \le 2^{24} is solidly 128-bit post-quantum secure! And how big is a single commitment t∈Rqκ\mathbf{t} \in R_q^\kappa? 14×64×4 bytes=3,584 bytes≈3.5 KB14 \times 64 \times 4 \text{ bytes} = 3{,}584 \text{ bytes} \approx 3.5 \text{ KB}! (Notice that if βSIS\beta_{\text{SIS}} is smaller, say 2162^{16}, you only need κ≈7\kappa \approx 7–99, i.e. ≈2\approx 2 KB!)

2.2 M-LWE Hardness: The Hiding Rank λ\lambda

For M-LWE (hiding in BDLOP), the standard "primal uSVP" / "dual" BKZ attacks depend on the ratio q/σLWEq / \sigma_{\text{LWE}} and the secret dimension λd\lambda d:

  • With q≈232q \approx 2^{32} and ternary secrets/errors χ∈{−1,0,1}\chi \in \{-1, 0, 1\}, you typically need λd≈800\lambda d \approx 800–10241024 (so λ≈12\lambda \approx 12–1616 for d=64d = 64) for 128-bit PQ security!
  • Remember: λ\lambda only affects the prover's randomness length, NOT the commitment size κ\kappa or proof size (in recursive folding)!

3. Seven Classic Pitfalls That Break Lattice Proof Systems

If you ever design or audit a lattice proof system, check these seven traps first:

  1. Forgetting the Norm Check on Verification: Checking Az≡w+ct(modq)A\mathbf{z} \equiv \mathbf{w} + c\mathbf{t} \pmod q without checking ∥z∥2≤Bz\|\mathbf{z}\|_2 \le B_z lets anyone forge proofs using Gaussian elimination!
  2. Wrapping Around Modulo qq: Proving an integer inequality via (modq)\pmod q equations (e.g., JL check or 4-squares) ONLY implies the integer bound if you also prove a coarse fallback bound ensuring terms stay in (−q/2,q/2)(-q/2, q/2)!
  3. Non-Invertible Differences in C\mathcal{C}: If RqR_q splits completely (q≡1(mod2d)q \equiv 1 \pmod{2d}) and your challenge space C\mathcal{C} allows c1−c2c_1 - c_2 to have a zero NTT slot, special soundness fails (or extraction probability drops by 1/q1/q!).
  4. Underestimating Extraction Slack across Recursive Rounds: In kk-round extraction, if each rewinding step multiplies the extracted norm by 2∥c∥op2\|c\|_{\text{op}}, the extractor extracts a vector of norm (2∥c∥op)kBfinal(2\|c\|_{\text{op}})^k B_{\text{final}}. You MUST verify that (2∥c∥op)kBfinal<βSIS(2\|c\|_{\text{op}})^k B_{\text{final}} < \beta_{\text{SIS}}, OR use round-by-round norm checking (JL!) so the extracted witness at every round is freshly bounded!
  5. Uniform vs. Discrete Gaussian Rejection Mistake: Using a fixed MM without bounding ∥cs∥2≤T\|c\mathbf{s}\|_2 \le T honestly—or forgetting to abort BEFORE sending w\mathbf{w} in Fiat-Shamir—leaks the secret witness!
  6. Non-Uniform Fiat-Shamir Transcript: Forgetting to hash public parameters, statement, AND all intermediate commitments (u1,u2,p,… )(\mathbf{u}_1, \mathbf{u}_2, \mathbf{p}, \dots) into the challenge cc lets a prover grind challenges or adaptively change the statement.
  7. Confusing Coefficient Multiplication with Slot Multiplication: Writing x(x−1)≡0(modq)x(x - 1) \equiv 0 \pmod q in RqR_q checks bitness of NTT slots, NOT of polynomial coefficients! Always be crystal clear about which embedding your witness lives in!

4. Where to Go Next (Reading Map of Landmark Papers)

Now that you have the entire conceptual toolkit, you can read the actual primary literature without getting lost in notation:

  1. Lyubashevsky (2012): Lattice Signatures without Trapdoors — The origin of Fiat-Shamir with Aborts & discrete Gaussian rejection sampling.
  2. BDLOP (Baum et al., SCN 2018): More Efficient Commitments from Structured Lattice Assumptions — The BDLOP commitment scheme.
  3. LNP22 (Lyubashevsky, Nguyen, Plançon, CRYPTO 2022): Lattice-Based Zero-Knowledge Proofs and Applications: Shorter, Simpler, and More General — Quadratic BDLOP + automorphisms + JL norm proofs.
  4. LaBRADOR (Beullens & Seiler, CRYPTO 2023): LaBRADOR: Compact Proofs for R1CS from Module-SIS — Recursive Principal Relation folding + commitment-to-commitments.
  5. Greyhound (Nguyen & Seiler, CRYPTO 2024): Greyhound: Fast Polynomial Commitments from Lattices — Square-root matrix PCS + LaBRADOR opening.
  6. LatticeFold (Boneh & Chen, 2024) & LatticeFold+ / Neo (2025): LatticeFold: A Lattice-based Folding Scheme and its Applications to Succinct Proof Systems — Decomposition-before-folding IVC + Sumcheck over rings/small fields.

Exercises

  1. Security Estimation Practice: Using the BKZ formula min⁡∥v∥2≈exp⁡(2κdln⁡qln⁡δ0)\min \|\mathbf{v}\|_2 \approx \exp(2\sqrt{\kappa d \ln q \ln \delta_0}) with d=64d = 64, q=232q = 2^{32}, and δ0=1.0040\delta_0 = 1.0040: If your protocol has an extracted M-SIS norm bound βSIS=222\beta_{\text{SIS}} = 2^{22}, is κ=10\kappa = 10 enough? What about κ=12\kappa = 12?
  2. Slack Budget Check: Suppose a 1-round Sigma protocol has honest randomness ∥r∥2≤100\|\mathbf{r}\|_2 \le 100, challenge operator norm ∥c∥op≤8\|c\|_{\text{op}} \le 8, Gaussian σ=11⋅(8⋅100)=8800\sigma = 11 \cdot (8 \cdot 100) = 8800, and vector dimension N=1024N = 1024 (so accepted ∥z∥2≈σN=8800⋅32≈2.8×105\|\mathbf{z}\|_2 \approx \sigma\sqrt{N} = 8800 \cdot 32 \approx 2.8 \times 10^5). In BDLOP binding with relaxed extraction, we get zˉ=z1−z2\bar{\mathbf{z}} = \mathbf{z}_1 - \mathbf{z}_2 (norm ≤2Bz\le 2 B_z) and cross-multiplying two relaxed openings multiplies by cˉ=c1−c2\bar{c} = c_1 - c_2 (operator norm ≤16\le 16). Compute the resulting βSIS\beta_{\text{SIS}} bound required for binding!
  3. Spot the Bug: A developer implements a binary check on coefficients b0,…,bd−1b_0, \dots, b_{d-1} of b(X)∈Rqb(X) \in R_q by proving b(X)2−b(X)≡0(modq)b(X)^2 - b(X) \equiv 0 \pmod q via Module 06's quadratic trick, with q≡1(mod2d)q \equiv 1 \pmod{2d}. Give an explicit polynomial b(X)b(X) with non-binary coefficients (not in {0,1}\{0, 1\}!) that passes b(X)2−b(X)≡0(modq)b(X)^2 - b(X) \equiv 0 \pmod q!

(Solutions in exercise-solutions.md.)

results matching ""

    No results matching ""