zkSNARKs, short for “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge,” are a type of zero-knowledge proof construction that allows one party (the prover) to prove to another party (the verifier) that a statement is true, without revealing any information about the statement itself.

SNARK and zkSNARK are two distinct technologies with different applications. SNARKs are mainly used in the context of Rollups, which are a layer 2 scaling solution for blockchain networks. On the other hand, zkSNARKs are primarily utilised for storing private data on a public blockchain while maintaining its confidentiality. For example, Piggi utilises zkSNARKs to store attribution data on a public blockchain while keeping the information private.
 
Essentially, zkSNARKs enable private and secure communication between parties, allowing them to verify the authenticity of a statement without exposing the underlying data.
 
zkSNARKs have a wide range of potential applications, including cryptocurrency transactions, identity verification, and private data sharing. Zcash was an early adopter of zkSNARKS technology. It has also been used in other blockchain platforms such as Ethereum.

 

In this article, we will delve into the technical details of how zkSNARKs work, explore their advantages and limitations, and discuss their potential for shaping the future of secure communication and verification.

 

What does SNARK mean ?

SNARK stands for Succinct Non-Interactive ARguments of Knowledge, and it refers to a type of proof system that is characterised by three main properties:

  1. Succinctness : The proof is concise and compact, typically with a logarithmic size, making it suitable for storage on a blockchain.
  2. Fast verification : The proof can be verified quickly, typically in linear time.
  3. Efficient proof generation : The process of generating the proof is efficient, typically taking linear time.

These properties make SNARKs a useful tool for verifying the authenticity of data without revealing its actual contents, making them particularly useful for applications such as Rollups and private data storage on public blockchains.

 

The Zero-Knowledge Proof concept :

Imagine you are trying to convince a friend that you have a certain object hidden in your hand, without actually showing them what it is. Your friend, the “verifier,” doesn’t believe you, and demands that you prove it. How can you convince them without revealing what the object is?

This is the challenge of a zero-knowledge proof. In this kind of proof, the “prover” (that’s you) has to convince the verifier of the truth of a statement (in this case, that you have an object in your hand) without actually revealing any information about the statement itself (such as what the object is).

To do this, you and your friend engage in a special kind of interactive protocol. Your friend asks you questions and presents challenges, and you have to provide responses that demonstrate the truth of your statement, without revealing any additional information.

This is the basic idea behind zero-knowledge proofs. They are a way of convincing someone of the truth of a statement, without revealing any information about the statement itself.

They have a wide range of potential applications, including secure communication, anonymous voting, and cryptographic protocols, and are an important tool for ensuring privacy and security in a variety of contexts.

A demonstration of zero knowledge should satisfy the following three conditions:

1. Completeness:

 If the claim is indeed true, an honest verifier (that is, one following the protocol properly) will be convinced of this fact by an honest prover.

2. Soundness:

If the statement is not true, a cheating prover cannot convince an honest verifier that it is true. The probability  of a dishonest prover convincing an honest verifier is less than 0.0001%.

3. Zero-knowledge:

If the statement is true, no verifier learns anything other than the fact that the statement is true. In other words, just knowing the statement (not the secret) is sufficient to imagine a scenario showing that the prover knows the secret.

 

The ingredients:

There are four main ingredients that make up zkSNARKs as they are currently implemented are as follows:

A) Coding as a polynomial problem:

The program to be checked is written as a quadratic equation of polynomials: t(x) h(x) = w(x) v(x), where the balance holds if and only if the program is processed accurately. The goal of the prover is to persuade the verifier that this equality is true.

B)Succinctness through random sampling:

The verifier selects secret evaluation points to simplify the problem of multiplying polynomials and determining the equality of polynomial functions: t(s)h(s) = w(s)v(s) This significantly shortens the verification time and proof size.

C) Homomorphic encryption and encoding:

An encoding/encryption function E with some homomorphic properties is used (though it is not fully homomorphic, which is not yet practical). The prover does not need to know s in order to compute E(t(s), E(h(s), E(w(s), or E(v(s), as she only needs to know E(s) and some other useful encrypted values.

D) Zero Knowledge:

 The values E(t(s), E(h(s), E(w(s), and E(v(s)) are permuted by multiplying with a number by the prover so that the verifier can still verify their correct structure despite not knowing the actual encoded values.

Checking t(s)h(s) = w(s)v(s) for a random secret number k (that is not zero) is similar to checking t(s)h(s) k = w(s)v(s), with the difference that if you are only sent the numbers (t(s)h(s) k) and (w(s)v(s) k), it is impossible to derive t(s)h(s) or w(s)v(s).

 

How can zkSNARKs  be used?

zkSNARKs can be used in a wide range of applications, including:

1.Cryptocurrency transactions:

zkSNARKs can be used to enable private and secure transactions on a blockchain. For example, the privacy-focused cryptocurrency Zcash uses zkSNARKs to allow users to make transactions without revealing their identity or the amount being transferred.

2.Identity verification:

zkSNARKs can be used to verify the identity of a user without revealing any personal information. This can be useful in situations where privacy is a concern, such as online voting or medical record access.

3.Private data sharing:

zkSNARKs can be used to enable the sharing of sensitive data between parties without revealing the data itself. For example, a company might use zkSNARKs to allow auditors to verify the accuracy of their financial records without actually seeing the records themselves.

4.Smart contracts:

zkSNARKs can be used to enable the execution of complex smart contracts on a blockchain, without revealing the specific terms of the contract.

5.Cloud computing:

zkSNARKs can be used to enable the use of cloud computing resources without revealing the specific computations being performed. This can be useful for preserving the privacy of intellectual property or sensitive data.

6.Authentication:

By using a Zero-Knowledge Proof (ZKP), government agencies can securely verify claims of citizenship without requiring the disclosure of sensitive information such as passport numbers or names. This can be done by issuing a key as part of a passport and using ZKP to demonstrate the possession of this key as proof of citizenship.

These are just a few examples of how zkSNARKs can be used. As the technology continues to evolve, it is likely that new and innovative applications will be developed.

 

Advantages of using zkSNARKs:

Here are some specific advantages of using zkSNARKs:

  • Increased privacy and security:

One of the main benefits of zkSNARKs is their ability to enable private and secure communication between parties. By allowing one party to prove the truth of a statement without revealing any information about the statement itself, zkSNARKs can help protect sensitive data and preserve the privacy of individuals and organisations.

  • Faster transaction speeds:

 Because zkSNARKs are extremely efficient, they can enable faster transaction speeds compared to other methods of verifying the authenticity of a statement. This can be particularly beneficial in the context of cryptocurrency transactions, where speed is often a critical factor.

  • Ability to verify the correctness of a computation without revealing the actual computation:

Another advantage of zkSNARKs is their ability to allow the verifier to check the correctness of a computation without seeing the actual computation itself. This can be useful in situations where sensitive data is involved, or where the verifier does not want to reveal their own data or calculations.

Overall, the use of zkSNARKs can provide a number of benefits in terms of privacy, security, and efficiency. These advantages have made zkSNARKs an important tool in a variety of contexts, including cryptocurrency transactions, identity verification, and private data sharing.

Concerns:

Naturally, there are concerns regarding zk-SNARKs. For instance, if an individual had access to the private key that was used to create the parameters of the proof protocol, they might be able to fabricate proofs that appeared to be valid to verifiers despite the fact that they were not. This would make it possible for that person to counterfeit new Zcash tokens. Zcash was designed so that the proving protocols are complex and spread across multiple parties to prevent this from happening.

Despite the fact that the construction of the Zcash proving process was carried out in such a way as to reduce the likelihood of token counterfeiting through false proofs, there is still at least one other issue that is associated with the cryptocurrency. All blocks created during the token’s early years were subject to a “tax” of 20% when Zcash was created. The “founder’s tax” is the name of this tax, which is used to compensate cryptocurrency developers.

Some critics have suggested that the founders might be able to create an infinite number of Zcash tokens using this aspect of the system without anyone else knowing about it. As a result, it is not entirely possible to determine the precise number of Zcash tokens that are currently in existence.

In conclusion,

zkSNARKs are a type of zero-knowledge proof construction that allow one party (the prover) to prove to another party (the verifier) the truth of a statement without revealing any information about the statement itself. They are an efficient and secure way to enable private communication and verification, and have a wide range of potential applications, including cryptocurrency transactions, identity verification, and private data sharing.

While zkSNARKs do have some limitations, such as the complexity of implementation and the need for a trusted setup, they have already proven to be a valuable tool in a variety of contexts. As the technology continues to evolve and improve, it is likely that zkSNARKs will play an increasingly important role in ensuring privacy and security in the digital world.