Demystifying ZKSnarks : SNARKs Explained For Beginners

ZKSnarks guide Every technology has some of the flaws which obstructs its rise at a pan-world level. Cryptocurrencies, which were treated as an exception, failed to woo the audience when it came to restoring a high degree of privacy.

Why? 

Though they provided a perfect financial model, which is decentralized, secure and censorship resistant, complete privacy was missing because the demand for computational integrity forced nodes to broadcast all the contents of the transactions.

As a result, Kaspersky, an antivirus software company reports that more than 6% of crypto users refrain from using crypto citing privacy concerns. Such an image could deter mainstream adoption because most users want decentralized, trustless, secure, peer-to-peer and private transacting experience.

But that narrative is on the verge of a reformation under the influence of privacy coins. ZK-Snark will be the technology behind making this a reality. In this blog, we shall dig deep about ZK-Snarks to help those who are planning to adopt privacy coins as their preferred financial choice for making payments.

What are ZK-Snarks?

Zk-Snarks are privacy preserving protocols that can be used to prove to the verifier that the prover has some information without actually revealing the information. Hence the name, ZK-Snark or Zero-Knowledge Succinct Non-Interactive Argument of Knowledge.

Why Such a Name? 

Zero Knowledge means that the prover can prove to the verifier without revealing any information.

Succinct means the proof takes just a few milliseconds for verification.

Non-Interactive means just a single message is conveyed from the prover to the verifier.

Argument means since they are very different from traditional proof systems, hence the term argument.

Knowledge means the prover has some knowledge that only the verifier knows in complete. Therefore, completeness of the protocol is necessary for the proof system.

How ZK-Snark Came Into existence?

As we know that zero-knowledge has been in existence ever since 1985 but there was a flaw in the system. In the erstwhile model, the prover and the verifier used to send proofs back and forth.

However, continuous interaction between the prover and verifier could make data exchange heavy. So what ZK-Snark did was exchange information just once to prove that the information is correct.

As a result, the technology became scalable, convenient and cost-effective.

3 Properties of zkSNARKs:

Three main properties of ZK-SNARKs, which are considered below.

Completeness:

It is essential that the proving mechanism should be complete as shown in the above how it works section where John intends to prove without showing complete information that he is a valid traveler.

Therefore, completeness is a prerequisite as evident from the above given example. The computation takes into account all the aspects to prove that John is indeed authorized to travel.

Knowledge soundness:

Knowledge soundness comes from the queries that the verifier has been pre-knowledge about. To put this into perspective in a better way, we can look forward to the Alice and Bob cave example where Alice wants to know whether Bob has the secret key to come out of the other side of the cave and Bob wants to prove to Alice that he knows the secret key without revealing the same.

So, what Bob does is enter through door A, goes past the inner secret door named B and comes out of the exit door C. In this way, without revealing any information at all, Bob proves to Alice that he knows the secret pass-key of the inner cave without actually revealing the same.

Zero-Knowledge:

As evident from the above example, Alice doesn’t get the chance to learn from Bob that he knows the code.

Nonetheless, she is indeed convinced that Bob is genuine because he could manage to come out of the cave through another exit.

How does ZK-Snark Works?

With most cryptocurrencies, a basic UTXO model is in place to validate transactions. Due to such a model, there‚Äôs excessive relay of data on the chain, which means the validators will check certain conditions like whether the sender has sufficient balance and he/she is using the right private keys to sign the transaction.

Following that, they will validate the queries from the mempool and subsequently  it will be mined into the block as a transaction.

With ZK-Snark, everything happens in the same manner but with very little information relayed on-chain. To achieve that, ZK-Snark will convert the information into an equation and the equation can be evaluated on the basis of True or False.

Due to such a method, there‚Äôs very little information shared and the transactions, which might have otherwise taken minutes, gets completed  in milliseconds.

This is how the computation happens. For example, if John wants to move to the US, the authorities want to get complete information about John without actually revealing any information at all.

Here’s how the entire process shall work out;

How ZK Snark Can Help You with Privacy?

Traditional blockchain infrastructure requires read and write through from a wider data set to validate a transaction. On the contrary, when Zk-Snarks come into play, with minimal data, entries can be validated. But it does create room for exploitation.

To cater to this problem, ZK-Snark proposes a noble solution but with Merkle Hashes that track the movements across all the mediums until reaching the final destination. Which means, the time when the transaction was initiated and with the medium of wallet used must be in equivalence with the amount withdrawn and the same medium of wallet used.

In case, there’s any change in the midway, the Merkle Hashes shall track the transaction and put them back to their original state.

Pros and Cons of ZK-Snark

Pros 

They shield sensitive information by hiding them.Hence, it is best for organizations which are wishful of shielding their private data and want to enjoy scalability at the same time.

Cons 

The only problem with ZK-Snark is the toxic waste generated, which is the private key. The enterprises which are setting up the ZK-Snark system, if they have access to the private keys, money creation can happen out of thin air.

As a result, it is recommended to destroy the toxic waste or lambda and segregate the privacy preserving keys across random strings, which can be destroyed anytime and the system shall remain resilient to N-1, where N is the total number of trusted parties. Which means, even if 1 party remains true, the network shall sustain itself.

Practical Applications of ZK-Snark

Building SDKs: 

Through the use of Zk-Snarks, it is possible to build SDKs that can easily communicate with the side-chains to extract and verify data without actually accessing their sensitive data.

Interoperating with Sidechains

Right now while interacting with the side-chains, you need trusted validators to verify the transactions.

However when Zk-Snarks come into picture, that dependency shall cease and cross-chains swaps and transfers can happen in a truly anonymous and private manner.

Auditing:

ZK-Snarks have started to witness efficacies in auditing where the auditing of the transactions that occur in an organization can be done in a truly private way without exposing them to vulnerabilities in the form of compromise of trade secrets and others.

Due to this trade-off, a third party has no right to censor any data or prevent any events from occurring on top of the blockchain.

Conclusion

The future belongs to scalable, decentralized and robust technological systems that can promise privacy along with a high degree of security. Since Zero Knowledge protocols, Rollups have used blockchain as an underlying layer to secure transactions, they have paved the way for mass adoption of DLT or Decentralized Ledger Technology, which shall be private, safe, decentralized and highly secure.

Zeeve provides Rollups-as-a-service.  We provide popular optimistic, zk rollups and zkEVM support.  Get in touch to learn more and see how we can fast track your Rollup experience.

Related Articles

Responses