Zero Knowledge Proof (ZKP) is a protocol that allows us to prove we know a certain piece of information without revealing what that information is. This protocol is widely used in crypto projects, notably Zcash, Nucypher, and the dApp Tornado.Cash.
Technical documentation on this protocol is available on Wikipedia
. Today, Tonraffles will bring you a story to illustrate the use case and functioning of ZKP.
Peggy Whistle, the world’s leading art historian and expert in authenticating DaVinci’s works, was enjoying a cup of tea at her home in Suffolk, United Kingdom, when she received a call from Interpol. The police requested her immediate presence at the Louvre. A helicopter was on its way to pick her up.
How to Trust This Man?
Currently, there is no evidence that he is a police officer or a representative of the Louvre. What if Victor is actually the thief? Why would he do that?
Her intuition suggests that Victor might be the one who created the fake Mona Lisa and is attempting to swap the paintings. This could be the final test of accuracy – and Peggy is the key. She feels something is very strange.
What should she do?
If she simply says that the two paintings are identical, Victor will surely rehang the fake painting (because he created it and certainly marked it somewhere), and the real painting will still be stolen. Then, Peggy will have to report to the police that the real Mona Lisa has disappeared.
Or… she should show the differences between the two paintings. Victor might abandon the swap knowing that his work is not perfect. But he will learn about the imperfection and could create another Mona Lisa with even higher accuracy.
She needs a way to prove that she can distinguish between the real and fake paintings to ensure that Victor cannot openly escape with the real painting. But she needs to do this without revealing any knowledge about the painting, so he cannot learn anything.
And she needs a zero-knowledge proof to prove she knows the difference between the two paintings.
“I will prove to you that these two paintings are different, and thus I know which one is the real Mona Lisa, but I will not reveal what the difference is.”
Victor looked surprised:
“How can you do that? I’m sorry, but Peggy, we’re in a hurry and don’t have time for games, please just show me the difference.”
The ZKP Protocol
“It’s not too complicated, it will be quick,” Peggy calmly said. “I will point to one painting, and you remember which painting I pointed to. Then you will blindfold me and swap the paintings or even leave them in the same positions. When you’re done, remove the blindfold, and I will point again to the painting I initially chose.”
Victor was still confused: “But that’s just a 50-50 chance, how do I know you’re not guessing?”
Peggy smiled: “Then let’s do it 10 times. If I truly know the difference between the two paintings, I can point correctly every time. If I can’t tell the difference between them, in 10 rounds, I will have less than a 1 in 1000 chance of guessing correctly every time. To be precise, the probability of guessing correctly is 1/2 to the power of 10, or 1 in 1024.”
Victor considered his options but had no real choice other than to follow Peggy’s protocol. Over 10 rounds, she consistently pointed to the same painting each time, demonstrating with very high probability (1023/1024 or 99.9%) that she could distinguish between the paintings without revealing any information about the differences she detected.
What Happened Next?
Moreover, Peggy’s intuition was right! Victor knew which painting was the real Mona Lisa before she arrived. He was a forger intending to steal the real painting. He had contacted Peggy as the final check to ensure that everything, including the fake painting, was perfect.
However, he was disappointed when Peggy could still differentiate between the two paintings, proving the forgery was not up to standard. And he still did not know where the difference lay.
article referenced from: https://medium.com/swlh/the-da-vinci-zero-knowledge-proof-d6271363382b