A. Some References
- Jonathan Katz and Yehuda Lindell,Introduction to Modern Cryptography
- Dan Boneh,A Graduate Course in Applied Cryptography
- Oded Goldreich,Foundations of Cryptography I、II
B. Four Stages of Cryptography Applications
- symmetric-key cryptography:secret communication through shared key
- public-key cryptography:secret communication without shared key、电子签名
- blockchain technology and Decentralization Vision
virtual TTP in half,trust without privacy;实现了可信方的部分功能,但没有实现隐私性 - Private-Preserving Computation (Advanced Cryptography:ZKP、FHE、MPC)
virtual TTP complete,trust in full privacy;
C. Further Elaboration of the Above Points
- DES as the industrial standard of symmetric cryptography in 1970s,later upgraded to AES,key length 128, 192, 256
- Hash functions,Merkle trees
- Diffie and Hellman, New Directions in Cryptography, 1976
- Diffie-Hellman key exchange protocol,hardness of discrete logarithm in finite fields
- Public-key cryptography, public-key and private-key,digital signature (identity authentication, data integrity, non-repudiation)
- CA,PKI,SSL/TLS,https
- Rivest, Shamir, Adleman, A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, 1978
- RSA algorithm,hardness of factoring
- Combining public key cryptography with symmetric cryptography (for its efficiency)
- Many technologies in private-preserving computation:ZKP,FHE,MPC,trusted execution environment (TEE),federated learning (FL),differential privacy (DP),private AI
D. Blockchain Basics
- Satoshi Nakamoto,Bitcoin:A peer-to-peer electronic cash system,2008
- Blockchain,bitcoin white paper,the main purpose:to replace TTP
- Transaction,solution of double spending problem by the construction of time stamp
- PoW:consensus by proof of work,the rule of the longest chain,security of the system
- Mining as an incentive mechanism (including transaction fee)
- Lack of privacy and Satoshi Nakamoto’s attempt to deal with it,which is inadequate
- Three vital weaknesses of the original blockchain design:limited computational capacity,limited storage capacity,nearly no privacy,insufficient for real business applications(每个区块只记录7笔交易)
- Zero Knowledge Proof as the key technology to solve the above problems
E. Math Preparation: Discrete Logarithm and Pairing
- finite field
F
q
=
Z
/
p
Z
=
{
1
,
2
,
…
,
q
?
1
}
F_q=Z/pZ=\{1,2,\ldots,q-1\}
Fq?=Z/pZ={1,2,…,q?1},its multiplication group
F
q
?
=
{
1
,
2
,
…
,
q
?
1
}
F_q^\ast=\{1,2,\ldots,q-1\}
Fq??={1,2,…,q?1},subgroup
G
?
F
q
?
G\subset F_q^\ast
G?Fq?? of prime order
p
p
p,
G
=
{
e
,
g
,
g
2
,
…
,
g
p
?
1
}
G=\{e,g,g^2,\ldots,g^{p-1}\}
G={e,g,g2,…,gp?1},hardness of discrete logarithm in
G
G
G
mZ是个啥? Z/pZ是啥? - Example:let
q
=
11
q=11
q=11,
F
11
=
{
0
,
1
,
2
,
4
,
5
,
6
,
7
,
8
,
9
,
10
}
F_{11}=\{0,1,2,4,5,6,7,8,9,10\}
F11?={0,1,2,4,5,6,7,8,9,10},
F
11
?
=
{
1
,
2
,
4
,
5
,
6
,
7
,
8
,
9
,
10
}
F_{11}^\ast=\{1,2,4,5,6,7,8,9,10\}
F11??={1,2,4,5,6,7,8,9,10};Let
g
=
4
g=4
g=4,then
g
2
=
16
=
5
g^2=16=5
g2=16=5,
g
3
=
20
=
9
g^3=20=9
g3=20=9,
g
4
=
36
=
3
g^4=36=3
g4=36=3,
g
5
=
12
=
1
g^5=12=1
g5=12=1;This means we have
G
=
{
e
,
g
,
g
2
,
g
3
,
g
4
}
=
{
1
,
4
,
5
,
9
,
3
}
G=\left\{e,g,g^2,g^3,g^4\right\}=\{1,4,5,9,3\}
G={e,g,g2,g3,g4}={1,4,5,9,3},a group of order
p
=
5
p=5
p=5
- Elliptic curve
E
E
E over finite field
F
q
F_q
Fq? which forms a group,subgroup
G
?
E
G\subset E
G?E of prime order
p
p
p,
G
=
{
e
,
g
,
g
2
,
…
,
g
p
?
1
}
G=\{e,g,g^2,\ldots,g^{p-1}\}
G={e,g,g2,…,gp?1},hardness of discrete logarithm in
G
G
G
- Exponential map
E
x
p
:
F
p
→
G
Exp:F_p\rightarrow G
Exp:Fp?→G defined by
E
x
p
(
x
)
=
g
x
Exp\left(x\right)=g^x
Exp(x)=gx,and discrete logarithm means the inversion of the exponential map,Hardness of discrete logarithm is not true in all groups;It is special to find such groups as in the above two cases
- Pederson commitment,the trade-off between hiding and binding,additive homomorphic property
- Zero knowledge proof through homomorphic property
- In addition to the additive homomorphic property of the exponential map,a more special algebraic structure called pairing (also called bilinear structure) serves to facilitate some multiplicative homomorphic property
- Three groups:
G
1
=
{
e
,
g
1
,
g
1
2
,
…
,
g
1
p
?
1
}
G_1=\{e,g_1,g_1^2,\ldots,g_1^{p-1}\}
G1?={e,g1?,g12?,…,g1p?1?},
G
2
=
{
e
,
g
2
,
g
2
2
,
…
,
g
2
p
?
1
}
G_2=\{e,g_2,g_2^2,\ldots,g_2^{p-1}\}
G2?={e,g2?,g22?,…,g2p?1?},
G
T
=
{
e
,
g
T
,
g
T
2
,
…
,
g
T
p
?
1
}
G_T=\{e,g_T,g_T^2,\ldots,g_T^{p-1}\}
GT?={e,gT?,gT2?,…,gTp?1?},all of prime order
p
p
p,with a map
e
:
G
1
×
G
2
→
G
T
e:G_1\times G_2\rightarrow G_T
e:G1?×G2?→GT? which satisfies the bilinear condition
e
(
x
a
,
y
b
)
=
e
(
x
,
y
)
a
b
e\left(x^a,y^b\right)={e(x,y)}^{ab}
e(xa,yb)=e(x,y)ab,We can assume
e
(
g
1
,
g
2
)
=
g
T
e\left(g_1,g_2\right)=g_T
e(g1?,g2?)=gT?,this means
e
(
g
1
a
,
g
2
b
)
=
g
T
a
b
e\left(g_1^a,g_2^b\right)=g_T^{ab}
e(g1a?,g2b?)=gTab?
- ZKP for any quadratic relation:
Σ
c
i
j
x
i
x
j
+
Σ
c
k
x
k
+
c
=
0
\Sigma c_{ij}x_ix_j+\Sigma c_kx_k+c=0
Σcij?xi?xj?+Σck?xk?+c=0,by exponentiation with
g
T
g_T
gT?
F. Zero knowledge Proof General
- Goldwasser,Micali and Rackoff,The Knowledge Complexity of Interactive Proof-Systems,1985
- Goldreich,Micali and Wigderson,Proofs That Yield Nothing But Their Validity or All Languages in NP Have Zero Knowledge Proof Systems,1986
- Vanishree Rao,Zero-knowledge Proofs-An Intuitive Explanation,2019
- ZKP for 3-coloring of graph by physical procedure (board and coins)
- The essential elements of the above physical procedure:hiding and binding,which corresponds to the cryptographic primitive:commitment scheme
- NP-problem,general formulation of ZKP,proof without giving full evidence (witness)
- ZKP for discrete logarithm,
g
w
=
y
g^w=y
gw=y,
P
P
P has solution
w
w
w and randomly splits it into two parts as
w
=
w
0
+
w
1
w=w_0+w_1
w=w0?+w1?,which gives
g
w
0
=
y
0
g^{w_0}=y_0
gw0?=y0? and
g
w
1
=
y
1
g^{w_1}=y_1
gw1?=y1? satisfying
y
0
y
1
=
y
y_0y_1=y
y0?y1?=y;
P
P
P sends
y
0
y_0
y0? and
y
1
y_1
y1? to
V
V
V for verification,and
V
V
V can randomly choose a bit
b
=
0
b=0
b=0 or
1
1
1,and ask for
w
b
w_b
wb? for verification;The above can be repeated many times till
V
V
V is convinced
- To convert the above proving process into non-interactive proof,choose some hash function
H
H
H and try to use
b
=
H
(
g
,
y
0
,
y
1
)
b=H({g,y}_0{,y}_1)
b=H(g,y0?,y1?) to simulate
V
’
s
V’s
V’s challenge;The idea is to let
P
P
P alone do all the computation,
P
’
s
P’s
P’s can try to cheat by trying different fake split
w
=
w
0
+
w
1
w=w_0+w_1
w=w0?+w1? where one of the
w
b
w_b
wb? is good (
g
w
b
=
y
b
g^{w_b}=y_b
gwb?=yb?),but the other is fake,and try to find a desired
b
b
b which allows it to pass the test
- To overcome this problem,in the original protocol,replace the bit
b
b
b (which represents two possible outcome that can be exhausted by a few random trails) by a value
c
c
c that has too many possible values to be exhausted;Instead choosing
b
b
b and ask for
w
b
w_b
wb?,
V
V
V chooses
c
c
c and asks for
w
c
=
(
1
?
c
)
w
0
+
c
w
1
w_c=\left(1-c\right)w_0+cw_1
wc?=(1?c)w0?+cw1?,which needs to satisfy
g
w
c
=
g
(
1
?
c
)
w
0
+
c
w
1
=
y
0
1
?
c
?
y
1
c
g^{w_c}=g^{\left(1-c\right)w_0+cw_1}=y_0^{1-c}*y_1^c
gwc?=g(1?c)w0?+cw1?=y01?c??y1c?
- In fact,with this change,there is no need to do many rounds of challenges and responses as in the cases of using
b
b
b,one round is enough;Suppose
c
c
c has
N
N
N possible different values,
P
’
s
P’s
P’s faces the challenge of providing all correct
w
c
=
(
1
?
c
)
w
0
+
c
w
1
w_c=\left(1-c\right)w_0+cw_1
wc?=(1?c)w0?+cw1? values for these
N
N
N possible
c
c
c values,depending on
V
’
s
V’s
V’s random choices;But for this,
P
P
P only needs to know
w
c
w_c
wc? for two different
c
c
c values,which implies the knowledge of both
w
0
w_0
w0? and
w
1
w_1
w1?;To prove this is easy;Because if this were not true,it would mean that
P
P
P only knows
w
c
w_c
wc? for one value of
c
c
c;This means with random choice of
c
c
c,the probability of failure is
(
N
?
1
)
/
N
(N-1)/N
(N?1)/N;If
N
N
N is big enough,one round will do the job
- With the above change from
b
b
b to
c
c
c,will can use
c
=
H
(
g
,
y
0
,
y
1
)
c=H(g,y_0,y_1)
c=H(g,y0?,y1?) to do the non-interactive version;
P
P
P can compute the transcript
π
=
(
g
,
y
0
,
y
1
,
w
c
)
\pi=(g,y_0,y_1,w_c)
π=(g,y0?,y1?,wc?) and send to
V
V
V;
V
V
V will verify:1)
y
0
y
1
=
y
y_0y_1=y
y0?y1?=y,2)
g
w
c
=
y
0
1
?
c
y
1
c
g^{w_c}=y_0^{1-c}y_1^c
gwc?=y01?c?y1c?,where
c
=
H
(
g
,
y
0
,
y
1
)
c=H(g,y_0,y_1)
c=H(g,y0?,y1?)
- General formulation of interactive proof process:
P
P
P sends
m
0
m_0
m0? to
V
V
V
V
V
V sends
c
1
c_1
c1? to
P
P
P (
c
1
c_1
c1? is a random challenge)
P
P
P sends
m
1
m_1
m1? to
V
V
V (
m
1
m_1
m1? is a response to the above challenge,and needs to pass
V
’
s
V’s
V’s verification)
…
…
……
……
V
V
V sends
c
k
c_k
ck? to
P
P
P
P
P
P sends
m
k
m_k
mk? to
V
V
V In the above process,
c
l
c_l
cl? is sent after
m
0
,
m
1
…
,
m
l
?
1
m_0, m_1…,m_{l-1}
m0?,m1?…,ml?1? has already been sent and cannot be changed - Fiat-Shamir heuristic:
P
P
P computes
c
1
=
H
(
m
0
)
,
c
2
=
H
(
m
0
,
m
1
)
,
…
,
c
k
=
H
(
m
0
,
m
1
,
…
,
m
k
?
1
)
c_1=H(m_0),c_2=H(m_0,m_1),…,c_k=H(m_0,m_1,…,m_{k-1})
c1?=H(m0?),c2?=H(m0?,m1?),…,ck?=H(m0?,m1?,…,mk?1?) all by itself,and let
π
=
(
m
0
,
m
1
,
…
,
m
k
)
\pi=(m_0,m_1,…,m_k)
π=(m0?,m1?,…,mk?) and send to
V
V
V for verification
- the key point is the formula
c
l
=
H
(
m
0
,
m
1
,
…
,
m
l
?
1
)
c_l=H(m_0,m_1,…,m_{l-1})
cl?=H(m0?,m1?,…,ml?1?),which implies once
c
l
c_l
cl? is decided,
m
0
,
m
1
,
…
,
m
l
?
1
m_0,m_1,…,m_{l-1}
m0?,m1?,…,ml?1? cannot be manipulated
G. Math Preparation: Polynomial Algebra Over Finite Field
F
p
F_p
Fp?
- Lagrange interpolation of polynomial over
F
p
F_p
Fp?
- Schwartz-Zippel lemma and its magical use in cryptography:testing the validity of polynomial equation by a random evaluation point
- Elementary lemma which converts polynomial equations on a subset
S
?
F
p
S\subset F_p
S?Fp? into polynomial satisfiability conditions on
F
p
F_p
Fp?
H. zk-SNARK
- Parno,Howell,Gentry,and Raykov,Pinocchio:Nearly Practical Verifiable Computation (2013)
- Ariel Gabizon,Williamson and Ciobotaru,Plonk:Permutations over Lagrange-bases for Oecumenical Noninteractive arguments of Knowledge (2019)
- Two different lines of research in cryptography:1) general theory,which aims to prove general theorems in terms of the asymptotic complexity of algorithms; 2) the construction of practical algorithm,which must achieve practical usability under current hardware and other engineering conditions
- Four aspects of understanding ZKP:1) ZKP for specific problems such as 3-colouring of graph and discrete logarithm;2) general theory of ZKP,which is quite complex and rich;3) practical schemes such as zk-SNARK;4) practical application cases such as ZCash
- zk-SNARK presents present day’s mainstream of practical zero knowledge proof schemes
- Performance:proof time,proof size,verification times,setup cost,circuit dependence
- Security:universal / updatable setup,quantum resistance
- The concept of commitment:binding and hiding,commitment construction by DL (离散对数),Pederson commitment
- Converting any NP-problem (within a fixed size) into Boolean circuit and arithmetic circuit
- Arithmetization:converting circuit satisfiability problem into polynomial satisfiability conditions
I. ZKP’s Applications
- Verifiable random function (VRF):given a public input and the private key
s
k
sk
sk of
P
P
P,compute value
v
=
F
(
x
,
s
k
)
v=F(x,sk)
v=F(x,sk), and a proof
π
=
π
(
x
,
s
k
)
\pi=\pi(x,sk)
π=π(x,sk);The correctness of
v
v
v can be verified by anyone using public key
p
k
pk
pk of
P
P
P,namely that
V
(
x
,
v
,
π
,
p
k
)
=
0
/
1
V(x,v,\pi,pk)=0/1
V(x,v,π,pk)=0/1;VRF gives unpredictability,verifiability and privacy (no extra information about the private key
s
k
sk
sk can be gain)
- VRF can be used to construct decentralized lottery,which is essential in PoS consensus in blockchain
- Zcash:the first fully anonymous crypto currency,and also the first large scale deployment of ZKP in real world application scenario
- Application cases in blockchain technology:1) Ethereum scalability through zk-rollup;2) FileCoin and storage proof;3) Dusk and the trading of real world assets (securities);4) Mina and recursive proof;5) Dfinity and internet computer
J. Brief Introduction to MPC
- Shamir,Rivest and Adleman,Mental Poker,1979
- Andrew C. Yao,Protocols for Secure Computations,1982
- Andrew Chi-Chih Yao,How to Generate and Exchange Secrets,1986
- Algorithms for solving the millionaire’s problem,and mental poker problem,their significance:the origin of decentralization which precede blockchain by 30 years
- Yao’s Garbled protocol for 2-party,many practical optimizations
- Secret sharing and n-party protocol,general theoretical results of MPC,Beaver triples and other optimizations.
ON DATA BANKS AND PRIVACY HOMOMORPHISMS
- Rivest,Adleman and Dertouzos,On data banks and privacy homomorphism,1978
- David,Wu,Fully Homomorphic Encryption:Cryptography’s Holy Grail
- Craig Gentry,A Fully Homomorphic Encryption Scheme,2009
- FHE and the out-sourcing of computation
- Arbitrary computation → Boolean circuit → arithmetic circuit over
F
2
F_2
F2? → multivariate polynomial over
F
2
F_2
F2?
- Somewhat homomorphic encryption scheme:
E
(
b
)
=
q
p
+
2
r
+
b
E\left(b\right)=qp+2r+b
E(b)=qp+2r+b with large odd number
p
p
p,random
q
q
q and small
r
r
r;Then
r
r
r is the noise which increases by the operation of addition and multiplication;The computation can be carried on as long as the noise level of the computation result is within the limit of
2
r
<
p
/
2
2r<p/2
2r<p/2
- Gentry’s ingenious idea of bootstrapping;Starting with a somewhat homomorphic encryption scheme, and assume a cyphertext
b
?
b^\ast
b?'s noise level is approaching the limit;Observe that
b
=
D
(
s
k
,
b
?
)
b=D(sk,b^\ast)
b=D(sk,b?),if the SWHE can evaluate the circuit (or the polynomial) corresponding to
D
D
D (with one more additional operation), one can obtain a lower noise encryption of
b
b
b
- Microsoft’s SEAL open-source library;Great performance improvements from the initial
10
13
{10}^{13}
1013 times of ordinary computation to
10
3
{10}^3
103,after over 10 years of optimization efforts
|