BACK

ZK101

What is zero-knowledge?

A zero-knowledge proof (ZKP) is a protocol that enables one party, called the prover, to convince another, the verifier, that a statement is true without revealing any information beyond the validity of the statement. While the concept of proving something without sharing any information might sound absurd, the core idea is surprisingly intuitive.

We’ll give an example with a story about two friends. Penny wants to prove to her stubborn classmate Victor that she knows the password to his locker, who won’t “believe it ‘till he sees it”. But there’s a catch– their classmates are super nosy. Even if she whispers or scribbles it on a note, the whole class will magically have figured it out before the end of the day, and poor Victor will have to deal with half the class mysteriously “borrowing” his snacks… Somehow, she needs to convince Victor she has the password without giving it away.

She decides on the following plan. Before the end of the day, Victor will choose whether or not to put a red ball in his locker. Penny will wait until after the entire class goes home to leave, and tell Victor the next morning whether or not there was a red ball in his locker the day before. After a few days of this, he has to be convinced that Penny does in fact know his password.

Let’s take a look at the math. In the case that Penny does in fact know the password, she unlocks Victor’s locker every single day to see whether or not a red ball is there, so she will always give a correct answer with probability 1. This also means that if Penny did know the password, she will never be wrong– a single incorrect answer will immediately tell Victor that Penny is lying. However, even if Penny doesn’t know the password, there’s a ½ chance she’ll just guess it right anyways. The probability that she guesses correctly N days in a row is (½)^N, which very quickly goes to 0. Therefore, after just a week of shenanigans (read as: Penny being correct), Victor finally decides to change his password.

Many ZKPs generally rely on one party being able to demonstrate a result that would have been difficult to achieve or probabilistically unlikely to guess correctly without the knowledge of some underlying secret to aid in the task. Statements of NP-hard problems, which have solutions that are easy to verify but difficult to compute, are common candidates for ZKP constructions, as they naturally lend themselves to proofs where a verifier can quickly check correctness without learning how the solution was derived. 

Why do we care about ZK?

Interestingly, the real utility of ZKPs extends much farther than just proving abstract mathematical results or helping some kids protect their school supplies. Historically, cryptographic protocols were designed for narrow, specialized use cases, tailored to specific claims or privacy mechanisms. But this all changed with the introduction of zkSNARKs– a protocol allowing anyone to prove any statement without revealing any previously-unknown data, all in a compact, easily verifiable format. We’ll dive more in-depth into zkSNARKs in another blogpost, but its introduction has led to a Cambrian-explosion of general-purpose cryptography, allowing anyone to make statements about digital identity, sensitive financial information, and more.

For now, the (very simplified) point we’ll focus on is that zkSNARKs give a way to create and verify a ZKP for any statement that can be encoded in an algebraic expression. And surprisingly, most statements can be boiled down to an algebraic expression.

Taking our example again, let’s look at things from a different perspective and imagine that Victor has already decided on his pattern of which of the next N days he’ll put a red ball in his locker. This can be encoded as an N-bit binary string, and let’s say his passcode can be translated into another binary string of length \lambda. 

Something interesting happens now– Victor can hash both of these values independently, and publicly broadcast the product of both these hashes to penny. Victor challenges Penny to decode the hash of his N-bit binary encoding from this product, which would be nearly impossible if Penny didn’t already know Victor’s passcode. This ZKP becomes equivalent to Penny proving that she knows one of the factors of this product, which she can divide out to reveal the hash of Victor’s secret binary pattern. Even while knowing that the result is an N-bit binary string, Penny must check 2^N different long divisions to see if one of them ends up being one of the factors of this product, and there’s still a (½)^N chance that she’ll randomly guess the correct one.

Many other seemingly complex statements can also be transformed into algebraic expressions, which combined with modern ZK machinery gives a streamlined way to prove and verify even extremely general-seeming statements.

ZKPs are accessible.

Just as how ZKPs are much more than a tool for proving arbitrary mathematical statements, deploying ZKPs is no longer just a niche tool for cryptography experts either. Robust and computationally efficient zk-SNARKs from the past decades of academic research now exist as open-source libraries, meaning that anyone can build their own verifiable, private, and scalable applications.

One of the most widely used libraries for writing ZKPs is Circom, a language designed for writing arithmetic circuits that seamlessly integrates into popular proving systems like Groth16 and PLONK. In our example, a Circom proof demonstrating two numbers multiplying to a third value can be implemented in just 6 lines.

In the past 5 years, many powerful successors to circom, like Halo2, Arkworks, and ZoKrates, have already come to life and integrate with even more efficient and powerful proving systems to bring ZK proofs closer to mainstream adoption. On top of that, services like Fermah make proof generation effortless and cost-effective, letting users create and submit proofs without worrying about computational overhead or verifier compatibility. 

Conclusion

ZKPs are emerging as one of the most powerful cryptographic advancements of our time as they evolved from a theoretical curiosity to a practical, accessible tool that enables privacy and trust in a wide range of applications in just a matter of years. What once required deep cryptographic expertise can now be implemented with high-level libraries, efficient proving systems, and user-friendly services that abstract away much of the complexity. As research and tooling continue to advance, the barriers to entry are lower than ever—making it possible for developers everywhere to build and deploy privacy-preserving applications with ease. The era of zero-knowledge cryptography isn’t just coming—it’s already here.