Lattice-Based Proof Systems
February 18, 2025
This post was originally posted in mirror.xyz

This post was written by PSE researcher Miha Stopar.

Post-quantum cryptography (PQC) is important because it addresses the potential threat posed by quantum computers to classical cryptographic systems.

Quantum computers leverage the principles of quantum mechanics to perform calculations exponentially faster than classical computers in certain cases. Two algorithms, in particular, pose significant threats:

  • Shor’s Algorithm: Efficiently solves integer factorization and discrete logarithm problems, which are the basis of widely used cryptographic protocols like RSA, DSA, and Diffie-Hellman.
  • Grover’s Algorithm: Reduces the security of symmetric-key algorithms by effectively halving the key length (e.g., a 128-bit AES key would offer only 64 bits of security against Grover’s algorithm).

If large-scale, fault-tolerant quantum computers become practical, many of today’s encryption, digital signature, and key exchange protocols would be rendered insecure.

Lattice-based cryptography is a promising area within modern cryptography. It is likely the most versatile and performant subfield of PQC. For example, the folding scheme LatticeFold is believed to be as efficient as the fastest traditional elliptic curve-based folding schemes.

The competing non-lattice PQC zero-knowledge proof systems (Ligero, Aurora) base their security only on the security of unstructured hash functions, but they suffer from extremely high demands for computational resources.

In this post, we will discuss some of the challenges involved in constructing zero-knowledge proof systems based on lattices. For a more in-depth explanation, please refer to the video by Vadim Lyubashevsky.

Zero-knowledge proofs based on discrete logarithm

A zero-knowledge proof (ZKP) is a cryptographic protocol that allows one party (the prover) to convince another party (the verifier) that a specific statement is true without revealing any additional information beyond the fact that the statement is true.

Typically, the prover may also wish to demonstrate additional properties of these statements. For instance, suppose the prover wants to prove the knowledge of x1x_1 such that:

gx1=h1g^{x_1} = h_1

and the knowledge of x2x_2 such that

gx2=h2g^{x_2} = h_2

for some public values g,h1,h2g, h_1, h_2. Furthermore, the prover would like to prove

x1=ux2x_1 = u \cdot x_2

for some uu.

For the zero-knowledge proof of x1x_1 such that gx1=h1g^{x_1} = h_1, the Schnorr protocol can be employed (technically, it is an honest-verifier zero-knowledge proof, but we will set this detail aside):

  • The prover chooses y1y_1 and sends t1=gy1t_1 = g^{y_1} to the verifier.
  • The verifier chooses a challenge dd and sends it to the prover.
  • The prover sends z1=y1+x1dz_1 = y_1 + x_1 d to the verifier.
  • The verifier checks whether gz1=t1h1dg^{z_1} = t_1 h_1^d.

Now, the protocol can be easily extended to prove the knowledge of x2x_2 such that gx2=h2g^{x_2} = h_2. In this case, the prover would also send t2=gy2t_2 = g^{y_2} in the first step and z2=y2+x1dz_2 = y_2 + x_1 d in the third one. The verifier would then check whether gz2=t2h2dg^{z_2} = t_2 h_2^d.

Note that checking the additional property x1=ux2x_1 = u \cdot x_2 is straightforward:

h1=h2uh_1 = h_2^u

Also, for instance, if we had gx3=h3g^{x_3} = h_3, the linear relation x3=ax1+bx2x_3 = a \cdot x_1 + b \cdot x_2 is easy to check:

gz3=t3(h1ah2b)dg^{z_3} = t_3 \cdot (h_1^a h_2^b)^d

However, the Schnorr protocol is not quantum-safe, as it relies on the discrete logarithm problem, which can be broken by Shor's algorithm. Can we construct similar zero-knowledge proofs using lattices instead?

Zero-knowledge proofs based on lattices

The discrete logarithm problem is to find xx given gxg^x. There is a somewhat analogous problem in the lattice-based cryptography world: the Shortest Integer Solution (SIS) problem.

The system of linear equations

Ax=h  mod  qAx = h \; mod \; q

where AZqm×nA \in \mathbb{Z}^{m \times n}_q and hZqnh \in \mathbb{Z}^n_q can be solved in polynomial time with Gaussian elimination.

But variations of this problem can be hard. For example, when we require that the norm ofxx is smaller than some bound BB. Note that the bound needs to be smaller than qq; otherwise, (q,0,...,0)(q, 0, ..., 0) is a trivial solution.

The SIS problem SIS(m,n,q,B)SIS(m, n, q, B) is the problem of finding x=(x1,...,xn)x = (x_1, ..., x_n) such that     

Ax=0  mod  qAx = 0 \; mod \; q

and

xB||x|| \leq B

Can we do Schnorr-like ZKP for such xx?

Schnorr for lattices

Let's have x1x_1 such that

Ax1=h1  mod  qAx_1 = h_1 \; mod \; q

and

x1B||x_1|| \leq B

Would the following protocol work?

The last step of the protocol would be verifier checking whether Az1=Ay1+dAx1=t1+dh1A z_1 = A y_1 + d A x_1 = t_1 + d h_1.

However, this would not work. The problem is that z1z_1 might not be short, and if we don't require z1z_1 to be short, the prover could provide z1z_1 such that Az1=t1+dh1A z_1 = t_1 + dh_1 by using Gauss elimination!

So, z1z_1 needs to be small. To achieve this, dd needs to be small as well (note that z1=y1+x1dz_1 = y_1 + x_1 d), but on the other hand, we want the challenge space to be large—the larger it is, the better the soundness property. Note that if the prover can guess the challenge dd, the prover sets the first message to gy(gs)dg^y (g^s)^{-d} and the last one to z1=ysd+sd=yz_1 = y - s d + s d = y.

This is one of the reasons why the ring Zq[x]/(xn+1)\mathbb{Z}_q[x]/(x^n + 1) is used—it provides a larger set of elements with small norm this way (polynomials with small coefficients, as opposed to small integers).

In the last step, the verifier must verify whether z1z_1 is small as well.

However, that’s not the end of the problems with the lattice-based version of Schnorr.

Now, if this is a proof of knowledge of xx, we can extract the value xx from the prover. This is typically done by rewinding: we run the prover as a black box twice and obtain two transcripts: yy, d1d_1, z1=y+xd1z_1 = y + x d_1 and yy, d2d_2, z2=y+xd2z_2 = y + x d_2. We get:

z2z1=x(d2d1)z_2 - z_1 = x(d_2 - d_1)

In the Schnorr algorithm, one can simply compute

x=z2z1d2d1x = \frac{z_2 - z_1}{d_2 - d_1}

to obtain the secret xx such that gx=hg^x = h. Using lattices, we obtain xx (we can assume d2d1d_2 - d_1 is invertible) such that Ax=hAx = h. However, again, xx might not be small!

Thus, using lattices, one can only extract zˉ\bar{z} such that

Azˉ=dˉhA \bar{z} = \bar{d} h

where barz=z_2z_1\\bar{z} = z\_2 - z\_1 and dˉ=d2d1\bar{d} = d_2 - d_1.

Note that the value zˉ\bar{z} is still small (though not as small as xx), and given AA and hh, it is still hard to get such zˉ\bar{z} and dˉ\bar{d}.

In what follows, you will see how the extractor, which returns "only" zˉ\bar{z}, can still be utilized to construct lattice-based proof systems.

Lattice-based commitment scheme

One of the key steps in the development of lattice-based proof systems was the publication of the paper More Efficient Commitments from Structured Lattice Assumptions. The commitment scheme described in the paper proceeds as follows.

Key generation

The key generation returns A1Rqn×k\bf{A}_1 \in R_q^{n \times k} and A2Rql×k\bf{A}_2 \in R_q^{l \times k} as

A1=[InA1]\mathbf{A}_1 = [\mathbf{I}_n | \mathbf{A}_1']

A2=[0l×nIlA2]\mathbf{A}_2 = [\mathbf{0}^{l \times n} | \mathbf{I}_l | \mathbf{A}_2']

where A1\mathbf{A}_1' is random from Rqn×(kn)R_q^{n \times (k-n)} and A2\mathbf{A}_2' is random from Rqn×(knl)R_q^{n \times (k-n-l)}.

Commitment

To commit to xRql\mathbf{x} \in R_q^l, we choose a random polynomial vector r\mathbf{r} with a small norm and output the commitment

Com(x,r):=(c1c2)=(A1A2)r+(0nx)Com(\mathbf{x}, \mathbf{r}) := \begin{pmatrix} \mathbf{c}_1 \\ \mathbf{c}_2 \end{pmatrix} = \begin{pmatrix} \mathbf{A}_1 \\ \mathbf{A}_2 \end{pmatrix} \cdot \mathbf{r} + \begin{pmatrix} \mathbf{0}^n \\ \mathbf{x} \end{pmatrix}

Opening

A valid opening of a commitment

(c1c2)\begin{pmatrix} \mathbf{c}_1 \\ \mathbf{c}_2 \end{pmatrix}

is a 3-tuple consisting of xRql\mathbf{x} \in R_q^l, r=(r1 ... rk)Rqkr = \begin{pmatrix} \mathbf{r}_1 \ ... \ \mathbf{r}_k \end{pmatrix} \in R_q^k, and fCˉ.f \in \bar{C}.

The verifier checks that:

f(c1c2)=(A1A2)r+f(0nx)f \cdot \begin{pmatrix} \mathbf{c}_1 \\ \mathbf{c}_2 \end{pmatrix} = \begin{pmatrix} \mathbf{A}_1 \\ \mathbf{A}_2 \end{pmatrix} \cdot \mathbf{r} + f \cdot \begin{pmatrix} \mathbf{0}^n \\ \mathbf{x} \end{pmatrix}

Proof of opening

Note that the opening for this commitment schemes is not simply r\mathbf{r} and x\mathbf{x}; it also includes a polynomial fCˉ.f \in \bar{C}. This is due to the issue with the extractor described above.

The extractor needs to return the triple x,r,f\mathbf{x}, \mathbf{r}, f such that:

f(c1c2)=(A1A2)r+f(0nx)f \cdot \begin{pmatrix} \mathbf{c}_1 \\ \mathbf{c}_2 \end{pmatrix} = \begin{pmatrix} \mathbf{A}_1 \\ \mathbf{A}_2 \end{pmatrix} \cdot \mathbf{r} + f \cdot \begin{pmatrix} \mathbf{0}^n \\ \mathbf{x} \end{pmatrix}

Such a triple can be obtained through rewinding:

z2z1=(d2d1)r\mathbf{z}_2 - \mathbf{z}_1 = (d_2 - d_1) \mathbf{r}

Then we have:

A1(z2z1)=(d2d1)A1r=(d2d1)c1\mathbf{A}_1 (\mathbf{z}_2 - \mathbf{z}_1) = (d_2 - d_1) \mathbf{A}_1 \mathbf{r} = (d_2 - d_1) \mathbf{c}_1

A1zˉ=fc1\mathbf{A}_1 \bar{\mathbf{z}} = f \mathbf{c}_1

where zˉ=z2z1\bar{\mathbf{z}} = \mathbf{z}_2 - \mathbf{z}_1 and f=d2d1f = d_2 - d_1.

Thus, instead of having A1r=c1\mathbf{A}_1 \mathbf{r} = \mathbf{c}_1, we have A1zˉ=fc1\mathbf{A}_1 \bar{\mathbf{z}} = f \mathbf{c}_1.

We extract the message xf\mathbf{x}_f as:

xf=c2f1A2r\mathbf{x}_f = \mathbf{c}_2 −f^{-1} ·\mathbf{A}_2 ·r

The extracted triple is xf,zˉ,f\mathbf{x}_f, \mathbf{\bar{z}}, f. It can be easily seen (zˉ=fr\mathbf{\bar{z}} = f \mathbf{r}):

f(c1c2)=(A1A2)zˉ+f(0nxf)f \cdot \begin{pmatrix} \mathbf{c}_1 \\ \mathbf{c}_2 \end{pmatrix} = \begin{pmatrix} \mathbf{A}_1 \\ \mathbf{A}_2 \end{pmatrix} \cdot \mathbf{\bar{z}} + f \cdot \begin{pmatrix} \mathbf{0}^n \\ \mathbf{x}_f \end{pmatrix}

Conclusion

Since the commitment scheme described above, there have been many new improvements in the field of lattice-based zero-knowledge proofs. So expect some new material describing lattice-based and other post-quantum cryptographic schemes soon :). At PSE, we are committed to staying at the forefront of this rapidly evolving field by continuously following and testing the latest advancements in post-quantum cryptography. Our goal is to ensure that we are well-prepared for the challenges and opportunities that come with the transition to quantum-safe systems.