Zero-Knowledge Proofs: keeping a secret a secret.
Certain situations in our lives require us letting people know we have the authority, or capability to do something, however we don't always want to disclose the details. When you apply for an appartment, how do you let the landlord know you can afford the rent without sharing your salary? When participating in a secret auction, how do the owners announce the winner without revealing any bids? This would be simple if everybody could be perfectly trusted, but when dealing with finances, reputation, and security, all parties want to ensure everything is truthful and fair. In some cases, proving you know a secret is equivalent to proving your identity; for example, if you had a recipe with a secret ingredient that only you knew, proving to others you know the secret ingredient would prove the dish you shared is indeed yours. In these cases, it is crucial that this information does not leak.
A solution to this problem became the basis for Zero-Knowledge Proofs (ZKP), techniques and protocols used in cryptographic proofs of authentication or knowledge without revealing any details. The original definitions of ZKP were based on an interaction between a pair of verifier and prover [1]. In many of these situations, a secret is known that grants a user authentication or verification. If this secret is stolen, others could pose as the original user and gain access to cryptographic systems.
The most essential properties of a zero-knowledge procedure is that an interaction between a verifier and prover can only end with the prover claiming its knowledge of a value x if the prover does in fact know x. The crucial result of this is that a prover who does know the secret cannot trick anybody into thinking otherwise; these two properties are known as completeness and soundness respectively. This is paramount for trustless systems; without the existence of a safeguard, a non-authenticated user could lie about its credentials in the hopes of fool others. The protocol should yield zero-knowledge to the verifier, meaning the verifier learns no new information from its interaction with the prover. Our last property is that of computational efficiency; in any cryptographic system, the time complexity taken for this verification should be quick [1].
Other use cases for ZKP include proving you have enough money for a transaction, proving you are a member of a group without revealing your identity, proving you know the location of a hidden object without revealing the location, and proving you know the solution to a puzzle without sharing it [2].
Example - Discrete Log Problem [3]:
Consider the key value y = gx \mod p for large prime number $p$, a value often used in public-private key cryptography [4]. In this case, the values of g and p are publicly known, but x is a secret known only to those authenticated in the public-private key cryptographic system. For large values g and p, finding this value x such y = gx mod p can be very difficult and not possible to do by brute force in a reasonable time.
Suppose user A chose a random value of x, calculated y=gx mod p, and distributed y to parties with whom A wishes to connect cryptographically. If a new member B arrives and is given y, B wants to verify if y actually came from A as claimed, and thus that there exists encrypted communication with A. How does A prove this fact to B without sharing any more details than is already known, in this case the values g, p and y.
The following protocol repeats T>1 times:
- Step 1: A chooses a random value r in {1,...,p-1} and sends c = yr to B.
- Step 2: B send back a random binary value b to A.
- Step 3: A will return d = r + bx mod (p-1) to B.
- Step 4: B will verify if gd mod p = c yb mod p.
This procedure is executed multiple times because it is possible for A to guess the value of b and fake an answer. If A guesses correctly that b=0, then A would be able to convince B with a random r and the appropriate c; however, if A knows b=1 will be requested, A can compute c' = gr/y mod p to give to B followed by d=r'. From Step 4, this verification would yield gr' mod p = c' y mod p = gr'/y y mod p. By requesting different values of b over several iterations, this ensures A can only pass every test if the value *x is known.
Example - Undeniable Signature [5]:
Similar to the previous example, suppose the public key y=gx is known however x is known only to A. Using x, A can sign a message m to communicate that the message was approved and sent by A; this signature is z=mx. The following protocol proves the valid signature of A without revealing x when g, y=gx, m and z are public:
- Step 1: A chooses a random value r in {1,...,p-1}, B chooses two random values a, b in {1,...,p-1}. Each party does not yet reveal their values.
- Step 2: B sends the value c = ma gb to A.
- Step 3: A send the pair {ma gb+r, (ma gb+r)x} = {c gr, cx grx} to B.
- Step 4: B sends values a and b to A to reconstruct Step 2.
- Step 5: Once the reconstruction is successful, A sends value r to B to reconstruct Step 3:
{ma gb+r, (ma gb+r)x} ={ma gb+r, za yb+r}.
Once this last step is verified, B has confirmed that the signature z is valid and came from A without A ever having to share the secret key x.
Zero-Knowledge Range Proofs
Zero-Knowledge Range Proofs(ZKRP) allow for flexibility in the value claimed. For a user A with secret x and a verifier B, a ZKRP suffices to prove to B that the value x is within a certain range of numbers, without ever specifying x. This can be useful with credit checks for an apartment for A to say its salary is enough without stating it. Geographically, A could make a claim about in which country the user resides, without pinpointing a location. Cryptographically, both ZKP and ZKRP have seen prototypes for use in blockchain technologies [2] as well as the fully private cryptocurrency Zcash [6].
ZKP can serve as a powerful tool in modern cryptography to prove without doubt one's authentication, signature, or credibility without the need to divulge any secrets. Privacy and security are of the utmost importance to many users and applications, and ZKP contribute to the verification and concurrent hiding of absolute truths in a trustless system.
References
[1] S. Goldwasser, S. Micali, and C. Rackoff, “The knowledge complexity ofinteractive proof systems,”SIAM Journal on computing, vol. 18, no. 1,pp. 186–208, 1989.
[2] T. Koens, C. Ramaekers, and C. Van Wijk, “Efficient zero-knowledge rangeproofs in ethereum,”ING, blockchain@ ing. com, 2018.
[3] D. Chaum, J.-H. Evertse, and J. Van De Graaf, “An improved protocol fordemonstrating possession of discrete logarithms and some generalizations,”inWorkshop on the Theory and Application of of Cryptographic Techniques,pp. 127–141, Springer, 1987.
[4] W. Diffie and M. Hellman, “New directions in cryptography,”IEEE trans-actions on Information Theory, vol. 22, no. 6, pp. 644–654, 1976.
[5] D. Chaum, “Zero-knowledge undeniable signatures,” inWorkshop on theTheory and Application of of Cryptographic Techniques, pp. 458–464,Springer, 1990.
[6] “Zcash.” http://z.cash. Accessed: 2020-04-19.