{"id":28208,"date":"2023-02-24T07:01:41","date_gmt":"2023-02-24T07:01:41","guid":{"rendered":"https:\/\/www.zeeve.io\/blog\/"},"modified":"2023-09-12T11:51:06","modified_gmt":"2023-09-12T11:51:06","slug":"what-are-zero-knowledge-proofs-and-why-are-they-important-for-blockchain","status":"publish","type":"post","link":"https:\/\/www.zeeve.io\/blog\/what-are-zero-knowledge-proofs-and-why-are-they-important-for-blockchain","title":{"rendered":"What are zero knowledge proofs and why are they important for blockchain?"},"content":{"rendered":"
When blockchain experienced massive adoption, scalability was one of the pressing challenges that infrastructures built on top of it experienced. <\/p>\n\n\n\n
Ethereum\u2019s<\/a> ability to process just 30 transactions per block obstructed its adoption at enterprise<\/a> level and that was the point when the need for scaling solutions arose due to delays in rolling out ‘The Merge and Surge\u201d upgrades. <\/p>\n\n\n\n Ever since then, Vitalik Buterin, the founder of Ethereum has considered ZKPs as a feasible solution to scale the Ethereum ecosystem<\/a> in the longer term. With ETH\u2019s rising market dominance in DeFi<\/a> and NFTs<\/a>, sharding must be paired with ZKPs to achieve unprecedented throughput.<\/p>\n\n\n\n At ETH SEOUL<\/a> event, Vitalik mentioned: <\/p>\n\n\n\n “My opinion is that in the longer term, ZK-Rollups are eventually going to beat Optimistic Roll Ups because they have these fundamental advantages like you don’t need to have a seven-day withdrawal period,\u201d <\/em><\/p>\n\n\n\n Buterin said. \u201cIn more than 10 years from now or even more, I expect the Rollups to basically be all ZK.”<\/em><\/p>\n\n\n\n He emphases that though optimistic rollups<\/a> are good, ZKP allows faster withdrawals which makes it easier for the users to use dapps built on top of it.\u00a0 Right now, via sharding Ethereum<\/a> plans to achieve 1500 to 2000 TPS but ZKPs could push that to maybe 50,000 to 100,000 TPS.\u00a0<\/p>\n\n\n\n Polygon<\/a>, which is a second layer scaling solution, has been working towards building the next-gen Zk-EVMs which will ensure that developers need not have to develop from scratch when hosting their apps or protocols<\/a>. For this reason, Polygon has earmarked a $1 billion corpus which will help in the mainstream adoption of ZKP<\/a> to scale ETH. <\/p>\n\n\n\n Some of its key projects like Miden, Zero, Hermes and Nightfall have already set-up the road ahead to scale the base layer. Through the use of Polygon\u2019s<\/a> ZKP, developers can right away develop and deploy applications and help Ethereum onboard the next 1 billion users on its ecosystem. Hence saying that ZKPs will be the tech shaping the blockchain space will not be an understatement. <\/p>\n\n\n\n ZKPs or Zero Knowledge Proof<\/a> uses cryptography to verify data without actually revealing the data itself. As a result of this trait, ZKPs have revolutionized how data is collected and maintained. <\/p>\n\n\n\n However if you think that ZKPs have been invented post the emergence of blockchain<\/a>, such is not the case. <\/p>\n\n\n\n In 1985, MIT Researcher Shafi Goldwasser, Silvio Mical and Charles Rackoff conceptualized this and it was widely used in defense back then to verify transactions. Due to this invention, in 1993, they won the Godel Prize for the same. <\/p>\n\n\n\n Through the ZKPs, you can solve any problem without actually revealing the data to the verifier; hence maintaining complete secrecy. The verifier will only know the output thus protecting password and other details and maintaining the integrity of the ecosystem. <\/p>\n\n\n\n In a ZKP set-up, the zero-knowledge<\/a> proves the completeness, soundness and zero-knowledge or revealing no information to the verifier. <\/p>\n\n\n\n We have an example of a cave to demonstrate how ZKP works. <\/p>\n\n\n\n Suppose the cave is circular with two exits A & B and a middle-pass way, C. To cross this door you need to know a Passkey. There are two people: Alice & Bob. Alice wants to prove to Bob that she knows the pass-key without revealing the same. <\/p>\n\n\n\n To prove to the verifier, which is Bob, Alice must enter the cave through Exit A and come out through Exit B. <\/p>\n\n\n\n If she does that, there\u2019s completeness and the passkey used to unlock the inner door, which is C will get the soundness covered. <\/p>\n\n\n\n If Alice comes out of exit door B, it would establish the zero-knowledge at the same time to Bob because Bob don\u2019t know the password and he only tracks if Alice can come out from Exit B or not , and if Alice has made through to the inner door C, it would mean that she may have the pass-key. <\/p>\n\n\n\n The higher the number of attempts, the chances of guess work for Alice will be less, confirming that Alice really knows the pass-key, hence completing the entire process of ZKP to verify a process or a transaction on blockchain<\/a>. <\/p>\n\n\n\n That\u2019s why zero-knowledge<\/a> leads to minimal data sharing, thereby, stimulating throughput and scalability of the blockchain. <\/p>\n\n\n\n In the above image, you can see that the main-chain is accepting queries from all the shards and propagating the same into blocks on the main-chain, which is Ethereum<\/a> Layer1 or mainnet. <\/p>\n\n\n\n What if the process continues in the same manner? It is scalable but not super-scalable( That\u2019s the difference between scaling 1500 TPS to 50,000 to 100,000 TPS as per Vitalik Buterin). <\/p>\n\n\n\n What if in one of those shards, there lies transactions which batches another tens and thousands of transactions bundled into 1. <\/p>\n\n\n\n Those data can be verified through a single transaction through root-hashes and Merkle-tree that they are indeed valid. That is something that ZKPs achieve for scaling blockchain. <\/p>\n\n\n\n Here\u2019s how the entire equation changes when ZKPs come into the picture; <\/p>\n\n\n\n As you can see in the above image, on the Hermez chain, there are 5 shards visible. A typical shard contains 15 TPS; however, what if inside that shard lies a ZKP transaction bundle of over 2000 transactions as shown in the image above. <\/p>\n\n\n\n What if in all the 64 shards of ETH, as many as 10 such transaction batches are pushed. So it makes 2000×10 or 20,000 TPS per second. In this equation, we are speaking of only 10, what if there are 50 or 100. You can expect the scalability it will generate for the main-chain. <\/p>\n\n\n\n But a concern arises that these thousands of transactions awaiting block propagation could be fraudulent. But ZKPs take note of that by posting minimal data to the main-net to query the transaction.<\/p>\n\n\n\n The validators on the main-net can query such transactions through the smart-contract<\/a> call-data or blobs which doesn\u2019t clog the main chain, which is the Ethereum<\/a> mainnet. <\/p>\n\n\n\n The state commitment of the ZK-rollups could track any minute changes to the state and report the same to the blobs or call data to verify the transaction. <\/p>\n\n\n\n The validator on the ZKP ecosystem frequently submits information of the change of state to the mainnet through hashed updated account data, rebuilt roll-up Merkle-Tree and a submission of the Merkle-Root to the on-chain contract to eliminate any instance of frauds. <\/p>\n\n\n\n In this way, the transactions are tracked and validated time and again without clogging the mainnet. Thereby achieving the super-scalability for the Ethereum <\/a>main-net. <\/p>\n\n\n\n Public blockchains<\/a> reveal complete detail of the transaction; for example, the wallet address and the balance transferred or available. But ZKPs completely take unnecessary information not serving the purpose out of the way. <\/p>\n\n\n\n So if you need to know whether an amount was transferred from wallet A to wallet B, ZKPs will only reveal the state of the balance of wallet A or wallet B, without actually exposing the public key of the wallet.<\/p>\n\n\n\n We have already seen in the past that law enforcements have used the flaw of public key cryptography to track essential information to hunt down criminals. It is not bad at all, but this information can be used for deanonymizing some of the prime wallets with very high balance at the same time. <\/p>\n\n\n\n We have seen instances of dusting attacks and other vulnerabilities that public blockchain<\/a> pose; through the ZKPs, such problems can be mitigated right away for the individuals to enjoy full secrecy of operation on top of the blockchain. <\/p>\n\n\n\n We’re taking a deep dive into Zero Knowledge Proofs<\/a> to uncover their amazing potential! From ZK snarks and starks, to rollups<\/a> with countless practical uses across industries – these technologies are revolutionizing validation by offering optimal data sharing like never before.\u00a0<\/p>\n\n\n\n While this technology is incredibly useful, it is difficult to implement as it brings along many complex challenges with applying it safely and ensuring correctness. Vitalik Buterin himself commented on these advancements in Zero knowledge technology saying that <\/p>\n\n\n\n “At the moment, ZK technology is complicated to build. There’s a lot of mental challenge, especially in doing all this safely and ensuring it’s all correct. We have actually started to see ZK-EVM implementations that are almost ready to scale with Ethereum transactions; that is amazing”. <\/em><\/p>\n\n\n\nWhat are Zero Knowledge Proofs?<\/h2>\n\n\n\n
How does ZKP work? <\/h2>\n\n\n\n
<\/figure><\/div>\n\n\n
What ZKP Does For Scaling Blockchain? <\/h2>\n\n\n\n
<\/figure><\/div>\n\n\n
<\/figure><\/div>\n\n\n
How Blockchains Maintain Privacy for Users While Using ZKP?<\/h2>\n\n\n\n
Key developments: <\/h2>\n\n\n\n