Explaining the concept of zero-knowledge proof to someone isn’t exactly something that comes up often. If you were to ask the average person on the street what it may be, there is a good chance they wouldn’t be able to tell you. However, once understood, zero-knowledge proofs are an incredibly valuable aspect of cryptography that establishes a level of trust that’s hard to beat.
A simple analogy to better understand how a zero-knowledge proof works are to imagine a deck of playing cards. A standard deck of cards is made up of 52 cards, 26 red, and 26 black. By randomly drawing a card Party A can prove to Party B that the card drawn at random is a red card, without actually sharing any other details about that card.
To prove that the card drawn was a red card Party A could show Party B 26 black cards, proving simultaneously that all black cards are present ensuring that the card is not black, and therefore, the card must be red.
Zero-knowledge proofs work successfully provided the environment where they take place meets certain criteria. First and foremost is completeness, meaning as long as both parties are absolutely honest with each other a zero-knowledge proof scenario can be successfully executed.
The second criteria important for a zero-knowledge proof is soundness, ensuring that if one party doesn't actually know what card is drawn, they can't attempt to prove that they know. If a red card is drawn at random and Party A tries to prove to Party B that the card is actually red, it would be impossible with 26 black cards being seen, proving Party A's dishonesty.
The third criteria is where this concept gets its name. This is from the fact that Party B does not learn any more information about the randomly drawn card other than its red. They don't learn the number or the suit. Party B gains zero-knowledge about the card.
Understanding this concept provides context for how information is shared in a fully secure way and opens up numerous possibilities for zero-knowledge proofs to be used.