Zk-Snark
Last Updated :
21 Aug, 2024
Blog Author :
N/A
Edited by :
N/A
Reviewed by :
Dheeraj Vaidya
Table Of Contents
What Is A Zk-Snark?
Zk-SNARK is a zero-knowledge-proof system where one party has to prove the statement is true to the other without revealing the answer. Its sole purpose is to convince the verifier that the prover knows the witness (secret information or password).
The zk-SNARK algorithm commonly stands for "Zero-Knowledge Succinct Non-Interactive Argument of Knowledge." This proof system originated in the 1980s. Yet, the notable mention of the zk-SNARK paper was visible in 2012. Besides, it is also used in cryptography and related transactions. However, there are some limitations attached to it.
Table of contents
- Zk-SNARK, short for "Zero-Knowledge Succinct Non-Interactive Argument of Knowledge," is an encryption-based zero-knowledge proof system used in cryptography.
- In this approach, the prover generates two keys, utilizing the private key for digital signatures, while the verifier employs the public key to decode the proof and validate the transaction.
- The concept of zero-knowledge proof systems dates back to the 1980s, and the specific term "zk-SNARK" gained attention in 2012.
- Apart from Zcash, zk-SNARK finds practical applications in auditing and various other domains.
Zk-Snark Explained
Zk-SNARK is a robust proof system that ensures secure and confidential transactions. Its primary objective is convincing the verifier that the prover possesses specific information without revealing the data. This process fosters trust and authenticity between parties without direct communication.
In the realm of cryptography, it is widely used for digital signatures. They rely on intricate mathematical computations to generate compact proofs, making them highly resistant to hacking attempts. The prover creates a zk-SNARK proof to verify the transaction's validity without disclosing sensitive details. The verifier then employs the public key to check this proof. The effectiveness and security of zk-SNARK projects are evident in their ability to withstand false proofs and unauthorized access attempts.
History And Origin
The history of the zero-knowledge proof system can be traced back to the 1980s. A significant paper published by Manuel Blum, Paul Feldman, and Silvio Micali in 1988 laid the foundation for this concept. They demonstrated that a standard string could suffice for the prover to convince the verifier about the transaction without revealing sensitive information. The paper introduced essential properties like soundness, completeness, and zero knowledge in this computational system.
Later, in 2012, Nir Bitansky, Ran Canetti, Alessandro Chiesa, and Eran Tromer coined the term. This term suggests that the verifier has zero knowledge about the transaction's details. Subsequently, in 2013, practical zk-SNARK implementation was evident in the "Pinocchio protocol," and other protocols followed suit. A prominent example is the Zcash cryptocurrency, which ensures the privacy of sender, recipient, and transaction amount details.
Equation
In zk-SNARK, the equation is represented as follows:
f(x, w) = True/False
Where:
- f represents the function that undergoes verification.
- x is the public input.
- w is the private key.
The verifier's ability to prove that the equation is a truth defines zk-SNARK.
Examples
Let us look at the examples to comprehend the concept better.
Example #1
Alice and Bob are engaged in a cryptographic interaction in this hypothetical scenario. Alice wishes to demonstrate to Bob that she possesses knowledge of a secret number denoted as "x." However, Alice is unwilling to disclose the actual value of "x" to Bob.
To achieve this, they employ a zero-knowledge proof system known as zk-SNARK. Using zk-SNARK, Alice generates proof that validates her knowledge of "x" without revealing the value itself. She then shares this proof with Bob. Bob, utilizing a public verification key, can verify the authenticity of Alice's proof. Through zk-SNARK, Bob can be convinced that Alice indeed knows the secret number "x" without gaining any knowledge of the specific value.
This method ensures privacy and confidentiality in cryptographic interactions, making it valuable in real-world applications, including cryptocurrency transactions and authentication protocols.
Example #2
On February 10, 2023, cryptocurrency exchange Binance made a significant announcement regarding its proof-of-reserves verification system. The exchange revealed that it would incorporate zk-SNARKs, an advanced technology expected to enhance the security and transparency of verifying its reserves.
This move comes after the collapse of FTX in 2022, which underscored the importance of proof-of-reserve verification in the cryptocurrency industry to ensure that exchanges possess the assets they claim to have.
Use Cases
This method has wide applications in different fields. So, let us look at them:
#1 - Zcash
The widespread usage of zk-SNARK paper is visible in the crypto blockchain. Zcash, a Bitcoin-based cryptocurrency, secures public as well as private addresses. Launched in 2016, it shields market participants from double spending and criteria such as minimum balance. Unlike Bitcoin, commitments (or transition outputs) are a medium to spend money for users. And to use commitments, they must create two nullifiers (or keys). One stays with the prover, and the public key remains with the verifier.
#2 - Usage in enterprises
A similar application of zk-SNARK paper is seen in the enterprises and healthcare sectors. To ensure secured deals, a supply chain solution named "MediLedger Project." This blockchain technology works on a "Confidential Chain of Custody." It enables a decentralized yet secure way to verify the origin of the drugs and transfer the ownership to different users. Here, news counterfeit drugs with the same serial number cannot exist.
#3 - Securing the identity of individuals
Another application of this protocol applies to identity verification. Some organizations use the Sovrin Network to create digital signatures of users' details. Public Key Infrastructure (PKI) is a verifier that solves public keys to ensure that the digital copy matches the real identity.
#4 - Voting systems
During elections, countries can adopt the zk-SNARK algorithm to evade ballot leaks. In short, they can validate the voter's identity via keys to avoid revealing their original identities.
#5 - Sidechains
As chains are linked to every block, the zero-knowledge system acts as a light client. Users can use zk-snark projects to verify cross-chain transactions in a sidechain.
#6 - Audit reports
To secure the financial details of the parties, blockchain-based firm "Horizon Labs" uses a zero-knowledge proof system. It uses zkAudit technology to help auditors share audit reports without identity reveal.
Pros And Cons
Every zero knowledge-proof system has positive and negative points to serve society. The same goes for zk-snark too. So, let us look at its pros and cons:
Pros | Cons |
---|---|
It involves efficiency and secured privacy during digital transactions. | There is a significant cost involved in the generation of the actual proof. |
They provide a shield against sensitive information and identity details. | It can only be applied to small-scale computations; otherwise, it turns out to be complex. |
Verifiers can identify the right key without revealing the actual source. | Its implementation may lead to hefty CPU costs. |
A comprehensive application is visible in healthcare, cryptography, finance, elections, supply chain, and other sectors. | It has chances of false proof creation by cyber attackers. |
Zk-SNARK vs Zk-STARK vs Zk Rollup
Although all of them are based on zero-knowledge proof systems, they do not look similar. Therefore, let us look at their differences for better understanding:
Basis | Zk-SNARK | Zk-STARK | Zk Rollup |
---|---|---|---|
Meaning | It refers to a proof system to verify transactions without revealing or interacting with the user. | Zk-stark allows users to validate and communicate the data without performing analysis by the verifier. | Zk rollups work on a 2-layer network to bundle the transactions to reduce their volume. |
Purpose | The other party can decode the key and access the contents. It also avoids false proofs. | To offer transparency and the need for verification setup. | To reduce the burden and computational load on the blockchain network. |
Origin | 2012 | 2018 | 2017 |
Frequently Asked Questions (FAQs)
Creating a zk-snark involves the following steps in a transaction:
- Establish a common string between the sender and receiver during the initialization phase.
- Use three algorithms (G, P, and V) where G is a key generator, P represents a proving key, and V is the verification key.
- The prover then utilizes the proving key (P) and the verification key (V) to interact with the verifying network.
ZK, or zero-knowledge proof system, serves as the parent concept, with zk-SNARKs, zk-STARKs, and zk-rollups being specific implementations. ZK is used when minimal or zero interaction between parties is required.
The implementation of a zk-snark involves the following steps:
- Formulate the computation or transaction as a set of constraints.
- Reduce the restrictions to polynomial equations.
- Develop a mathematical proof based on elliptic curve cryptography to prevent false proofs.
- The other party verifies the proof by solving the mathematical equation.
Recommended Articles
This article has been a guide to What Is A Zk-Snark. We explain it along with its examples, comparison with Zk Stark and Zk Rollup, its use cases, pros, and cons. You may also find some useful articles here -