A Beginner’s Guide to zk-SNARKs
The concept of centralization has gone outdated.
There was a time when people used to embrace centralized architecture for enjoying organizational efficiency and speed. But, now is the time of decentralization.
Blockchain, the technology that came into the limelight with the introduction of Bitcoin in 2009, opened new doors for advancements in terms of decentralized structure. People started showing an interest in getting acquainted with the basics of Blockchain technology to build a fully decentralized, scalable, and secure environment. They began appreciating its efforts in integrating the technology into their traditional processes.
And this is when they realized that there are yet many shortcomings with this technology, primarily privacy and anonymity.
The existing blockchain-based solutions and smart contracts are visible to everyone. Anyone can easily trace the information and link back to the origins; making it difficult for anyone to perform any transaction anonymously.
So, how to deal with this situation?
Various market researchers and tech experts have pondered on this topic and come up with different solutions. One of which is zk-SNARKs.
What is zk-SNARKs?
zk-SNARKs stands for ‘Zero-Knowledge Succinct Non-Interactive Argument of Knowledge’, where:-
- “Zero-Knowledge” means one person (prover) can prove that a statement is true to another person (verifier) without revealing any additional information.
- “Succinct” signifies that the Zero-Knowledge Proof can be validated within a few milliseconds, with proofs whose length is just a few hundred bytes even in the case of statements related to large-scale programs.
- “Non-interactive” refers to a zero-knowledge protocol where the prover and verifier had little to no interaction. Meaning, they can exchange only one proof.
- “Argument” shows that the verifier is only safeguarded against computationally limited provers. Meaning, provers that have the adequate computational power to create proof/arguments about any incorrect statement.
- “Of Knowledge” indicates that it is impossible for the prover to create a proof/argument without having familiarity with a certain so-called witness.
How Does zk-SNARKs Work?
Let’s take an example.
Suppose there are two friends, X and Y.
X has a piece of secret information to share with Y, but there are various people around who might read and misuse the information. So, what X does is that he encrypted the code with the help of Y’s public key and sent it to him. He then asked Y to decode that message with his private key and share the decoded message back to him.
Now, if X receives the right decoded message, it means that the recipient of the message was Y. But, there’s a probability that someone else has guessed the message.
So, to be sure, X sends multiple encrypted messages to Y.
Now, if X receives any of the messages incorrect, it will be proved that the recipient is not Y. But, in the other case, the person he’s interacting with is Y.
This way, this activity will build trust in an economic interaction without revealing any additional information. Meaning, the trust is introduced into a process without compromising at the privacy front.
How can zk-SNARKs Aid in Making Blockchain Transactions Untraceable?
As you are already aware of, transactions in Bitcoins and other Blockchain-powered environments are validated by binding the sender/receiver’s address and the input/output value on the public blockchain. This set of information linked with any transaction is easily accessible by anyone on the network. Meaning, anyone can look up for the information related to the transaction.
Now here, zk-SNARKs records only the proof of the transaction on the blockchain node. This way, it safeguards the identity of the sender, receiver and other details associated with the transaction, eventually resulting in maintaining trust and transparency in a connected decentralized ecosystem without compromising on the privacy aspect.
Existing Use Cases of zk-SNARKs in Blockchain Ecosystem { & Future Expectations}
There are various implementations of zk-SNARKs prevailing in the blockchain domain. For example:-
- ZCash
The foremost application of zk-SNARKS is ZCash. It is a token that is posted on public blockchain just like Bitcoin. But, unlike Bitcoin, it guarantees that your personal and transaction data stays confidential.
Here, zkSNARKS empower users to shift their tokens from transparent state to a protected private state, where only that user can track the activities and associated balance.
2. Miximus
Miximus is another real-life example of use of zk-SNARKs in the blockchain arena. Here, a user creates an ETH deposit into a Smart contract via a unique commitment in a Merkle tree. Any users who wish to withdraw, the user has to provide proof of their knowledge of unique commitment (the secret) via a ZKP but without revealing the commitment.
3. ZEXE (Zero Knowledge EXecution)
Another purpose-governed privacy control where zk-SNARKs can be employed in ZEXE.
It was aimed to construct smart contracts on a distributed ledger such that offline computations and uploading of a proof of correct execution are required for building a scheme.
Here, the proof is mandatory to be zero-knowledge, easy to verify, and concise. However, a new cryptographic primitive known as decentralized private computation (DPC) is introduced into the environment, alongside some highly efficient execution tricks that ranges from zkSNARK optimization to new forms of elliptic curves.
While these are some of the applications of zk-SNARKs in the blockchain arena, many more are expected to enter the market. And eventually, add privacy and anonymity in the decentralized environment.