zk Proofs Explained
In this article:
- What are zk proofs?
- A zk proof example
- Scalability and Privacy
What are zk proofs?
A zk proof is a cryptographic proof that allows someone to prove that they possess specific information without revealing that information.
There are three fundamental characteristics that define a ZKP:
- Completeness: If a statement is true, an honest prover is able to convince a verifier that they possess knowledge about the correct input.
- Soundness: If a statement is false, no dishonest prover can unilaterally convince an honest verifier that they possess knowledge about the correct input.
- Zero-knowledge: If the state is true, then the only thing that the verifier learns is that the statement is true.
A zk Proof Example
The concept of zk proofs can be hard to wrap you head around. Let’s explain this through the game of Where’s Waldo Imagine a game of Where’s Waldo. You have to search for Waldo in a sea of characters.
You find Waldo, and now you want to convince your friend that you know where Waldo is, without revealing Waldo’s location. How is this possible?
Cut out Waldo from the scene. You can show your friend Waldo, indicating you have found him, but your friend has no idea where Waldo was found.
This is essentially how a zk proof works. In a zero-knowledge proof, one party (the prover) proves to another party (the verifier) that prover knows a value x that fulfills some constraints, without revealing any information about x.
In the Where’s Waldo example, one person proves that they know Waldo’s location, and one person verifies that this is true. All the while, no information about Waldo’s location is revealed.
Scalability and Privacy
Zero-knowledge proofs are a breakthrough in the cryptography space. With respect to blockchain technology, they unlock so much potential. zk proofs allow for greater scalability and privacy.
Previously, blockchains required all pieces of a transaction to be bundled together (verification, validation, and execution). Miners need to validate every single transaction and add it to a new block. To reach consensus other nodes need to check the validity of the transactions by processing each one of them. This can bottleneck the process.
With zk proofs a prover can validate every single transaction, bundle them all together and generate a proof of this computation. The amount of computation necessary to verify a proof is greatly reduced as well. They don’t need to compute all the transactions once again. The verifier only needs to compute (verify) the proof.
Essentially, zero knowledge cryptography is a way to publicly verify that a computation is correct, without revealing the inputs.
Executions can occur off-chain, but they still have them as secure as a standard transaction (this is the concept of a zk rollup). The use of zk proofs can scale blockchains to thousands of TPS and allows for incredibly cheap transactions as they’re computed off-chain and verified onchain in a rollup like @zksync or @StarkWareLtd.
zk proofs are a privacy-enabling technology. The prover can execute a hash function (non-reversible function) on inputs and provide the result of this function and the proof. Using this info, the verifier can verify that the prover actually ran the function and performed the proof. Function inputs are private, so no info is revealed.
Being able to use the blockchain and keep information private is a breakthrough. Privacy is one of the largest barriers of entry to the blockchain space. It’s easy to analyze transaction histories and identify people. There are also reports of government tracking tools that analyze crypto transactions.
Blockchain is set to disrupt countless industries, like healthcare and finance. But this requires private info to stay private.