# What Is ZK Proof In Blockchain

This article explains the concepts of the zero knowledge proofs in blockchain.

Blockchain platforms like Bitcoin, Ethereum and many others which are public blockchains provides all transactions to be available publicly and open to all. This means that anyone in the public can track and see who is sending, who is receiving and how much is transacted. Thus, such type of platforms would be revealing the whole history of any user describing the transactions performed by that account, amounts received and transferred by that accounts and other personal information.

Such level of openness may be uncomfortable or unacceptable for many users. Keeping track of any account can lead to hacking and stealing activities by anyone from the public. Thus, there arises many questions such as how we can make things a little more private? How can we perform transactions without revealing any personal information in the public?

One solution to all our questions is to hash all transactions with the public key of recipient, thus making it readable only by them. It sounds like a great solution but it also brings several other issues with it. One of the issues is, what if the output data of a transaction is required to approve other transactions and also need to be used as input data for future transactions? Hashed data can't be used for this purpose.

If you don't understand hashing, here is an article, Theory of Hasing and Hash Tables.

Now, if we are going with this solution then our first step would be to prove that the data which is going to be encrypted should be valid without loosing our privacy at any cost.

So, how to carry out this step? Mm… well the answer is ZK Proof, the “Zero Knowledge proof”. Constructing a Zero - Knowledge proof helps us to prove someone that we possess some information without revealing it to anyone.

A typical way of defining zero knowledge proof is,

*"A*

*Zero - Knowledge proof*

*is a cryptographic method which helps one person (prover) to prove another person (verifier) that they have possession of some information without revealing that information to verifier or anyone."*

This method was first conceived in the year 1985 by Shafi Goldwasser, Silvio Micali and Charles Rackoff in their paper

*“**The Knowledge Complexity of Interactive Proof System.**”*Let’s understand the method more clearly with an example.

Let's say your friend is a color blind. You have two colored balls; one is blue and one is red. Both of these balls are identical besides their colors. For your friend they are totally identical and he is not easily convinced that both balls could be distinguishable. Now, you want to prove to him that they are in fact have different colors but on the other hand you don’t want him to know which is red and which is blue.

So, here is how your proof method works.

You give both balls to your friend so that he is holding one in each hand. Now, you know which color ball is in which hand but you don't want him to know that.

Now, you tell your friend to put the balls behind his back. Next, either he can switch the balls, or leave them as it is, with the probability of 1/2.

Now he brings out the balls from his back and asks you to guess whether the positions of the balls are being changed or not. Looking at the colors, you can easily say that the positions of the balls are changed or not.

If this process is repeated, your friend is most likely to convinced that the balls are indeed of different colors. Furthermore, the proof is said to be “Zero - Knowledge proof” because your friend will never learn which ball was of blue and which was of red; indeed no knowledge gained on how to distinguish the balls.

## Use case

One of the zero knowledge usecases is Identification. Identification schemes include methods by which a user can prove his or her identity without revealing any of his or her information that could be used by the person keeping track on his or her account.

Traditional ways of performing identification were with the help of secret key, password or pin. But such ways were proved to be extremely insecure as they were easy to guess. After that Biometric data such as fingerprints, retinal scans etc. were used to protect personal information or any kind of confidential data. But such method reveals information about your body and so it can be misused. Then came digital signatures and public - key cryptography systems which helped in keeping things a private than the others discussed.

Now, zero knowledge protocol consists of 3 conditions that are needed to be fulfilled,

*Completeness*

During the process, the information is true and the protocol is followed properly, then the verifier will be convinced naturally.

*Soundness*

During the process, the information is false than the verifier will not be convinced easily.

*Zero - Knowledge*

During the process, if the information appears to be true then the verifier won’t be able to learn anything about the information other than the reality that the statement is true.

## Types

There are two types of Zero - Knowledge (ZK) proofs:

*Interactive ZK proof*

In this type of proof, there are multiple interactions between the prover and verifier until the verifier is not satisfied that the prover has the possession of that information he claims to possess.

*Non - Interactive ZK proof*

In this type of proof, there is less interaction between the prover and the verifier.

## Conclusion

As there is a growing interest going on in privacy and applicability of blockchain, more efforts are done on building sound and complete systems for providing privacy protection.

**Note***I*

*don't have rights to any images attached to this article.*