Zero Knowledge Proof
Turtle: Greetings, Socrates! What a pleasure to meet you here under your ancient, gnarled olive tree.
Socrates: Χαῖρε, my dear friend! You arrive at an opportune moment, for my mind is particularly restless today.
Turtle: I thought as much. Tell me, what is it that you are fathoming today? Or does your old οἶδα οὐκ εἰδώς still hold true?
Socrates: “More than ever! I know that I know nothing — and that is precisely why I need you. I can’t stop thinking about this problem:
HOW CAN I PROVE TO YOU, and only you, THAT I KNOW A SECRET, WITHOUTH REVEALING THE SECRET?
Turtle: Oh my dear, where do you get these questions from? Mhhh at first sight this seems to be impossible. How shall one proof that you know a secret to someone without telling the secret itself. And even more without revealing that knowledge to anyone else. This would need to be quite indirect in some way.
Socrates: Exactly. Let’s assume I know a secret magic word that opens a magic door. How could I proof to you that I know the magic word, but don’t let you know the word.
Turtle: Well that’s simple. You show me the closed door. I walk away, far enough so that I can’t hear you anymore. Then you speak the magic word. The door opens. I come back and see the open door.
Socrates: Ok, but then also someone else, another magician, could have opened the door. That doesn’t prove that I know the magic word. And someone else coud see me speaking the magic word. I don’t want that.
Turtle: Ok, you’re right, we need a more private experiment.
Socrates: Let’s imagine there is a cave with only one entry(1). Inside the cave there are two pathways, shaped like a ring when seen from the top. Right after the entry there is a path to the left and one to the right (2). But this junction cannot be seen from outside the cave! Both pathways around the circular tunnel meet at the back of the cave. There is a magic door(3) that blocks the tunnel. I need to open the door to go around the full circle. The door cannot be seen from the junction.
Turtle: That’s an interesting setup. I think I know where you are going. Now I could ask you to go in one way, and ask you to come out the other way. That would prove that you have the secret key, because you can open the door. But I cannot see you using it.
Get Robert R’s stories in your inbox
Join Medium for free to get updates from this writer.
Socrates: Yes, but that would proof to any spectator, that I definitely know the secret. I only want to proof this to you. And not reveal it to anyone else.
Turtle: But hey Socrates. That’s crazy. This is impossible.
Socrates: But it is! We just need to improve the experiment a little more and do these steps:
- I go into the cave. You watch me go in, but you (and anyone else) stay outside of the cave for now.
- At the junction I choose to either go left or right. But you cannot see which path I took from the outside. Then I go all the way back to the door. Now I am standing on one side of the door.
- Then you also go into the cave to the junction. You (and anyone else) cannot see at which side of the door I am standing.
- Then you shout into the cave, instructing me which of the two tunnels to exit from.
Turtle: Ok I see. If you are standing on one side of the door and I tell you to come out the pathway on the other side, then you have to be able to open the door, which would prove that you have the secret key. But you could also happen to be standing already on that side of the door that I shouted. Then you wouldn’t need the key to walk out on this side.
Socrates: Yes that’s correct. Now what’s the probability of this happening?
Turtle: Uuh, you and your math. I get a headache of this. But ok this one is simple. Of course the probability of you being lucky and standing on the same side of the door that I am shouting or on the other are 1:1. So I am only have convinced that you actually know the secret.
Socrates: And what if we repeat the experiment. And I can fulfill your request, to walk out through one given pathway, again.
Turtle: Then the probability for you not knowing the secret drops to 0.5 * 0.5 = 0.25 Mmhhh and if we repeat this again and again that probability becomes quite small.
Socrates: Do you see now? That way I maybe cannot 100% prove to you, and only you, that I know the secret. But I can make the probability that I don’t have the secret as low as you want by simply repeating the experiment often enough.




