Explaining Zero-Knowledge Proofs in Blockchain
Ever since Vitalik Buterin recently talked about the implications of zk-SNARKs in his viral article titled, “Endgame”, the noise around zero-knowledge proof technology is only getting louder. The excitement that the blockchain community exhibits towards this mechanism is evident from the value appreciation experienced by the tokens of blockchains already leading the Zero-Knowledge Proof race.
But what exactly are Zero-Knowledge Proofs, more importantly zk-SNARKs, and why are they considered so significant for the decentralized world envisioned by DLT pioneers? We’ll read all about it and much more in this article. The article aims to break down the concept in layman terms, so the average blockchain enthusiast can develop a fair understanding of the implications of zero-knowledge protocols in the blockchain domain.
What is Zero-Knowledge Proof?
Though gaining popularity in recent times, Zero-Knowledge Proof (ZKP) is not a new phenomenon. The cryptographic principle of ZKP was invented by MIT professors Goldasser, Micali, and Rackoff in the 1980s under the modern school of cryptography. Cryptography, a thousand years old practice, has long found its way into modern-day cybersecurity. It plays a fundamental role in how messages, information, and all sorts of data are broadcasted all over the internet. Cryptography with its various verification and security mechanisms also constitutes the core of distributed ledger technology and blockchain.
Zero-Knowledge Proof is one such mechanism that aims to verify the authenticity of the transaction without revealing its contents. As the name signifies, “proof” denotes that a statement is true, and “zero-knowledge” exemplifies that no additional information is exposed beyond the validity of the assertion. Too much jargon? Don’t fret, let’s try to understand the logic behind it with two simple examples: With the help of the zero-knowledge mechanism, you can prove to the club, which requires a minimum age of admission to be 18, that you are indeed above 18 but without revealing your actual age. You can also verify that the amount in your bank account is enough to fulfill the eligibility criteria to avail a loan without sharing the exact account balance with the concerned authorities.
How do ZKPs work? The concept briefly explained in a video.
This might not seem much of a revolution viewing through the lens of a person that has no data privacy concerns and simply wishes to gain entry into a club or to avail a loan. But the mechanism has wide-scale implications for accelerating mass adoption of blockchain technologies, as described further below.
What is zk-SNARK?
Zero-Knowledge Proofs can be classified into two main types, interactive and non-interactive. Interactive ZKP is restrained by the lack of transferability, meaning that the verifier and prover have to be online at the same time, and the prover will have to provide the proof individually in case of two or more verifiers. Such a characteristic is a huge obstacle for decentralized distributed networks operating via a vast number of nodes (verifiers). Hence, the cryptographic principle which is significant for blockchains is a non-interactive version called zk-SNARKs, an acronym for Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge. Breaking down zk-SNARKs for more clarity below:
Zero-Knowledge = The proof is complete in itself and the verifier does not need to see all transaction details
Succinct = The proof is short and easily verifiable
Non-interactive = No active interaction is required between the prover and the verifier
Arguments of Knowledge = A poof of knowledge where the “proof” not only attests that the transaction is valid but also establishes the fact that the prover actually knows “why” the transaction is valid
You can find Vitalik Buterin’s advanced explanation of zk-SNARKs and how they might be used in blockchain here.
Significance of zk-SNARKs in Blockchain
Privacy and scalability are arguably the biggest challenges that currently hinder blockchain’s mainstream adoption. Privacy refers here to the protection of user-specific on-chain data, and scalability – put simply – to the number of transactions a blockchain can process in a second.
To most DLT enthusiasts it seems crucial that both, scalability-enhancing and privacy-enabling features are not being implemented at the cost of decentralization. Thus, a technological innovation is needed that ticks all those boxes, and zk-SNARKs might be it. Let’s look at how zk-SNARKs can positively impact privacy, scalability and decentralization aspects of blockchains – one point after the other:
Privacy
Public blockchains are fully decentralized in nature, which means anyone with an adequate amount of resources can participate in the network by providing a node (verifier here), abiding certain protocol rules. While public blockchains, using consensus mechanisms like Proof-of-Work or Proof-of-Stake, allow for complete transparency, effectively eliminating the need for a central authority to take decisions, they typically lack data privacy features, as anyone anywhere in the world is not only authorized to provide a node and thereby directly interact with the network, but is also allowed to read all the transaction data readily available on blockchain explorers.
Such non-shielded transactions pose a significant challenge to businesses (and also certain individuals) who at any cost can not let their data be exposed to billions. Companies that are inclined to add blockchain to their business processes (often financial institutions) have the option to explore private blockchain solutions, where the blockchain network is governed by a closed group of nodes and the access to readable data is also subject to permission. Hence, private blockchain architectures allow for more flexibility when it comes to preserving data privacy, but only at the cost of decentralization and transparency.
Unsurprisingly, for many DLT proponents, such a vision of private chains comes across as sacrificing the whole point of decentralization. Another concern often reiterated by blockchain enthusiasts in relation to private blockchains is confusing “privacy” with “permission”. In the case of permissioned blockchains, the data is not shielded by default – it is only protected by the permission to access and participate. Hence, the security of permissioned chains depends on how secure the “permissioning” systems are, something difficult to enforce as the size of participants grows.
So what could be the solution for bringing the best of both worlds together? Something that guarantees the transparency and decentralization of public blockchains along with the privacy and security of centralized databases taken even a step further to shielded transactions?
The answer lies in the mathematical logic behind zk-SNARKs. As explained above for ZKP, the cryptographic mechanism of zk-SNARKs in blockchain enables transactions in a manner where the transaction data, e.g. transaction amount as well as retaining amount in a wallet, can remain concealed. As per preference, even the receiver’s and sender’s wallet addresses can be hidden from the public eye.
Why and how are zk-SNARKs being used in blockchains today? This video provides a high-level overview.
ZKP in blockchain has not only wide-scale implications for the financial industry but also for other sectors such as healthcare and governance where securing data and identities is of paramount importance.
Hence, public blockchains functioning on zk-SNARKs are seen as an effective solution to accelerating the mass adoption of distributed ledger technologies in a world plagued by concerns of privacy and misuse of data.
Scalability
In addition to protecting privacy, another milestone that can be unlocked with the inclusion of zk-SNARKs in blockchains involves scalability. At the time of writing (February, 2022), Ethereum can only process around 13 transactions per second (TPS), which is significantly less than the rate required for executing the global demand for millions of transactions every day. As the demand for transactions on the Ethereum network grows, so does the network congestion owing to slow execution speed that pushes transaction costs (gas in this case) to heights where the transaction fees for smaller transactions often far exceed the transaction amount.
ZKP mechanisms pave the way for public blockchains to improve their scalability (Ethereum could possibly scale to 500 TPS, as per estimations) as zk-SNARKs proofs can be generated off-chain and then verified on-chain. The zk-SNARK proof and the transaction data are published to the blockchain in a highly compressed form reducing the size of the blockchains (more details here), thus dramatically increasing the transactional throughput. This will allow public blockchain networks to finally compete with centralized networks (both on- and off-chain) in terms of scalability.
Decentralization
Another added advantage of zk-SNARKs is improved participation dynamics. The reduced size of the on-chain data not only solves scalability issues but also provides equitable opportunities to people with smaller computational resources. In its current scheme with large-size blockchains, only the nodes with vast amounts of computing energy are equipped to manage large-size chains, hence posing a risk of centralization. The more the computational power, the greater the chances to mine a block, resulting in the creation of power dynamics discouraging the small players. With the introduction of the zk-SNARK methodology, users with comparably limited resources will also enjoy the possibilities to run full nodes and validate transactions, leading to a greater degree of decentralization.
Conclusion
With zk-SNARKs in blockchain, countless parties will be able to efficiently collaborate in a low-trust environment without the fear of eroding privacy or security. ZKP-based protocols have the potential to become the gold standard for public blockchain protocols, acting as a catalyst in revving up much-awaited mainstream adoption. Nevertheless, the technology still has a lot of bottlenecks to overcome. Consequently, it will require a few years to finally see the blockchain community effectively channelizing the extensive benefits of zero-knowledge technology applied to blockchain.