Estimated reading time: 2 minutes, 48 seconds
Zk-Snarks is an acronym for Zero-Knowledge Succinct Non-interactive Argument of Knowledge. There is a lot packed into that statement, so this article will help break down the components and purpose of zk-Snarks.
Put in the most basic of terms, zk-Snarks are a great way to interact with unknown parties in a secure and private manner.
Zero-Knowledge Proofs give users the possibilities to prove they know something without actually divulging that private information. This is all done without any direct interaction between the prover and verifier; the process is coded into the protocol.
Not all sources that you interact with are trusted, and to interact with them, you might have to prove certain conditions are met before to verify that they can complete a transaction. The best example of a situation where zk-Snarks are needed is if you need to prove you have sufficient funds to send to the verifier. For example, you wouldn’t want to share how much money you have in your bank account when you all you really need to prove is that you have sufficient funds to make that one purchase, essentially proving that you meet a threshold.
So how do zk-Snarks work regarding identity and blockchain technology?
Using zk-Snarks essentially tries to prove that you have access to your private key, that really important password that is the key to controlling your , without actually divulging that private key. You want to prove you have access to it without revealing the key.
Let’s envision a scenario where Alice is trying to prove her identity to Bob, while Bob is trying to verify Alice’s identity. Bob has to verify that the Alice he is working with is the real Alice. In order to do this, Alice has to use her private key to prove her identity. But Alice cannot simply hand over her private key to confirm her identity as that would give the Bob total control over her funds.
How do zk-Snarks work?
Bob comes up with a secret message, all while not telling Alice what it is. He then encrypts that message using Alice’s public key and sends it to Alice.
Bob then asks Alice to decode the message encrypted using Alice’s public key with her private key, which Alice should be able to do thanks to asymmetric encryption. Alice then sends the decoded message back to Bob in plain text. If Bob’s message is decoded correctly, he can reasonably suspect that the recipient is actually Alice.
However, “reasonable suspicion” does not mean “100% positive”. There is a small chance that an impostor “Alice” could guess the correct message. So the whole encryption/decoding process is repeated several times. If it is the real Alice, she should be able to correctly decode each message every single time. If “Alice” gets even some of the messages incorrect, Bob is able to deduce that the individual he is interacting with is an impostor.
Trust is such a vital part of economic interaction. However, in order to establish that trust, we often have to put our private information in the hands of those untrusted parties, and not all of them have good intentions when it comes to preserving your data privacy. With zk-Snarks, the level of trust that has to be achieved is lowered greatly since data privacy is secured, allowing more free-flowing economic activity enabled by lowering barriers.