to an organisation B They both want to do a transaction, and want the valid result for their inputs Since inputs are important for both organisation A and B, they do now want to reveal that information
to an organisation B They both want to do a transaction, and want the valid result for their inputs Since inputs are important for both organisation A and B, they do now want to reveal that information Do not trust each other
y Holds x Sends f(x,y) Holds y Alice may change her x, and give wrong f(x,y) Or Bob gives y in such a way that info about x is revealed Both Alice and Bob can cheat, and the transaction will have no fairness guarantee
f(x,y) Holds y Third Party Auditor Evaluation of x, y and f(x,y) was correct. OK! Error in evaluation. Not OK! This approach delegates trust to the third party, and our security totally depends on premise that auditor is not malicious or he is not hacked
Bob wants to establish that an asserted NP statement by Alice is valid and True. • Confidentiality of input (P): If NP statement is true, the prover (Alice) can convince verifier (Bob) without leaking any information about her input. • Proofs of Knowledge: Bob wants a guarantee that agreed upon ‘secret input’ exists and Alice knows that ‘secret input ’ • Efficiency: Bob should be able to verify proof in bounded polynomial time.
a pair S=(V,P) where V is verifier and P is prover Verifier Prover Prover should not be able to convince verifier a false statement with negligible probability Soundness
a pair S=(V,P) where V is verifier and P is prover Verifier Prover Prover should not be able to convince verifier a false statement with negligible probability Soundness Prover should be able to convince verifier true statement with absolute certainty Completeness
a pair S=(V,P) where V is verifier and P is prover Verifier Prover Prover should not be able to convince verifier a false statement with negligible probability Soundness Verifier should be able to verify the validity of arguments in polynomial time Efficiency Prover should be able to convince verifier true statement with absolute certainty Completeness
A problem in NP-Complete can be converted to another problem in NP-Complete in polynomial time w.r.t to length of input. • So, if you can construct a proof for one problem, all other problems could be solved by converting to the prior problem. • Another advantage of such language is that they can be verified in bounded time, but cannot be solved easily.
of a computation. Zero knowledge proofs are a subset of proof system, with an additional constraint of “hiding” or “zero knowledge”. Sends E(y) Holds x Sends E(f(x,y)) Holds y
of a computation. Zero knowledge proofs are a subset of proof system, with an additional constraint of “hiding” or “zero knowledge”. Sends E(y) Holds x Sends E(f(x,y)) Holds y Here key element is that we have used E(..), a hiding scheme which does not reveal y to Alice and x is not revealed to Bob
of a computation. Zero knowledge proofs are a subset of proof system, with an additional constraint of “hiding” or “zero knowledge”. Sends E(y) Holds x Sends E(f(x,y)) Holds y Here key element is that we have used E(..), a hiding scheme which does not reveal y to Alice and x is not revealed to Bob Both Alice and Bob Learns nothing
interactively solve puzzles while guarding their knowledge, and verifying the computation. • After k times, verifier will probabilistically be able to assert that prover has a very less probability to cheat, as he provided with different inputs, and prover has to provide right solution every time. (Soundness and Completeness) • That will only happen if prover knows right input and did right computation.
two parties, and in practice, it is slow and hard to achieve. • NIZK proofs are preprocessed ZKP, which needs to be published at untampered memory. Blockchain could be such memory. • Interesting properties of NIZK proofs Publishes a proof π Generates VK and PK keys, so proof π can be mathematically reproduced by PK and verified by VK Needs a trusted setup to generate a CRS, which can be seen by both prover and verifier.
good pseudorandom generator. • It requires a trusted setup. • These parameters are used to generate a “Common Reference String”, which can be seen by both Alice and Bob, or more formally Prover and Verifier. • The initial parameters used to generate CRS needs to be securely destroyed, otherwise CRS could be spoofed.
Bob and explored some solutions along with third party • Saw the construction of interactive zero knowledge proofs and non-interactive zero knowledge proofs
Stands for Succinct non-interactive arguments of knowledge. • We need Proof length to be short (that’s why succinct) Verifiable in short amount of time (that’s why NI) And of course, we need to show that we know an input which yields a certain computation (that’s why ARKs)
pieces Cryptographic proof system for verifying satisfiability of arithmetic circuits Circuit generator to translate program executions to such circuits
problems in NP. For above construction we use Circuit-SAT satisfiability problem • It is NP-Complete problem, and a variant of Boolean Satisfiability problem. Efficient constructions from arbitrary program to arithmetic circuits exists in literature. Quadratic Arithmetic Program (QAP)
to polynomials defined over a prime field Fp , where p is prime number. Computers are not good with handling arbitrary large numbers, so having a upper bound is good assumption Field arithmetic allows trapdoor functions, which are harder to solve unless secret trapdoor is known. For eg. Discrete logarithm problem. Arithmetic involves simple addition and multiplication defined over field i.e modular arithmetic Solve for: t(x)h(x) = w(x)v(x)
zero knowledge, the integrity of computations. Exit Code 0 C program foo Input bar Additional input qux Arithmetic circuit foo Accepts the partial assignment bar, when extended into some full assignment qux
zero knowledge, the integrity of computations. Exit Code 0 C program foo Input bar Additional input qux Arithmetic circuit foo Accepts the partial assignment bar, when extended into some full assignment qux f(x) Set of constraints foo
zero knowledge, the integrity of computations. Exit Code 0 C program foo Input bar Additional input qux Arithmetic circuit foo Accepts the partial assignment bar, when extended into some full assignment qux f(x) Set of constraints foo Accepts the partial assignment bar, when extended into some full assignment qux
zero knowledge, the integrity of computations. Exit Code 0 C program foo Input bar Additional input qux Arithmetic circuit foo Accepts the partial assignment bar, when extended into some full assignment qux f(x) Set of constraints foo Accepts the partial assignment bar, when extended into some full assignment qux Verifier accepts
polynomials 1. Blind evaluation of polynomials 2. Making blind evaluation of polynomials verifiable 3. Zero knowledge Construction 1. Satisfying QAP (Pinocchio Protocol ) 2. Pairings of elleptic curves
able to deduce “s”, so rather than providing input s, we provide E(x) s.t • E(x) is a homomorphic hiding scheme s.t I. Given E(x), it is hard to find x II. If x ≠ y, then E(x) ≠ E(y) III. E(x + y) = E(x) + E(y) • This is mainly used to hide verifier challenges t(x)h(x) = w(x)v(x) E(t(x))E(h(x)) = E(w(x))E(v(x))
x will be really hard, as degree of this polynomial can go as much as 2^21 • To make our proof efficient, we chose a random s, s.t This reduces our problem to equating variables and doing simple multiplication and addition. Even so, it is compute intensive work. Instead of (s0 , s1 , s2 …sd ), we chose to send (E(s0 ), E(s1 ), E(s2 )…E(sd ) ), where d is degree of polynomial, and can be published in CRS. S is one of those parameters that needs to be destroyed. However Alice may ignore (E(s0 ), E(s1 ), E(s2 )…E(sd ) ) and pick her own values, so we need to verify the evaluation of polynomials t(s)h(s) = w(s)v(s)
(KC Test) • For α ∈ Fp, a pair (a,b) in G is an α pair if • a,b ≠ 0 • b = α . a • Given an α pair (a,b) • There exists no way to deduce a from b. • Only way to generate same α pair, is by selecting random k s.t k*b = α . (k* a)
Bob choses random α ∈ Fp and s ∈ Fp and sends d alpha pairs (E(s0)…E(sd) ) and (α . E(s0)… α .E(sd) ) to Alice, and in return Alice returns one alpha pair (a’, b’), where with negligible probability Alice knows (c0, c1, c2…cd ) ∈ Fp s.t • Bob sends an alpha pair to Alice (s, α.s) s.t • Alice computes a = P(s) and b = αP(s) • Bob checks if b = α . a, and accepts if and only if equality holds. ∑i d ci si .g = a’
and size m consists of polynomials L1…Lm, R1…Rm, O1…Om and a target polynomial T of degree d. An assignment (C1…Cm) satisfies Q if (i) L:= ∑i m ci Li (ii)R:= ∑i m ci Ri (iii) O:= ∑i m ci Oi (iv) P:= L . R - O , we have T divides P or P=H . T As we saw earlier, we do not need to evaluate for x, but rather chose s ∈ Fp such that P(s) = H(s).T(s)
most d • Bob chooses a random point s ∈ Fp and computes E(T(s)) • Alice sends Bob the hidings of all these polynomials evaluated at s i.e. E(L(s)), E(R(s)), E(O(s)), E(H(s)) • Bob checks if the desired equation holds at s That is, he checks whether E(L(s)⋅R(s)−O(s))=E(T(s)⋅H(s)). To simplify construction we reduce L,R,O to a single polynomial F F=L+Xd+1⋅R+X2(d+1)⋅O *Note that all coefficients do not mix, as they are separated by degree d
for polynomials. • Since maths for this is a little tricky, it would be better if you check out these resources 1.Elliptic curve pairing 2.Exploring Elliptic curve pairing
Eli Ben-Sasson 2. ZK-Snarks in nutshell by Christian Reitwiessner 3. How ZK-Snarks work in zcash 4. ZK-Snarks under the hood by Vitalik Buterin 5. Pairing for beginners by Craig Costello