How to Actually Explain Zero Knowledge Protocols to your Child

Jinglan Wang
3 min readMar 27, 2015

--

…because the “child” in Quisquater’s original ZKP paper is waaay smarter than I am, and I’m not sure I count as a child anymore.

Once upon a time, a girl named Pam wanted to make herself a fruit smoothie. However, she didn’t want her friend Victor to drink it, because although Pam and Victor are friends, Victor always drinks Pam’s fruit smoothies without asking and that pisses her off.

Victor also happens to be colorblind, and can’t tell the difference between green and red. He hates spinach as well, and refuses to eat it. Pam decides to capitalize on this by making a green spinach smoothie in addition to her normal red berry smoothie.

Victor walks in to the room and sees Pam standing there with two smoothies. Because of his colorblindness, he has no way to distinguish the smoothies by sight. He is also sick and his nose is plugged up so he cannot distinguish by smell. Anyway, the point is that Victor has no way of telling the two smoothies apart.

“Oh great,” says Victor, “There are two delicious smoothies that I can drink!”

“No,” says Pam, “One smoothie is a spinach smoothie and one smoothie is a berry smoothie.”

“You are lying,” Victor retorts, “They look exactly the same. You just don’t want me to drink your smoothies!”

“Ugh you are so entitled. Don’t accuse me of lying, you greedy bum. I can prove to you that I’m telling the truth *without revealing any information*,” says Pam.

She places the two smoothies in front of Victor and says, “I am going to leave the room. You can choose whether or not to switch the position of the smoothies. Either way, I will be able to tell.”

Pam leaves the room and Victor switches the position of the smoothies, then calls Pam back in to the room.

“So,” says Victor haughtily, confident that Pam will not be able to guess, “Did the position change?”

“Yes, they did!” exclaims Pam, because she is not colorblind and can distinguish by color that the smoothies have moved.

“That was just a lucky guess!” scoffs Victor, “Since there are only two smoothies, the probability that you guessed correctly is 50%. Let’s repeat this experiment again!”

Pam agrees, and leaves the room. When Victor calls her back in, Pam is able to answer correctly again.

“Bollocks!” says Victor. “The probability that you were able to guess correctly twice in a row is 25%, which is still very probable. Let’s try again!”

Victor tries a total of 10 times to befuddle Pam. Each time, she is able to answer correctly. Victor calculates that the probability of Pam guessing correctly ten times in a row is 1/1024, or less than 0.1%, which is enough for him to verify that the smoothies are indeed different and Pam is not guessing.

If Pam and Victor repeat this experiment n times, the probability that she guesses correctly each time would approach zero. So if 0.1% was not low enough for Victor, he could always have tried for 0.00000000000000001%, (which should be low enough for anyone, and if it’s not enough for you, then you probably have other issues to sort out).

Thus, Pam proved to Victor that the smoothies were different without revealing which smoothie was what. Victor was not one to take chances with accidentally eating spinach, so Pam’s smoothies were safe!

Now your child knows some crypto. This pleases you because now you can brag about how your child is better than other children, because you’re a little bit of an ass.

--

--