Zero Knowledge

Zero Knowledge Cryptography is a very abstract concept that is hard to understand for people not initialized in the cryptography world. This section aims to explain in simple terms how the technology works, without diving into deeper detail. For a more in-depth explanation, refer to this excellent series by Vitalik Buterin.

The Ali Baba cave problem

This theoretical game is an example of how a Zero Knowledge proof can be constructed in a very understandable way:

Let's imagine a game called the Ali Baba cave. In this game, there are two people named Alice and Bob standing in a cave that looks like a circle. There are two paths in the cave - one on the left and one on the right. At the end of each path, there is a door that can only be opened with a secret password. The doors block the way to the opposite side of the cave.

Alice knows the password, but she doesn't want to tell Bob what it is. Instead, she wants to prove to Bob that she knows the password without actually telling him what it is.

Here's how they play the game: Alice enters the cave first, and Bob waits outside, so he can't see which path she takes. Once Alice has reached the end of one of the paths and opened the door, she comes back to the center of the cave. Then, Bob enters the cave and shouts out which path he wants Alice to use to return.

If Alice actually knows the password, she can take the correct path back to the center of the cave. If she doesn't know the password, there's a 50/50 chance that she'll take the path Bob chose. Bob can repeat this test many times, and if Alice always takes the correct path, Bob can eventually be confident that she knows the password.

This game is like a puzzle that Alice and Bob are trying to solve together. But it also shows a problem with using this method in computer programs. In the game, Alice and Bob have to be physically present and willing to do the test multiple times for it to work. In computing, this isn't always possible, so this method has limitations. In practice, we use algorithms that allow this proof to be made faster and without needing communication between parties.

SNARKS

SNARKs stands for "Succinct Non-Interactive Argument of Knowledge." It's a type of zero knowledge proof that has two very interesting properties:

  1. The proof is a simple and light file that anyone can check for validity

  2. Checking if a proof is valid only requires the proof and a verifier software (which can be hosted on-chain)

Each different problem for which you want to create a Zero Knowledge Algorithm requires the construction of a set of mathematical equations that describe the problem and the selection of a proving algorithm that will be used to generate and verify the proofs on top of the equations. HYC utilizes circom for writing the mathematical equations and Plonk as the verification algorithm.

Last updated