ZKP学习笔记
ZK-Learning MOOC课程笔记
Lecture 4: SNARKs via Interactive Proofs (Justin Thaler)
4.3 Interactive proof design: Technical Preliminaries
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第3张图片](http://img.e-com-net.com/image/info8/0736db59e1d4492daa07fdf7d1e989d4.png)
- f(0,0) = 1; f(0,1) = 2; f(1,0) = 8; f(1,1) = 10
- f ~ ( 0 , 0 ) = 1 ; f ~ ( 0 , 1 ) = 2 ; f ~ ( 1 , 0 ) = 8 ; f ~ ( 1 , 1 ) = 10 \tilde{f}(0,0) = 1; \tilde{f}(0,1) = 2; \tilde{f}(1,0) = 8; \tilde{f}(1,1) = 10 f~(0,0)=1;f~(0,1)=2;f~(1,0)=8;f~(1,1)=10
- f ~ ( x 1 , x 2 ) = ( 1 − x 1 ) ( 1 − x 2 ) + 2 ( 1 − x 1 ) x 2 + 8 x 1 ( 1 − x 2 ) + 10 x 1 x 2 \tilde{f}(x_1,x_2) = (1-x_1)(1-x_2)+2(1-x_1)x_2+8x_1(1-x_2)+10x_1x_2 f~(x1,x2)=(1−x1)(1−x2)+2(1−x1)x2+8x1(1−x2)+10x1x2: unique!
- (1-x_1)(1-x_2) term maps inputs (0,0) to 1
- 2(1-x_1)x_2 term maps inputs (0,1) to 2
- …
- Evaluating multilinear extensions quickly
- Use Lagrange Interpolation
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第4张图片](http://img.e-com-net.com/image/info8/137414bc42524d378db8297fda8ba650.jpg)
- δ ~ w ( r ) \tilde{\delta}_w(r) δ~w(r) maps (0,0) to 1; others to 0
4.4 The Sum-check Protocol [LFKN90]
-
Input: V given oracle access to a l-variate polynomial g over filed F.
- Prover负责计算,并把计算结果和proof给Verifier。
- Verifier验证计算结果的正确性
-
Goal: compute the quantity
- Σ b 1 ∈ { 0 , 1 } Σ b 2 ∈ { 0 , 1 } … Σ b l ∈ { 0 , 1 } g ( b 1 , … , b l ) \Sigma_{b1\in\{0,1\}} \Sigma_{b2\in\{0,1\}} \dots \Sigma_{bl\in\{0,1\}} g(b_1,\dots,b_l) Σb1∈{0,1}Σb2∈{0,1}…Σbl∈{0,1}g(b1,…,bl)
-
最简单的方法,verifier问prover每个点的值然后加起来,需要 2 l 2^l 2l次
-
Sum-check Protocol
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第5张图片](http://img.e-com-net.com/image/info8/15c65182ddc74099812fc5749f515eca.jpg)
- s1 is the prover actually sent and H1 is what the prover would send if the prover is honest
- H1 is equal to the true answer except it have been cut off the first sum
- H1 is a univariate polynomial

![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第6张图片](http://img.e-com-net.com/image/info8/6d575b21bd2847d8b1623f4bfc12a4db.jpg)
-
Analysis of the sum-check protocol
-
Application: Counting Triangles
- Input A ∈ 0 , 1 n × n A \in {0,1}^{n \times n} A∈0,1n×n, representing the adjacency matrix of a graph
- Output: Σ i , j , k ∈ [ n ] 3 A i j A j k A i k \Sigma_{i,j,k \in[n]^3} A_{ij}A_{jk}A_{ik} Σi,j,k∈[n]3AijAjkAik
- Time cost in matrix-multiplication: n 2.37 n^{2.37} n2.37
- The Protocol:
- View A as a function mapping { 0 , 1 } log n × { 0 , 1 } log n \{0,1\}^{\log n} \times \{0,1\}^{\log n} {0,1}logn×{0,1}logn to F
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第9张图片](http://img.e-com-net.com/image/info8/437a9ae1d711456b9b6d6fa8ceb60a73.jpg)
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第10张图片](http://img.e-com-net.com/image/info8/eaa16128d7844db08765e27223772e94.jpg)
- Cost
- Communication: O ( log n ) O(\log n) O(logn)
- V runtime is O ( n 2 ) O(n^2) O(n2)
- P runtime is O ( n 3 ) O(n^3) O(n3)
- A SNARK for circuit-satisfiability
-
SNARKs for circuit-satisfiability
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第11张图片](http://img.e-com-net.com/image/info8/2711b21fe7694b4aab3077c513d5c169.jpg)
-
Viewing a transcript T as a function with domain { 0 , 1 } log S \{0,1\}^{\log S} {0,1}logS
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第12张图片](http://img.e-com-net.com/image/info8/6499dddbacea4d46a93aa0d053fa6385.jpg)
4.5 The polynomial IOP underlying the SNARK
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第14张图片](http://img.e-com-net.com/image/info8/cecd237901f94d62ac9c4596fd7e3137.jpg)
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第15张图片](http://img.e-com-net.com/image/info8/363ee3427e7548b4b4c5b5e1ed4aab9c.jpg)
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第16张图片](http://img.e-com-net.com/image/info8/5bee66d989d74e629e10ef3cd6f13786.jpg)
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第17张图片](http://img.e-com-net.com/image/info8/13cb57f5843644c192f45731af2d482d.jpg)
- The polynomial IOP for circuit-satisfiability
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第18张图片](http://img.e-com-net.com/image/info8/a909b82dbf374322938cbe57e98f2eb1.jpg)
![ZKP4.2 SNARKs via Interactive Proofs (Sum-check Protocol [LFKN90])_第19张图片](http://img.e-com-net.com/image/info8/94ee106880724022ad68c0ce491d8a59.jpg)