Professional Documents
Culture Documents
Lecture1 2023 Slides
Lecture1 2023 Slides
Dan Boneh, Shafi Goldwasser, Dawn Song, Justin Thaler, Yupeng Zhang
Classical Proofs
…
...
a2+b2
… Prime-
Number Thm
a
2 ZKP MOOC
Proofs
Claim
Prover Verifier
accept/
proof reject
3 ZKP MOOC
Efficiently Verifiable Proofs (NP-proofs)
Claim
Prover Verifier
accept/
short reject
proof
4 ZKP MOOC
Efficiently Verifiable Proofs (NP-proofs)
Claim x
Prover P Verifier V
Accepts x If
w V(x,w)=1
Else reject
|w| = polynomial in |x|
Unbounded V takes time Polynomial in |x|
5 ZKP MOOC
Claim: N is a product of 2 large primes
proof={p,q}
If N=pq, V accepts
Else V rejects
After interaction, V knows:
1) N is product of 2 primes
2) The two primes p and q
6 ZKP MOOC
Claim: y is a quadratic residue mod N
(i.e ∃𝑥 𝑖𝑛 𝑍!∗ s. t. y=x2 mod N)
Proof = 𝑥
7 ZKP MOOC
Claim: the two graphs are isomorphic
1 1
2 6
2 6 5
10 7 5 8
3
8 9
4 10
3 4
9 7
After interaction, V knows: Accept if ∀𝑖, 𝑗:
1) G0 is isomorphic to G1 𝝅: 𝑵 → [𝑵], 𝜋 𝑖 , 𝜋 𝑗 ∈ 𝐸! iff
2) The isomorphism 𝝅
the isomorphism 𝑖, 𝑗 ∈ 𝐸" .
8 ZKP MOOC
Efficiently Verifiable Proofs (NP-Languages)
Claim x
Prover P Verifier V
Accepts x If
w V(x,w)=1
Else reject
9 ZKP MOOC
Efficiently Verifiable Proofs (NP-Languages)
Claim x
w accept/reject
10 ZKP MOOC
1982-1985: Is there any other way?
11 ZKP MOOC
Zero Knowledge Proofs: Yes
Main Idea:
Prove that
I could prove it
If I felt like it
12 ZKP MOOC
Zero Knowledge
Interactive Proofs
13 ZKP MOOC
Credit: Faithie/Shutterstock
Two New Ingredients
Interactive and Probabilistic Proofs
14 ZKP MOOC
Interactive Proof Model
Claim/Theorem x
𝑎! accept
𝑞! /reject
𝑎%
𝑞%
Verifier
Prover …
Probabilistic
Comp. Unbounded
Polynomial-time (PPT)
15 ZKP MOOC
Here is the idea:
How to prove colors are different to a blind verifier
Claim: This page contains 2 colors
If page is flipped
Set coin’=heads I guess you tossed coin’ If coin ¹ coin’,
Else coin’=tails reject, else accept
16 ZKP MOOC
Here is the idea:
How to prove colors are different to a blind verifier
Claim: This page contains 2 colors
If page is flipped
Set coin’=heads I guess you tossed coin’ If coin ¹ coin’,
Else coin’=tails reject, else accept
17 ZKP MOOC
Interactive Proof for QR= 𝑁, 𝑦 : ∃𝑥 𝑠. 𝑡. 𝑦 = 𝑥2 𝑚𝑜𝑑 𝑁
18 ZKP MOOC
Interactive Proof for QR= 𝑁, 𝑦 : ∃𝑥 𝑠. 𝑡. 𝑦 = 𝑥2 𝑚𝑜𝑑 𝑁
19 ZKP MOOC
Interactive Proof for QR= 𝑁, 𝑦 : ∃𝑥 𝑠. 𝑡. 𝑦 = 𝑥2 𝑚𝑜𝑑 𝑁
Repeat 100 times
Send s=r2 mod n and says
( 1/2 )100
• If I gave you square roots of both s and sy mod N you would be
convinced that the claim is true (but also know √𝑦 mod N)
Choose • Instead, I will give you a a square rot of s or of sy mod N but you
random get to choose which!
1≤ 𝑟 ≤ 𝑁
s.t. • The fact that I COULD (in principle) do both, should convince you
gcd(r,N)=1 Flip a b= to choose Accepts
only if
If b=1: send z=r z2=sy1-b mod N
If b=0: send z=r √𝑦 mod N
20 ZKP MOOC
What Made it possible?
§ The statement to be proven has many possible proofs of
which the prover chooses one at random.
21 ZKP MOOC
Definitions :
of Zero Knowledge
Interactive Proofs
22 ZKP MOOC
Credit: Faithie/Shutterstock
Interactive Proofs for a Language ℒ
Claim/Theorem x
𝑎! accept
𝑞! /reject
𝑎%
Prover … Verifier
Def: (𝑃, 𝑉) is an interactive proof for L, if V is probabilistic poly (|x|) time &
• Completeness: If x ∈ ℒ, V always accepts.
• Soundness: If x ∉ ℒ, for all cheating prover strategy, V will not accept
except with negligible probability.
23 ZKP MOOC
Interactive Proofs: Notation
Claim/Theorem x
𝑎! accept
𝑞! /reject
𝑎%
Prover … Verifier
Def: (𝑃, 𝑉) is an interactive proof for L, if 𝑉 𝑖𝑠 probabilistic poly (|x|) and
• Completeness: If x ∈ ℒ, 𝑃𝑟 𝑃, 𝑉 𝑥 = 𝑎𝑐𝑐𝑒𝑝𝑡 = 1.
• Soundness: If x ∉ ℒ, for every 𝑷∗, Pr 𝑃∗, 𝑉 𝑥 = 𝑎𝑐𝑐𝑒𝑝𝑡] = 𝑛𝑒𝑔𝑙( 𝑥 )
!
where negl λ < for all polynomial functions
"#$%&#'()$ *
24 ZKP MOOC
Interactive Proofs: Notation
Claim/Theorem x
𝑎! accept
𝑞! /reject
𝑎%
Prover … Verifier
Def: (𝑃, 𝑉) is an interactive proof for L, if 𝑉 𝑖𝑠 probabilistic poly (|x|) and
This is what a proof
• Completeness: If x ∈ ℒ, 𝑃𝑟 𝑃, 𝑉 𝑥 = 𝑎𝑐𝑐𝑒𝑝𝑡 = 1.
• Soundness: If x ∉ ℒ, for every 𝑷∗, Pr 𝑃∗, 𝑉 𝑥 = 𝑎𝑐𝑐𝑒𝑝𝑡] = 𝑛𝑒𝑔𝑙( 𝑥 )
where negl λ <
!
ultimately is!
for all polynomial functions
"#$%&#'()$ *
25 ZKP MOOC
Interactive Proofs for a Language ℒ: Notation
Claim/Theorem x
𝑎! accept
𝑞! /reject
𝑎%
Prover … Verifier
26 ZKP MOOC
The class of Interactive Proofs (IP)
Claim/Theorem x
𝑎! accept
𝑞! /reject
𝑎%
Prover … Verifier
27 ZKP MOOC
What is zero-knowledge?
28 ZKP MOOC
The Verifier’s View
Theorem: T Probabilistic
𝑎! Polynomial time
𝑞! algorithm
𝑎% accept
Prover P … Verifier V /reject T
29 ZKP MOOC
The Simulation Paradigm
V’s view gives him nothing new, if he could have simulated it its own s.t
`simulated view’ and `real-view’ are computationally-Indistinguishable
v1
real p1
v2
VIEWS Accept/ When
reject Theorem
?? is true
v1
SIMULATED p1
The poly-time VIEWS v2
Accept/
Distinguisher reject
30 30 ZKP MOOC
Computational Indistinguishability
If no “distinguisher” can tell apart two different
probability distributions they are “effectively the same”.
D1 K-BIT STRINGS
sample
Probabilistic
Poly Time (k)
Distinguisher D D2 K-BIT STRINGS
ZKP MOOC
Zero Knowledge: Definition
An Interactive Protocol (P,V) is zero-knowledge for a language
𝐿 if there exists a PPT algorithm Sim (a simulator) such that for
every 𝒙 ∈ 𝑳, the following two probability distributions are
poly-time indistinguishable:
1. 𝑣𝑖𝑒𝑤5 𝑃, 𝑉 [𝑥] = {(q1,a1,q2,a2,…,coins of V)}
2. 𝑆𝑖𝑚(𝑥) (over coins of V and P)
32 ZKP MOOC
Zero Knowledge: Definition
An Interactive Protocol (P,V) is zero-knowledge for a language
𝐿 if there exists a PPT algorithm Sim (a simulator) such that for
every 𝒙 ∈ 𝑳, the following two probability distributions are
poly-time indistinguishable:
Allow simulator S 1. 𝑣𝑖𝑒𝑤5 𝑃, 𝑉 [𝑥, 16 ] = {(q1,a1,q2,a2,…,coins of V)}
Expected
2. 𝑆𝑖𝑚(𝑥, 16 ) (over coins of V and P)
Poly-time Technicality:
Allows sufficient
Def: (P,V) is a zero-knowledge interactive Runtime onn small x
protocol if it is complete, sound and zero-knowledge 𝜆- security parameter
33 ZKP MOOC
What if V is NOT HONEST
D EF
D
OL An Interactive Protocol (P,V) is honest-verifier zero-
knowledge for a language 𝐿 if there exists a PPT
simulator Sim such that for every 𝑥 ∈ 𝐿,
𝑣𝑖𝑒𝑤5 𝑃, 𝑉 [𝑥] ≈ 𝑆𝑖𝑚(𝑥, 16 )
D EF
EAL An Interactive Protocol (P,V) is zero-knowledge for a
R language 𝐿 if for every PPT 𝑽∗ , there exists a poly time
simulator Sim s.t. for every 𝑥 ∈ 𝐿,
𝑣𝑖𝑒𝑤5 𝑃, 𝑉 [𝑥] ≈ 𝑆𝑖𝑚(𝑥, 16 )
34 ZKP MOOC
Flavors of Zero Knowledge
REAL ≈ SIMULATED
35 ZKP MOOC
Special Case: Perfect Zero Knowledge
verifier’s view can be exactly efficiently simulated
`Simulated views’ = `real views’
v1
p1
v2
𝑣𝑖𝑒𝑤+ 𝑃, 𝑉 [𝑥] pk
accept/
?? = reject
v1
pkp1
v2
Any Algorithm 𝑆𝑖𝑚(𝑥) Accept/
reject
36 ZKP MOOC
Working through a
Simulation
for QR Protocol
37 ZKP MOOC
Credit: Faithie/Shutterstock
Recall the Simulation Paradigm
𝑣𝑖𝑒𝑤5 𝑃, 𝑉 :
Transcript = 𝑠, 𝑏, 𝑧 ,
Coins = 𝑏 38
38 ZKP MOOC
Recall the Simulation Paradigm
𝑣𝑖𝑒𝑤5 𝑃, 𝑉 :
𝑠, 𝑏, 𝑧
39
𝑠, 𝑏, 𝑧 𝑁, 𝑦
39 ZKP MOOC
(Honest Verifier) Perfect Zero Knowledge
Claim: The QR protocol is perfect zero knowledge.
Simulator S works as follows:
1. First pick a random bit b.
2. pick a random 𝑧 ∈ 𝑍*∗ .
3. compute s = 𝑧 % /𝑦 + .
4. output (s, b, z).
𝑣𝑖𝑒𝑤5 𝑃, 𝑉 : claim: The simulated transcript is identically
𝑠, 𝑏, 𝑧 distributed as the real transcript
40 ZKP MOOC
Perfect Zero Knowledge: for all V*
Claim: The QR protocol is perfect zero knowledge.
Simulator S works as follows:
1. First pick a random bit b.
2. pick a random 𝑧 ∈ 𝑍*∗ .
3. compute s = 𝑧 % /𝑦 + .
4. If V*((N,y),s) = b output s, b, z
if not goto 1 and repeat
𝑣𝑖𝑒𝑤5 𝑃, 𝑉 :
𝑠, 𝑏, 𝑧 Claim: Expected number of repetitions is two
41 ZKP MOOC
ZK proof of Knowledge
42 ZKP MOOC
Credit: Faithie/Shutterstock
Prover seems to have proved more: theorem is correct and
that she “knows” a square root mod N
Extractor E
EP(x) (E may run P repeatedly on the same randomness)
possibly asking different questions in every executions same msg
This is called the rewinding technique
43 ZKP MOOC
Prover seems to have proved more not only that theorem is
correct, but that she “knows” a square root mod N
Extractor E
EP(x) (may run P repeatedly on the same randomness)
Possibly asking different questions in every executions same msg
This is called the rewinding technique
44 ZKP MOOC
ZKPOK that Prover knows a square root x of y mod N
Input: (y,N)
Extractor Extractor:
Algorithm On input (y,N),
1. Run prover & receive s
s=r2 mod N 2. Set verifier message to
head; Store r
head
45 ZKP MOOC
The Rewinding Method
Input: (y,N)
Extractor Extractor:
Algorithm On input (y,N)
1. Run prover & receive s
s=r2 mod N 2. Set verifier message to
head; receive and store r
tail 3. Rewind and 2nd time set
verifier message to tail
receive rx
rx mod N
4. Output rx/r=x mod N
46 ZKP MOOC
ZK Proof for Graph Isomorphism
1 1
2 6
2 6 5
10 7 5 8
3
8 9
4 10
3 4
9 7
Recall:
G0 is isomorphic to G1
If ∃ isomorphism 𝝅: 𝑵 → [𝑵], ∀𝑖, 𝑗: 𝜋 𝑖 , 𝜋 𝑗 ∈ 𝐸! iff 𝑖, 𝑗 ∈ 𝐸, .
47 ZKP MOOC
ZK Interactive Proof for Graph Isomorphism
I will produce a random graph H for which
1: I can give an isomorphism g0 from G0 to H
OR
2: I can give an isomorphism g1 from G1 to H
Thus, ∃isomorphism s from G0 to G1
48 ZKP MOOC
REPEAT K
Input: (G0,G1)
INDEPENDENT TIMES.
Graph H
Choose Toss
random g0 b coin b
permutation
of vertices If b=0: send g0
of G0. Set
If b=1: send g0 s-1 (where s(G0)=G1)
H=g0(G0)
49 ZKP MOOC
ZKPOK that Prover knows an isomorphism from G1 to G2
Extractor :
Extractor
Algorithm 1) On input H
H set coin=head
Store g0
tail
head 2) Rewind and 2nd time
set coin=tail
gg01 Store g1
3) Output g1-1(g0)
50 ZKP MOOC
The first application: Identity Theft [FS86]
Alice Amazon (Bob)
password
...
For Settings: I accept you as Alice
• Alice = Smart Card.
• Over the Net
•Breaking ins at Bob/Amazon are possible
Passwords are no good
51 ZKP MOOC
Zero Knowledge: Preventing Identity Theft
PROVER VERIFIER
Smart Card
52 ZKP MOOC
Interesting examples, one
application
53 ZKP MOOC
Credit: Faithie/Shutterstock
Yes: All of NP is in Zero Knowledge
Theorem[GMW86,Naor]: If one-way functions exist, then every
L in NP has computational zero knowledge interactive proofs
Ideas of the proof:
1. Show that an NP-Complete Problem has a ZK interactive Proof
[GMW87] Showed ZK interactive proof for G3-COLOR using bit- commitments
⇒For any other L in NP, L <p G3-COLOR (due to NPC reducibility)
⇒ Every instance x can be reduced to graph Gx such that
§ if x in L then Gx is 3 colorable
§ if x not in L then Gx is not 3 colorable
54 54 ZKP MOOC
Can you show Zero Knowledge for all of NP [GMW87]
Theorem[GMW86, Naor]: If one-way functions exist, then every L
in NP has computational ZK interactive proofs
Ideas of the proof:
1.[GMW87] Show that an NP-Complete Problem has a ZK interactive Proof if
bit commitments exist
2.[Naor]One Way functions bit commitment protocol exist
Commit(m) Decommit
hiding
m m
binding
55 ZKP MOOC
Properties of a Bit Commitment Protocol (Commit, Decommit)
between Sender S and Receiver R
Hiding: ∀ receiver R∗ , after commit stage ∀ b, bʹ ∈ {0,1}, view of sender R*
{ViewR*{Sender(b),R∗)(1k)} ≈c {ViewR*(Sender(bʹ),R∗)(1k)} [k=sec. param]
Binding: ∀ sender S*, after commit and decommit stage
Prob[R will accept two different values b and b’] < negl(k)
K-security parameter
Ex: Use (semantically) secure probabilistic encryption scheme Enc
Commit(b)= “sender chooses r and sends c=Enc(b;r)”
Decommit(c) =“sender sends r and b. Receiver rejects unless c=Enc(b;r)”
56 ZKP MOOC
All of NP is in Zero Knowledge
Theorem[GMW86,Naor]: If one-way functions exist, then every
L in NP has computational zero knowledge interactive proofs
Ideas of the proof:
1. Show that an G3-COLOR has a ZK interactive Proof
Theorem : is 3-color
57 ZKP MOOC
Theorem : is G3-COLORABLE
On common input graph G =(V,E) & prover input coloring p: V {0,1,2}
58 ZKP MOOC
Completeness and Soundness
§ Completeness: if G is 3-colorable, then the honest prover
uses a proper 3-coloring& the verifier always accept.
59 ZKP MOOC
Honest Verifier Computational ZK
60 ZKP MOOC
Computational ZK: Simulation for any Verifier V*
Simulator S on input G and verifier V*: For i = 1 to |E|2:
§ Choose random edge (a, b) and generate commitments com to colors as in
honest verifier simulation.
§ Run V* on com to obtain challenge (a∗, b∗);
if (a∗, b∗) = (a, b), then output simulation as honest verifier case,
If all iterations fail, then output ⊥.
61 ZKP MOOC
Now, we have as many CZK examples as NP-languages
}
§ n is the product of 2 primes
§ x is a square mod n Stronger Guarantee: PZK
62 ZKP MOOC
Applications in practice
and in theory
63 ZKP MOOC
Credit: Faithie/Shutterstock
Protocol design applications
•Can prove relationships between m1 and m2 never revealing either one, only
commit(m1) and commit(m2).
Examples: m1=m2 , m1≠m2 or more generally v=f(m1, m2) for any poly-time f
64 ZKP MOOC
Uses for Zero Knowledge Proofs 90-onwards
Computation Delegation [Kalai, Rothblum x 2, Tromer,…]
Zcash: Bit Coin with privacy and anonymity [BenSasson, Chiesa et al]
65 ZKP MOOC
Complexity Theory: Randomized Analogue to NP
Efficiently P BPP
Solvable (randomized poly time)
Efficiently NP IP
Verifiable
66 ZKP MOOC
Claim: G0 is Not Isomorphic to G1
(in co-NP, not known to be in NP)
1 1
2 6
2 6 5
10 7 5 3 8 G1
G0
8 9 10
4
3 4 9
7
67 ZKP MOOC
67
Graph Non-Isomorphism in IP
input: (G0, G1)
68 ZKP MOOC
Graph Non-Isomorphism in IP
input: (G0, G1)
69 ZKP MOOC
Arthur-Merlin Games [BaM85]
“x in L”
Merlin Arthur
coins Coin Tosser+
Decision Function
coins Accepts or Rejects x
70 ZKP MOOC
AM Protocols enable “in practice” removal of
interaction: the Fiat-Shamir Paradigm[FS87]
§ Let H:{0,1}* {0,1}k be a cryptographic Hash function
71 ZKP MOOC
AM Protocols suggest “in practice” removal of
interaction: the Fiat-Shamir Paradigm[FS87]
§ Letthis
Warning: H:{0,1}* {0,1}every
does NOT mean
k be ainteractive
cryptographic
ZK proofHash functionto AM
can transform
protocols and then use Fiat-Shamir heuristic,
Since IP =AM transformation requires extra super-polynomial
a1 powersCoin
fromTosser+
Merlin
§ Can take an AM protocol
And for Fiat-Shamir heuristic to work, Prover must beCoins
computationallyDecision
bounded so
Function
not to be able to invert H a2 V(input x, a1,coins,a2)
Yet, §many specific
Replace by protocols, can benefit from this heuristic =Accept or Rejects
Fiat-Shamir Heuristic:
If H is random-oracle,then (a1, H(a1), a2) V(x, a1,H(x,a1), a2)
completeness&soundness hold =Accept or Rejects
72 ZKP MOOC
AM Protocols suggest “in practice” removal of
interaction: the Fiat-Shamir Paradigm[FS87]
§ Let H:{0,1}* {0,1}k be a cryptographic Hash function
Coins
§ Can take an AM protocol a1 Coin Tosser+
Coins Decision Function
a2 V(x, a1,coins, a2)=Accept
Q: What if first message are coins from Arthur?
§ Replace by or Rejects
Idea(used later in course extensively):
Fiat-Shamir Heuristic:
Post first message coins as a “publicly” chosen randomness for all to see
If H is random-oracle,then (a1, H(x, a1), a2)proofs
and then apply Fiat-Shamir heuristics to get non-interactive V(x, a1,H(a1), a2)=Accept
completeness&soundness hold or Rejects
73 ZKP MOOC
IP: Complexity Theory Catalyst
74 ZKP MOOC
Classically: Can Efficiently Verify
NP ∃solution
Co-NP ? 0 solutions
PSPACE ? ∀∃∀…∃
75 ZKP MOOC
Interactively Provable= PSPACE [FortnowKarloffLundNissan89,
Shamir89]
NP
q1
Co-NP a1
q2
#P Accept/
Reject
PSPACE
=IP Other Ways to define probabilistic proof systems?
76 ZKP MOOC
The Arrival of the Second Prover (MIP)
[BenorGoldwasserKilianWigderson88]
Unconditionally: NP =PZK
NP Claim T
P1
Co-NP V Accept/
P2 Reject
#P
PSPACE Could two prove more than one?
Intuition: Can check consistency,
Verifier catches provers if deviate
77 ZKP MOOC
The Second Prover is a Game Changer (MIP)
Claim T
P1
NP
V Accept/
Co-NP P2 Reject
#P
PCP theorem [FGLSS, AS, ALMSS91]:
PSPACE NP statements can be verified with high
prob. by only reading a constant number of
NEXPTIME bits of the proof
[BabaiFortnowLund90] →NP-Hardness of Approximation Problems
78 ZKP MOOC
Impact on Quantum Computing
Quantum Polynomial time
Q: Can the correctness
of a Quantum
Classical Verifier
polynomial
time computation
be checked by a
Accept/reject
classical verifier?
Theorem[ReichardtUngerVazirani13]:
A classical Verifier can verify the computation of two entangled
but non-communicating poly-time quantum algorithms
79 ZKP MOOC
Quantum MIP is All Powerful
P1
Classical Verifier
P2 Accept/reject
80 ZKP MOOC
Aside:
The Resistance
81 ZKP MOOC
Credit: Faithie/Shutterstock
1983–1985 (The Resistance)
82
1983–1985 (The Resistance)
83
1983–1985 (The Resistance)
Let me show you how to do it!
84
1985 (The Acceptance)
We are very happy to inform you that your paper
“The Knowledge Complexity of Interactive Proof Systems”
has been selected for presentation at the 17th Symposium on Theory of
Computing
85
Broader Lessons