Zero knowledge proof (ZKP)

berk cicek
6 min readOct 30, 2022

--

What is Zero-Knowledge Proof?

Zero-Knowledge Proof (Zero-Knowledge Proof) is a digital protocol that allows data to be exchanged without the use of two party programs or any transaction-related information.

In its most basic form, zero-knowledge privacy (ZKP) can be thought of as a protocol by which the digital verification process can be performed without the use of passwords or other sensitive data. No information is compromised by the sender or receiver.

This security system enables data communication without sharing it with a third party.

The idea behind the zero-knowledge proof first appeared in 1985. Developers Shafi Goldwasser, Charles Rackoff and Silvio Micali came up with the idea of “Knowledge Complexity”, which is considered the ancestor of this system.Information complexity served as a standard of measure, determining the information required for each transaction between the prover and the validator to be considered valid.

In the context of blockchain networks, the only information exposed on-chain by a ZKP (Zero-Knowledge Proof) is that some confidential information is valid and is known with a high degree of certainty by the prover. Zero-knowledge proof offers so many benefits to blockchain systems and organizations using this technology. It may be possible to verify cryptocurrency transactions without revealing any of the information such as where the transactions came from, where they went, and how much money was transferred.

How do zero-knowledge proofs work?

A zero-knowledge proof allows you to prove the truth of a statement without sharing the statement’s contents or revealing how you discovered the truth. To make this possible, zero-knowledge protocols rely on algorithms that take some data as input and return ‘true’ or ‘false’ as output. The ZKP should provide a combination of operations to be able to process the data without the need to reveal it. In blockchains that use this protocol, the application code runs off-chain. In some examples, the code is executed by a specific (single) node on the blockchain network. For confirming the transactions, only a confirmation of the proper execution is provided to the blockchain. In other words, other nodes don’t see the application code and just confirm its execution. The two main forms of zero-knowledge proofs are interactive and non-interactive. To persuade the verifier that they have specific knowledge, interactive ZKPs need some activities or actions from the prover. Mathematical probability principles are the main actions needed in interactive ZKPs. In the Non-Interactive form of ZKP, no interaction between the prover and the verifier is needed. Verification processes can help after the transaction of data happens. This type needs extra computing power and middle software.

Let us assume there is a blind person and two pill, one blue and one red. To the blind person the pills seem completely identical. Yet, you would like to prove to the blind person that these pills are indeed non-identical without revealing that they are colored differently.

For this, you ask the blind person to hide both pills under the table and bring one pill back up for you to see. After that, (s)he should hide the pill back under the table and then either show the same pill or the other one. As a result, you can prove to the blind person that the colors are different by saying whether he changed the pills under the table or not.

Obviously, the other person might think that you were just lucky and is not yet completely convinced that both pills have indeed different colors. Zero-knowledge proofs solve this problem by repeating the experiment over and over again. After every round, your chance of being consistently right by pure luck goes down by half. So with 5 rounds, you have a 1 in 32 chance of successfully faking. With 10 rounds, it is 1 in 1024, and with 20 rounds, it is about one in a million. This way one can reach any probabilistic level of proof that is desired, although an absolute certainty can never be achieved.

Actual zero-knowledge proofs do not deal with pills, of course, but proof the validity of any kind of data. This includes financial data (transactions) or personal data (passwords, names, etc.).

At a high level, the creation of a ZKP involves a validator asking the verifier to perform a series of actions that can only be performed correctly if the proofreader knows the basics. If the prover only guesses the outcome of these actions, they will eventually be proven wrong by the verifier’s test with a high probability.

Three key features that define a ZKP include:

  • Completeness: If the input is true, the zero-knowledge proof always returns ‘true’.
  • Soundness: If the input is false, it is not possible to trick the zero-knowledge proof to return ‘true’.
  • Privacy: The input can not be obtained by any other party.

Use-cases for zero-knowledge proofs

Proof of Identity

Proof of Identity uses Zero-Knowledge Proof in an authentication process in which one party proves to the other that they have a specific piece of information that establishes the prover’s identity. The prover verifies the required data without providing any more sensitive or personal data in a back and forth between the prover and verifier.

Proof of Passwords

A zero-knowledge password proof (ZKPP) is a zero-knowledge proof that allows the prover to prove to another party (the verifier) that it knows a value of a password, without revealing anything other than the fact that it knows the password to the verifier.

A zero-knowledge password proof prevents any party from verifying guesses for the password without interacting with a party that knows it and, in the optimal case, provides exactly one guess in each interaction.

Vote correctness

Let’s think of a referendum in which the voter is presented with a list of questions, and they have to answer either yes or no to each one of them. In order to encrypt these answers, the voting device (a mobile phone, a laptop, etc.) understands the answer yes as a 1 and the answer no as a 0. In this kind of system, it is important to demonstrate that the value encrypted is indeed a 1 or a 0, in order to prevent a malicious voting device from voting more than once for a question, e.g.: encrypting a choice with the number 3, giving 3 yes votes to a single question. In order to do that, the system generates a zero-knowledge proof to prove that the value encrypted is either a 1 or a 0 without giving any clue about the exact choice that was encrypted.

Universal verifiability

In order to provide universal verifiability, an online voting system should generate evidence which enables anybody to check that the election results have been calculated from votes cast by eligible voters, and that these votes have not been manipulated during the counting process. This evidence is usually provided in zero-knowledge proofs.

Zero-knowledge proofs are gaining more institutional attention and have been adopted by numerous institutions including banks.

Recommended links:

https://vitalik.ca/general/2021/01/26/snarks.html -> An approximate introduction to how zk-SNARKs are possible

https://medium.com/coinmonks/zk-starks-create-verifiable-trust-even-against-quantum-computers-dd9c6a2bb13d -> ZK-STARKs — Create Verifiable Trust, even against Quantum Computers

💻github : berkicekk 💻linkedin : berkicekk

💻Twitter: berkicekkk 💻instagram : berkicek

--

--

berk cicek
berk cicek

Written by berk cicek

Bulent Ecevit University | CENG Student (4) Cuberium | Team Lead (Siber Vatan) | Blockchain Researcher

Responses (1)