This week, Liam Eagen (Blockstream Research) and Ariel Gabizon (Zeta Function Technologies) present cqlin - Efficient linear operations on KZG commitments with cached quotients.
Given two KZG-committed polynomials , a matrix , and subgroup of order , we present a protocol for checking that . After preprocessing, the prover makes field and group operations. This presents a significant improvement over the lincheck protocols in [CHMMVW, COS], where the prover's run-time (also after preprocessing) was quasilinear in the number of non-zeroes of M, which could be n^2.
zkStudyClub - cqlin: Efficient linear operations on KZG commitments
1. cqlin
New Applications for Universal, Pairing Based SNARKs
with Preprocessing
Liam Eagen
Blockstream Research
June 2, 2023
Liam Eagen (Blockstream Research) cqlin June 2, 2023 1 / 17
3. Motivation
Lin-check problem is ubiquitous in SNARKs
Many approaches linear in sparsity (number of non-zero entries) of
matrix
Liam Eagen (Blockstream Research) cqlin June 2, 2023 2 / 17
4. Motivation
Lin-check problem is ubiquitous in SNARKs
Many approaches linear in sparsity (number of non-zero entries) of
matrix
This is O(n2) for dense matrices
Liam Eagen (Blockstream Research) cqlin June 2, 2023 2 / 17
5. Motivation
Lin-check problem is ubiquitous in SNARKs
Many approaches linear in sparsity (number of non-zero entries) of
matrix
This is O(n2) for dense matrices
Dense matrix multiplication useful in zkML
Liam Eagen (Blockstream Research) cqlin June 2, 2023 2 / 17
6. Motivation
Lin-check problem is ubiquitous in SNARKs
Many approaches linear in sparsity (number of non-zero entries) of
matrix
This is O(n2) for dense matrices
Dense matrix multiplication useful in zkML
Prior work [GKMMM] implies O(n) lin-check protocol
▶ Special SRS depends on the size of the matrix
▶ Has O(n3
) setup time
Liam Eagen (Blockstream Research) cqlin June 2, 2023 2 / 17
8. Why Pairings and Preprocessing?
Ariel’s SNARK trilogy (zkSummit 9/Zero Knowledge Podcast ep.
274)
1 Pairings get succinctness without PCP, need per-circuit trusted setup
Liam Eagen (Blockstream Research) cqlin June 2, 2023 3 / 17
9. Why Pairings and Preprocessing?
Ariel’s SNARK trilogy (zkSummit 9/Zero Knowledge Podcast ep.
274)
1 Pairings get succinctness without PCP, need per-circuit trusted setup
2 Polynomial commitment schemes abstract pairing, universal trusted
setup
Liam Eagen (Blockstream Research) cqlin June 2, 2023 3 / 17
10. Why Pairings and Preprocessing?
Ariel’s SNARK trilogy (zkSummit 9/Zero Knowledge Podcast ep.
274)
1 Pairings get succinctness without PCP, need per-circuit trusted setup
2 Polynomial commitment schemes abstract pairing, universal trusted
setup
3 Pairing with preprocessing breaks PCS abstraction for more power in
particular applications, e.g. lookup arguments
Liam Eagen (Blockstream Research) cqlin June 2, 2023 3 / 17
11. Why Pairings and Preprocessing?
Ariel’s SNARK trilogy (zkSummit 9/Zero Knowledge Podcast ep.
274)
1 Pairings get succinctness without PCP, need per-circuit trusted setup
2 Polynomial commitment schemes abstract pairing, universal trusted
setup
3 Pairing with preprocessing breaks PCS abstraction for more power in
particular applications, e.g. lookup arguments
What other applications benefit from pairings and preprocessing?
Liam Eagen (Blockstream Research) cqlin June 2, 2023 3 / 17
12. Why Pairings and Preprocessing?
Ariel’s SNARK trilogy (zkSummit 9/Zero Knowledge Podcast ep.
274)
1 Pairings get succinctness without PCP, need per-circuit trusted setup
2 Polynomial commitment schemes abstract pairing, universal trusted
setup
3 Pairing with preprocessing breaks PCS abstraction for more power in
particular applications, e.g. lookup arguments
What other applications benefit from pairings and preprocessing?
cqlin!
Liam Eagen (Blockstream Research) cqlin June 2, 2023 3 / 17
14. Preliminaries
Fix a pairing friendly curve
Commit to polynomials using KZG, write [F(x)] for commitment to
polynomial F(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 4 / 17
15. Preliminaries
Fix a pairing friendly curve
Commit to polynomials using KZG, write [F(x)] for commitment to
polynomial F(X)
Prove F(a) = b by proving Q(X) = (F(X) − b)/(X − a) is a
polynomial
Liam Eagen (Blockstream Research) cqlin June 2, 2023 4 / 17
16. Preliminaries
Fix a pairing friendly curve
Commit to polynomials using KZG, write [F(x)] for commitment to
polynomial F(X)
Prove F(a) = b by proving Q(X) = (F(X) − b)/(X − a) is a
polynomial
More generally for Z(X) =
Q
i (X − ai ), F(ai ) = G(ai ) iff
F(X) = G(X) mod Z(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 4 / 17
17. Preliminaries
Fix a pairing friendly curve
Commit to polynomials using KZG, write [F(x)] for commitment to
polynomial F(X)
Prove F(a) = b by proving Q(X) = (F(X) − b)/(X − a) is a
polynomial
More generally for Z(X) =
Q
i (X − ai ), F(ai ) = G(ai ) iff
F(X) = G(X) mod Z(X)
Equivalently, if there exists a polynomial
Q(X) = (F(X) − G(X))/Z(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 4 / 17
18. Preliminaries
Let ω be a root of unity or order N
Liam Eagen (Blockstream Research) cqlin June 2, 2023 5 / 17
19. Preliminaries
Let ω be a root of unity or order N
Lagrange polynomials Li (ωj ) = δi,j
Liam Eagen (Blockstream Research) cqlin June 2, 2023 5 / 17
20. Preliminaries
Let ω be a root of unity or order N
Lagrange polynomials Li (ωj ) = δi,j
Encode vector ⃗
v ∈ FN as F(ωi ) = vi
Liam Eagen (Blockstream Research) cqlin June 2, 2023 5 / 17
21. Preliminaries
Let ω be a root of unity or order N
Lagrange polynomials Li (ωj ) = δi,j
Encode vector ⃗
v ∈ FN as F(ωi ) = vi
Equivalently F(X) =
P
i∈[n] vi Li (X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 5 / 17
22. Preliminaries
Let ω be a root of unity or order N
Lagrange polynomials Li (ωj ) = δi,j
Encode vector ⃗
v ∈ FN as F(ωi ) = vi
Equivalently F(X) =
P
i∈[n] vi Li (X)
If deg F(X) < N, then F(0) =
P
i∈[N] F(ωi ) [Aurora]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 5 / 17
23. Sparse Commitments
What is a Sparse Commitment?
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
24. Sparse Commitments
What is a Sparse Commitment?
Let P(X) be a degree d polynomial
In general, committing to [P(x)] requires d scalar multiplications
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
25. Sparse Commitments
What is a Sparse Commitment?
Let P(X) be a degree d polynomial
In general, committing to [P(x)] requires d scalar multiplications
Sometimes, P(X) is sparse with respect to some basis Bi (X) of
n ≤ d polynomials
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
26. Sparse Commitments
What is a Sparse Commitment?
Let P(X) be a degree d polynomial
In general, committing to [P(x)] requires d scalar multiplications
Sometimes, P(X) is sparse with respect to some basis Bi (X) of
n ≤ d polynomials
That is P(X) =
P
i∈[n] fi Bi (X) where at most k values of fi are
non-zero and k << d
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
27. Sparse Commitments
What is a Sparse Commitment?
Let P(X) be a degree d polynomial
In general, committing to [P(x)] requires d scalar multiplications
Sometimes, P(X) is sparse with respect to some basis Bi (X) of
n ≤ d polynomials
That is P(X) =
P
i∈[n] fi Bi (X) where at most k values of fi are
non-zero and k << d
When P(X) is k, Bi (X) sparse, we can compute a commitment to
P(X) in O(k) time given precomputed commitments to Bi (X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
28. Sparse Commitments
What is a Sparse Commitment?
Let P(X) be a degree d polynomial
In general, committing to [P(x)] requires d scalar multiplications
Sometimes, P(X) is sparse with respect to some basis Bi (X) of
n ≤ d polynomials
That is P(X) =
P
i∈[n] fi Bi (X) where at most k values of fi are
non-zero and k << d
When P(X) is k, Bi (X) sparse, we can compute a commitment to
P(X) in O(k) time given precomputed commitments to Bi (X)
P(X) =
P
i∈[n] ki [Bi (x)]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
29. Sparse Commitments
What is a Sparse Commitment?
Let P(X) be a degree d polynomial
In general, committing to [P(x)] requires d scalar multiplications
Sometimes, P(X) is sparse with respect to some basis Bi (X) of
n ≤ d polynomials
That is P(X) =
P
i∈[n] fi Bi (X) where at most k values of fi are
non-zero and k << d
When P(X) is k, Bi (X) sparse, we can compute a commitment to
P(X) in O(k) time given precomputed commitments to Bi (X)
P(X) =
P
i∈[n] ki [Bi (x)]
Sparsity is linear: if P(X) is Bi (X) sparse, then P(X)F(X) is
Bi (X)F(X) sparse
Liam Eagen (Blockstream Research) cqlin June 2, 2023 6 / 17
30. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
31. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
32. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
33. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
2 Precompute Di = [xN−d
Bi (x)]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
34. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
2 Precompute Di = [xN−d
Bi (x)]
3 Prover can compute D =
P
i∈[n] fi Di in O(k) time
4 Verifier checks e([P(x)], [xN−d
]) = e(D, [1])
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
35. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
2 Precompute Di = [xN−d
Bi (x)]
3 Prover can compute D =
P
i∈[n] fi Di in O(k) time
4 Verifier checks e([P(x)], [xN−d
]) = e(D, [1])
2 Opening at fixed value
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
36. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
2 Precompute Di = [xN−d
Bi (x)]
3 Prover can compute D =
P
i∈[n] fi Di in O(k) time
4 Verifier checks e([P(x)], [xN−d
]) = e(D, [1])
2 Opening at fixed value
1 Suppose prover wants to open P(0) = c, for example as part of
sum-check
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
37. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
2 Precompute Di = [xN−d
Bi (x)]
3 Prover can compute D =
P
i∈[n] fi Di in O(k) time
4 Verifier checks e([P(x)], [xN−d
]) = e(D, [1])
2 Opening at fixed value
1 Suppose prover wants to open P(0) = c, for example as part of
sum-check
2 Precompute Zi = [Bi (x) − Bi (0)/x]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
38. Sparse Commitments: Simple Examples
Assume P(X) is Bi (X) sparse
1 Degree Checks
1 Suppose want to show deg P(X) = d, but SRS has degree N
2 Precompute Di = [xN−d
Bi (x)]
3 Prover can compute D =
P
i∈[n] fi Di in O(k) time
4 Verifier checks e([P(x)], [xN−d
]) = e(D, [1])
2 Opening at fixed value
1 Suppose prover wants to open P(0) = c, for example as part of
sum-check
2 Precompute Zi = [Bi (x) − Bi (0)/x]
3 Prover can compute Z =
P
i∈[n] fi Zi in O(k) time
4 Verifier checks e([P(x)] − c[1], [1]) = e(Z, [x])
Liam Eagen (Blockstream Research) cqlin June 2, 2023 7 / 17
39. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
40. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
41. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Let A(X) be n Lagrange sparse and B(X) and Q(X) satisfy
T(X)A(X) = B(X) + (XN − 1)Q(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
42. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Let A(X) be n Lagrange sparse and B(X) and Q(X) satisfy
T(X)A(X) = B(X) + (XN − 1)Q(X)
T(ωi )A(ωi ) = B(ωi ), so B(X) is also n Lagrange sparse
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
43. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Let A(X) be n Lagrange sparse and B(X) and Q(X) satisfy
T(X)A(X) = B(X) + (XN − 1)Q(X)
T(ωi )A(ωi ) = B(ωi ), so B(X) is also n Lagrange sparse
Q(X) is n sparse wrt to the basis Qi (X) such that
T(X)Li (X) = ti Li (X) + (XN − 1)Qi (X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
44. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Let A(X) be n Lagrange sparse and B(X) and Q(X) satisfy
T(X)A(X) = B(X) + (XN − 1)Q(X)
T(ωi )A(ωi ) = B(ωi ), so B(X) is also n Lagrange sparse
Q(X) is n sparse wrt to the basis Qi (X) such that
T(X)Li (X) = ti Li (X) + (XN − 1)Qi (X)
Can compute all [Qi (x)] in O(N log N) time using FK technique
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
45. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Let A(X) be n Lagrange sparse and B(X) and Q(X) satisfy
T(X)A(X) = B(X) + (XN − 1)Q(X)
T(ωi )A(ωi ) = B(ωi ), so B(X) is also n Lagrange sparse
Q(X) is n sparse wrt to the basis Qi (X) such that
T(X)Li (X) = ti Li (X) + (XN − 1)Qi (X)
Can compute all [Qi (x)] in O(N log N) time using FK technique
Can commit to [A(x)], [B(x)], and [Q(x)] in O(n) scalar
multiplications
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
46. Sparse Commitments: cq and Lookup Arguments
Sparse commitments are a key part of lookup arguments [Caulk,etc.]
especially cq
Given T(X) encoding a table ⃗
t ∈ FN, want to prove T(ωi ) = v for
some i
Let A(X) be n Lagrange sparse and B(X) and Q(X) satisfy
T(X)A(X) = B(X) + (XN − 1)Q(X)
T(ωi )A(ωi ) = B(ωi ), so B(X) is also n Lagrange sparse
Q(X) is n sparse wrt to the basis Qi (X) such that
T(X)Li (X) = ti Li (X) + (XN − 1)Qi (X)
Can compute all [Qi (x)] in O(N log N) time using FK technique
Can commit to [A(x)], [B(x)], and [Q(x)] in O(n) scalar
multiplications
cq defines A(X) and B(X) to encode log derivative lookup [BP++,
MVLookup]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 8 / 17
47. Lin-Check
Fix n × n matrix M
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
48. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
49. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
50. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
51. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
1 State M⃗
a = ⃗
b in terms of (bivariate) polynomials
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
52. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
1 State M⃗
a = ⃗
b in terms of (bivariate) polynomials
2 Use a pairing to perform M⃗
a as polynomial multiplication
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
53. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
1 State M⃗
a = ⃗
b in terms of (bivariate) polynomials
2 Use a pairing to perform M⃗
a as polynomial multiplication
3 Exploit the fact M is fixed and precompute quotients
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
54. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
1 State M⃗
a = ⃗
b in terms of (bivariate) polynomials
2 Use a pairing to perform M⃗
a as polynomial multiplication
3 Exploit the fact M is fixed and precompute quotients
4 Find a sparse basis for all commitments
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
55. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
1 State M⃗
a = ⃗
b in terms of (bivariate) polynomials
2 Use a pairing to perform M⃗
a as polynomial multiplication
3 Exploit the fact M is fixed and precompute quotients
4 Find a sparse basis for all commitments
5 Commit to everything in O(n) group scalar multiplications
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
56. Lin-Check
Fix n × n matrix M
Given commitments to vectors ⃗
a and ⃗
b show M⃗
a = ⃗
b
Goal: do this in O(n) group and scalar operations
How?
1 State M⃗
a = ⃗
b in terms of (bivariate) polynomials
2 Use a pairing to perform M⃗
a as polynomial multiplication
3 Exploit the fact M is fixed and precompute quotients
4 Find a sparse basis for all commitments
5 Commit to everything in O(n) group scalar multiplications
6 Reduce bivariate form to univariate form
Liam Eagen (Blockstream Research) cqlin June 2, 2023 9 / 17
57. Encode into Polynomials
Recall: M⃗
a =
P
i∈[n] ai ⃗
ci where ⃗
ci the columns of M
Liam Eagen (Blockstream Research) cqlin June 2, 2023 10 / 17
58. Encode into Polynomials
Recall: M⃗
a =
P
i∈[n] ai ⃗
ci where ⃗
ci the columns of M
Encode ⃗
b and ⃗
ci pointwise as polynomials B(X) and Ci (X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 10 / 17
59. Encode into Polynomials
Recall: M⃗
a =
P
i∈[n] ai ⃗
ci where ⃗
ci the columns of M
Encode ⃗
b and ⃗
ci pointwise as polynomials B(X) and Ci (X)
Now: M⃗
a = ⃗
b iff
P
i∈[n] ai Ci (X) = B(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 10 / 17
60. Encode into Polynomials
Recall: M⃗
a =
P
i∈[n] ai ⃗
ci where ⃗
ci the columns of M
Encode ⃗
b and ⃗
ci pointwise as polynomials B(X) and Ci (X)
Now: M⃗
a = ⃗
b iff
P
i∈[n] ai Ci (X) = B(X)
M is a vector of vectors, so we can encode into bivariate M(X, Y )
such that M(X, ωi ) = Ci (X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 10 / 17
61. Encode into Polynomials
Recall: M⃗
a =
P
i∈[n] ai ⃗
ci where ⃗
ci the columns of M
Encode ⃗
b and ⃗
ci pointwise as polynomials B(X) and Ci (X)
Now: M⃗
a = ⃗
b iff
P
i∈[n] ai Ci (X) = B(X)
M is a vector of vectors, so we can encode into bivariate M(X, Y )
such that M(X, ωi ) = Ci (X)
Encode ⃗
a as polynomial A(Y )
Liam Eagen (Blockstream Research) cqlin June 2, 2023 10 / 17
62. Encode into Polynomials
Recall: M⃗
a =
P
i∈[n] ai ⃗
ci where ⃗
ci the columns of M
Encode ⃗
b and ⃗
ci pointwise as polynomials B(X) and Ci (X)
Now: M⃗
a = ⃗
b iff
P
i∈[n] ai Ci (X) = B(X)
M is a vector of vectors, so we can encode into bivariate M(X, Y )
such that M(X, ωi ) = Ci (X)
Encode ⃗
a as polynomial A(Y )
Now: M⃗
a = ⃗
b iff
P
i∈[n] A(ωi )M(X, ωi ) = B(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 10 / 17
63. Encode into Polynomials (cont.)
Let R(X, ωi ) = M(X, ωi )A(ωi ) = ai Ci (X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 11 / 17
64. Encode into Polynomials (cont.)
Let R(X, ωi ) = M(X, ωi )A(ωi ) = ai Ci (X)
Which means R(X, Y ) = M(X, Y )A(Y ) mod Y n − 1
Liam Eagen (Blockstream Research) cqlin June 2, 2023 11 / 17
65. Encode into Polynomials (cont.)
Let R(X, ωi ) = M(X, ωi )A(ωi ) = ai Ci (X)
Which means R(X, Y ) = M(X, Y )A(Y ) mod Y n − 1
Which means R(X, Y ) = M(X, Y )A(Y ) + (Y n − 1)Q(X, Y )
Liam Eagen (Blockstream Research) cqlin June 2, 2023 11 / 17
66. Encode into Polynomials (cont.)
Let R(X, ωi ) = M(X, ωi )A(ωi ) = ai Ci (X)
Which means R(X, Y ) = M(X, Y )A(Y ) mod Y n − 1
Which means R(X, Y ) = M(X, Y )A(Y ) + (Y n − 1)Q(X, Y )
Now: M⃗
a = ⃗
b iff
1 R(X, Y ) = M(X, Y )A(Y ) + (Y n
− 1)Q(X, Y )
2
P
i∈[n] R(X, ωi
) = B(X)
3 degY R(X, Y ) < n, etc.
Liam Eagen (Blockstream Research) cqlin June 2, 2023 11 / 17
67. Encode into Polynomials (cont.)
Let R(X, ωi ) = M(X, ωi )A(ωi ) = ai Ci (X)
Which means R(X, Y ) = M(X, Y )A(Y ) mod Y n − 1
Which means R(X, Y ) = M(X, Y )A(Y ) + (Y n − 1)Q(X, Y )
Now: M⃗
a = ⃗
b iff
1 R(X, Y ) = M(X, Y )A(Y ) + (Y n
− 1)Q(X, Y )
2
P
i∈[n] R(X, ωi
) = B(X)
3 degY R(X, Y ) < n, etc.
Sum-check equivalent to R(X, 0) = B(X)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 11 / 17
68. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
69. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
70. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
71. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Degree checks are also easy
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
72. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Degree checks are also easy
Can compute [R(x, y)] =
P
i∈[n] ai [Li (y)Ci (x)] in O(n) scalar
multiplications given precomputed [Li (y)Ci (x)]
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
73. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Degree checks are also easy
Can compute [R(x, y)] =
P
i∈[n] ai [Li (y)Ci (x)] in O(n) scalar
multiplications given precomputed [Li (y)Ci (x)]
The sum check can be computed in O(n) time using KZG openings
of Li (Y )Ci (X) at Y = 0
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
74. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Degree checks are also easy
Can compute [R(x, y)] =
P
i∈[n] ai [Li (y)Ci (x)] in O(n) scalar
multiplications given precomputed [Li (y)Ci (x)]
The sum check can be computed in O(n) time using KZG openings
of Li (Y )Ci (X) at Y = 0
How to compute Q(X, Y )? Use the cq technique
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
75. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Degree checks are also easy
Can compute [R(x, y)] =
P
i∈[n] ai [Li (y)Ci (x)] in O(n) scalar
multiplications given precomputed [Li (y)Ci (x)]
The sum check can be computed in O(n) time using KZG openings
of Li (Y )Ci (X) at Y = 0
How to compute Q(X, Y )? Use the cq technique
Define Qi (X, Y ) such that
Ci (X)Li (Y ) = M(X, Y )Li (Y ) + (Y n − 1)Qi (X, Y )
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
76. Proving in Linear Time
Want to construct [A(y)], [B(x)], [R(x, y)], and [Q(x, y)] in O(n)
time
Need to find basis for each that is n sparse
Commitments to A(Y ) and B(X) are easy given [Li (x)] and [Li (y)]
Degree checks are also easy
Can compute [R(x, y)] =
P
i∈[n] ai [Li (y)Ci (x)] in O(n) scalar
multiplications given precomputed [Li (y)Ci (x)]
The sum check can be computed in O(n) time using KZG openings
of Li (Y )Ci (X) at Y = 0
How to compute Q(X, Y )? Use the cq technique
Define Qi (X, Y ) such that
Ci (X)Li (Y ) = M(X, Y )Li (Y ) + (Y n − 1)Qi (X, Y )
Now [Q(X, Y )] =
P
i∈[n] ai [Qi (x, y)] can be computed in O(n) time
Liam Eagen (Blockstream Research) cqlin June 2, 2023 12 / 17
77. Final touches
Prefer to use a univariate SRS
Liam Eagen (Blockstream Research) cqlin June 2, 2023 13 / 17
78. Final touches
Prefer to use a univariate SRS
Can make the substitution Y = Xn
Liam Eagen (Blockstream Research) cqlin June 2, 2023 13 / 17
79. Final touches
Prefer to use a univariate SRS
Can make the substitution Y = Xn
Prefer to accept the input vector via F(X) that pointwise encodes ⃗
a
rather than A(Y )
Liam Eagen (Blockstream Research) cqlin June 2, 2023 13 / 17
80. Final touches
Prefer to use a univariate SRS
Can make the substitution Y = Xn
Prefer to accept the input vector via F(X) that pointwise encodes ⃗
a
rather than A(Y )
Can check A(α) = F(αn) at a random point in O(n) time
Liam Eagen (Blockstream Research) cqlin June 2, 2023 13 / 17
81. Final touches
Prefer to use a univariate SRS
Can make the substitution Y = Xn
Prefer to accept the input vector via F(X) that pointwise encodes ⃗
a
rather than A(Y )
Can check A(α) = F(αn) at a random point in O(n) time
That’s it! Given O(n) precomputed commitments can prove lin-check
in O(n) time
Liam Eagen (Blockstream Research) cqlin June 2, 2023 13 / 17
83. Future Work
Improvements to cqlin
▶ Generalize to other vanishing sets
Liam Eagen (Blockstream Research) cqlin June 2, 2023 14 / 17
84. Future Work
Improvements to cqlin
▶ Generalize to other vanishing sets
▶ Reduce prover work and/or proof size
Liam Eagen (Blockstream Research) cqlin June 2, 2023 14 / 17
85. Future Work
Improvements to cqlin
▶ Generalize to other vanishing sets
▶ Reduce prover work and/or proof size
▶ Improve setup time and SRS size for sparse matrices
Liam Eagen (Blockstream Research) cqlin June 2, 2023 14 / 17
86. Future Work
Improvements to cqlin
▶ Generalize to other vanishing sets
▶ Reduce prover work and/or proof size
▶ Improve setup time and SRS size for sparse matrices
Other applications of precomputation and pairings?
Liam Eagen (Blockstream Research) cqlin June 2, 2023 14 / 17
88. Precomputation
Most of the precomputation straightforward
1 Degree checks very simple
2 Openings at zero for Li (X) follow from symmetry
Complicated part: computing Qi (X, Y ) in O(n2) group operations
Solution: use the FK technique on the rows of M(X, Y ) and sum the
results
FK technique
1 Want to compute KZG openings at N roots of unity
2 Write vector of KZG openings as a 2N × 2N circulant matrix times
vector of [xi
]
3 Circulant matrix diagonalizes as FDF−1
where F is the DFT matrix
4 This product computable in
O(N log N) + O(N) + O(N log N) = O(N log N) time
Takes O(n log n) per row, for a total of O(n2 log n)
Liam Eagen (Blockstream Research) cqlin June 2, 2023 16 / 17
89. Precomputation (cont.)
Naive FK takes O(n2 log n) group and field operations
It is possible to exploit the structure of FK to avoid the extra log n
1 Precompute F−1
times vector of [xi
]
2 Compute D multiplication in O(n)
3 The final F multiplication is linear, so first add the results and then do
a single F multiplication
4 Takes O(n2
) + O(n log n) = O(n2
) time.
Liam Eagen (Blockstream Research) cqlin June 2, 2023 17 / 17