Have you ever felt the immense frustration of knowing secret information but being unable to ‘prove’ it without sharing it? Then zero-knowledge proofs might be your ultimate solution.
A zero-knowledge proof (ZKP or ZKProof) is an authentication system that allows two parties to confirm whether or not a statement is true without revealing any information about it.
In today’s world, protecting your data and your cryptocurrency online is more important than ever. ZKP systems are used to build blockchain-based privacy solutions that safeguard your information while letting you prove your statements are true.
This guide will uncover your burning questions about ZKProof and demystify this misunderstood topic. Let’s dive in.
What is a Zero-Knowledge Proof?
Despite being popularized by the growth of crypto and blockchain technology, the first records of zero-knowledge proof being used as an authentication system exist as far back as 1985. Computer science and machine learning experts Shafi Goldwasser and Silvio Micali published an MIT paper on ZKPs long before Ethereum was a reality.
Using cryptography, zero-knowledge protocols establish trust and confirm factual statements. Sounds simple, but here’s the twist: ZKPs allow a ‘prover’ and a ‘verifier’ to ensure a statement is true without actually sharing the statement. This proof protocol offers greater cybersecurity for users who don’t want to reveal private information.
For the sake of simplicity, let’s give an ELI5 example. A ZKP would allow me, a prover, to show you, a verifier, that I know where Waldo is without actually pointing to him in the book. I can prove the statement without revealing any sensitive information.
How Does Zero-Knowledge Proof Work?
For a zero-knowledge protocol to be truly effective, the algorithm must prove a statement is true while maintaining three simple requirements.
- Completeness – If the statement provided by the prover is true, the ZKP will always return the same ‘true’ result. Everything true can be proven.
- Statistical Soundness – If the statement provided by the prover is untrue, the verifier needs to be able to confirm its inaccuracy. Essentially, a prover cannot lie and deceive an honest verifier.
- Zero-Knowledge – The ZKP must only reveal whether the prover is telling the truth to the verifier.
While this might seem complicated at first, it becomes very simple to understand when put into practice. Perhaps the most famous example of a zero-knowledge proof system is the Ali Baba cave story.
An Example of Zero-Knowledge Proof
The Ali Baba cave tells the story of Bob, the prover, and Alice, the verifier. Imagine a cave that forms a loop. Somewhere in the loop is a locked door that can only be opened and passed through with a correct password. Bob wants to prove to Alice that he knows the password without actually telling Alice what the password is.
Alice and Bob create a trusted setup for their zero-knowledge protocol. If Bob truly knows the password, like a private key, and can pass through the door, he should be able to return to Alice at the cave entrance from either side of the loop.
Testing the theorem, Bob waits by the magic door for Alice to call him back to the entrance from either path. Bob can return via the correct path with 100% accuracy whether she calls A or B.
We can be sure this is an effective interactive proof system because:
- It is complete – Bob proves he knows the password because he returns from the correct path with 100% accuracy
- It is sound – Bob cannot pass the door without the password. If he returns from the wrong path, Alice can verify that he doesn’t know the password.
- Bob cannot trick Alice into thinking he knows the password.
- Zero-knowledge is shared – Bob can prove he truly knows the password without sharing any secret information.
Different Types of Zero-Knowledge Proofs
Just when you thought you had it all figured out, there’s a bit more to dissect. The Ali Baba cave is one example of several different types of zero-knowledge proofs. Primarily, ZKPs are divided into two main groups: interactive and non-interactive.
Interactive Zero-Knowledge Proofs
The Ali Baba cave is an example of an interactive ZKP. That means that both parties need to interact continuously with each other to ensure the trusted setup remains reliable.
This poses some problems. Interactive ZKPs can be time-consuming and rely on both parties being available. As a result, this type of zero-knowledge proof suffers from scalability issues. Fortunately, blockchain technology offers ways around this, such as non-interactive zero-knowledge proofs.
Non-Interactive Zero-Knowledge Proofs
In a non-interactive ZKP, both the prover and the verifier have access to a shared public key. This key ensures that only one round of communication between parties is required to demonstrate the prover’s statement.
The prover shares information with a secure cryptographic algorithm which confirms whether the statement is true or false. Then, the result is passed to the verifier. The verifier cross-references the prover’s statement against a separate algorithm to ensure accuracy.
In the same way that blockchain smart contracts can streamline financial transactions, non-interactive proofs are more efficient than interactive proofs. Moreover, once a proof is created, anyone with access to the shared key and algorithms can use it for verification purposes.
Of course, the rabbit hole goes even deeper! Underneath the umbrella of non-interactive zero-knowledge proofs are yet more varieties, ZK-Snark and ZK-Stark.
A ZK-Snark is a long-winded acronym for a particular type of ZKP. It stands for:
- Zero-Knowledge – As we already know, a prover can confirm the truth of a statement without sharing secret information.
- Succinct – Proofs are small and easy to verify, even if the concept being proven is complicated
- Non-Interactive – Provers and verifiers don’t need to communicate back for forth for the ZKP to function correctly
- Argument – The proof is sound, meaning a verifier can debunk the prover’s statement.
- Knowledge – The algorithm ensures that the prover’s information is correct
Ultimately, ZK-Snarks are designed to be permissionless, secure, and scalable tools to show proof of knowledge without said information.
ZK-Starks are essentially the same as ZK-snarks. The critical difference between the two is that ZK-starks are optimized for greater scalability and produce larger proofs. Instead of being succinct and non-interactive, ZK-starks are:
- Scalable – ZK-starks are designed to verify larger statements faster.
- Transparent – ZK-stark proof systems are publicly verifiable based on generated random values, as opposed to being verified by private algorithms.
What can Zero-Knowledge Proofs Be Used for in the Real World?
While the real-world applications of blockchain technologies like Bitcoin and Ethereum are obvious, ZKProofs are only now coming to the forefront of on-chain innovation. Many use cases of ZKPs are still being discovered. Here are some of the most exciting real-life utilities of ZKProofs:
Demonstrate Proof of Funds
In many countries, it’s common practice to show your bank statements and income whenever you want to take out a loan or buy real estate. However, not everyone wants to disclose every detail of their life and expenses.
ZKPs allow users to show they have sufficient proof of funds and income without revealing their entire transaction history to unconcerned parties.
Safeguard Your Identity Online
KYC procedures and other identity collection providers store sensitive data on centralized servers in their existing format. This can be problematic because a security breach could result in your information being shared without your consent.
Zero-knowledge proofs let you easily verify your identity online without exposing your personal information to anyone. For example, you can prove you’re a citizen of your country without sharing any of your passport details.
Send and Receive Secure, Anonymous Payments
One of the main benefits of using cryptocurrency and blockchain technology is taking back your privacy online. However, if your wallet address is linked to your identity, it can be difficult to maintain this anonymity.
ZKPs and privacy focussed blockchains make it easier to protect your wallet and transactions from prying eyes. By mixing and shielding transactions, these protocols offer users greater anonymity when sending and receiving funds on-chain.
Zero-knowledge proof systems are powerful tools. Unsurprisingly, they demand high computational and hardware costs to run effectively. As a result, they can be costly for providers to operate.
Additionally, confirming and verifying ZKProof transactions on-chain is intensive and requires a high gas fee. Fortunately, as more scalable blockchains, like Avalanche, and Layer-2 solutions surface, these fees will reduce.
What are some Zero-Knowledge Proof Cryptos?
The ZKProof narrative is an established and competitive niche in the crypto market. Here are some examples of crypto startups and blockchain projects that use zero-knowledge proofs.
Zcash is a blockchain network that allows users to instantly send and receive cryptocurrency anonymously without sharing sensitive information about the transaction. On other networks like Bitcoin and Ethereum, all transaction data, such as the addresses and the transaction’s value, is publicly verifiable.
By default, the Zcash network uses ZKPs to hide this secret information automatically and give users greater peace of mind.
Tornado Cash is a token mixer that allows users to ‘hide’ transfers between unlinked wallets. Leveraging ZKProof technology, the user can deposit funds into the app from one wallet, then withdraw those funds to a new wallet using a secret key.
The protocol made headlines in 2022 when its founder, Alexey Pertsev, was arrested in The Netherlands. According to prosecutors, Tornado Cash facilitates money laundering services for criminals. Despite this claim, Tornado Cash is a decentralized service with no true owner or motivation.
Non-interactive zero-knowledge proofs are efficient but far from perfect. This technology is still in its infancy and newcomers need to trust developers completely to create a trusted setup, creating an imbalance of power.
Zero-knowledge proofs are a disruptive use case of blockchain technology that can change how we share sensitive information online. It’s important to be aware of how they function so that you can use them effectively.
What is the difference between interactive and non-interactive zero-knowledge proofs?
An interactive zero-knowledge proof system requires participants to frequently engage with each other to ensure the proof remains valid. A non-interactive ZKProof uses cryptography and a shared key to remove this requirement.
What is a disadvantage to using zero-knowledge proofs?
ZKProofs are intensive protocols that demand high computational power. They require expensive hardware and on-chain transaction costs to operate effectively.
What is a zero-knowledge proof example?
The most well-known example of a ZKProof is the Ali Baba cave analogy outlined in this guide.