Zero-knowledge proofs, or ZK proofs, are a type of cryptographic encryption that hides the details of a blockchain transaction. Why is this important?
Blockchain uses a large network of computers scattered around the world to verify transactions. These computers are called nodes and they must agree on the authenticity of the data being examined before adding it to the blockchain. This is called a “consensus mechanism”.
Since data is shared among so many computers around the world, user privacy is obviously a concern.
Additionally, blockchains focus more on decentralization than user privacy. This means that the nodes continue to be integrated into the network to keep the database as distributed as possible. Additionally, blockchains use public ledgers from which a user’s wallet address can easily be accessed using a blockchain explorer.
Read also :
So how can blockchains ensure that user privacy is protected in such a scenario? This is where ZK proofs come in!
What are ZK proofs?
ZK proofs are a way to authenticate data without revealing the data itself. This concept is designed to ensure that the prover (whose data needs to be authenticated) does not unnecessarily share data with verifiers (nodes). At the same time, verifiers can ensure that the Prover data is valid.
Since the verifier does not know the actual information being verified – he only knows that the data is true – these are called “zero-knowledge proofs”.
How do ZK events work?
This is a very intriguing concept, so let us understand with an example. Think of this consensus mechanism as the process of protecting a secret. Alice knows a secret (Prover) which must be verified by Bob, Charles, Dylan and Eunice (Verifiers). But she can’t tell the auditors what the secret is.
In such a situation, the four verifiers will tell Alice to perform specific tasks that she can only perform if she knows the secret. If she completes them, the verifiers automatically know that Alice’s secret is true without knowing the secret itself. Tasks act as ZK proofs for verifiers.
If Alice were to keep guessing, the other four would catch her lying while testing her with predefined tasks. It works in person – when Alice performs the tasks in front of the four verifiers. However, a blockchain is a distributed network and the prover will probably never interact with the verifiers. So what happens then?
In this case, we can add a camera recording to this mix – the verifier sees Alice performing these tasks and then decides whether she knows the secret or not. And to ensure complete fairness, dice are also introduced to randomize tasks.
Checkers ask Alice to roll a die and choose a task based on the number she rolls. If this were to be recorded on a camera and shown to the verifiers, they would believe it because Alice was made to pick a task at random, and she successfully completed it anyway. It’s worth noting that even new verifiers wouldn’t need to know her secret to believe she knew it.
What are the types of ZK evidence?
There are two types of ZK evidence:
• Interactive ZK proofs: When the prover and verifiers interact with each other to establish the validity of the data, the tasks are observed in person. These are called “knowledgeless interactive proofs”. Regarding our example above, Alice’s interaction with Bob, Charles, Dylan, and Eunice falls under interactive ZK proofs.
• Non-interactive ZK tests: Sometimes the prover and verifiers do not interact at all. Instead, they agree with the verdict of a relying party, hence the term “zero-knowledge non-interactive proofs”. Regarding our example, using the camera recording to prove that Alice’s knowledge of the well-kept secret falls under the non-interactive umbrella of ZK Proof. Camera recording is the third party they trust.
The technology that uses the concept of ZK Proofs to power its consensus mechanism is called Zero-Knowledge Succinct Non-Interactive Argument of Knowledge aka zk-SNARK.
ZCash is one of the most notable projects that use zk-SNARK to ensure user privacy. When transactions are processed on ZCash, the blockchain only knows the transfer amount and sender/receiver destinations. Real identities remain completely protected. This technology allows blockchains to maintain complete anonymity while ensuring a secure and tamper-proof transaction.