Behind The Coin: zk Proofs

Behind The Coin: zk Proofs

Zero knowledge proofs, one of the biggest breakthroughs in the cryptography. A concept so old, yet so valuable, revolutionized one of the biggest problems on the world's most popular layer 1 blockchains.

Originally conceptualized by Shafi Goldwasser, Silvio Micali, and Charles Rackoff, the term zero knowledge proofs describes the following: are proofs in which “ fully convince that a statement is true without” A  surrendering any more information.

As stated in Lecture 14: Zero knowledge proofs by Boaz Barak, “The notion of proof is central to so many fields. In mathematics, we want to prove that a certain assertion is correct. In other sciences, we often want to accumulate a preponderance of evidence. In criminal law the prosecution famously needs to prove its case “beyond a reasonable doubt”. A  And with the introduction of systems that utilize zero knowledge proofs, a plethora of new doors are opened. The ability to prove correct behaviors and assumptions without the need for an explanation on how you’ve come to your conclusion.

Ziesha Network does an amazing job in breaking down the concept:

- Suppose Alice is blindfolded and has two balls in her hands. Bob, who is able to see the balls, claims that the balls are different in colors. Alice doesn't trust Bob. How can Bob convince Alice that the balls have different colors (The problem), without uncovering Alice's eyes (Revealing the answer)?
Alice and Bob while Alice has two balls in her hands
Here is what Alice does:
She first hides the balls behind her back.
She shuffles the balls with a 50% chance.
She shows back the balls to Bob, and ask him: - Did I shuffle the balls?
Alice asking Bob if she shuffled the balls
If the balls are really different in colors, Bob would give Alice the correct answer. If he can't distinguish their colors, he still can give Alice a random answer, and his answer can still be correct. But the chances of giving a correct answer is 50%.
Alice repeats the procedure for 20 times. If the balls have same colors, the chances of Bob giving the correct answer all the 20 times is (1/2)^20 (Around 0.000001%). The probability is so tiny that Alice can conclude that Bob is really able to distinguish between the balls, leading to the conclusion that they really have different colors.

Problems with PoS and PoW

Currently almost every major layer 1 block chain either runs on either a Proof of Stake or Proof of Work mechanism. Here’s what those mean..

Proof of Stake: A consensus mechanism used to prove the validity of new blockchain transactions. In this system, individuals like you and I stake our tokens in what are known as validators. These validators are then chosen at random to accurately validate the occurrence of a new transaction; If the validator correctly validates a transaction they earn a reward, if they incorrectly validate a transaction, a portion of the tokens staked on that validator are lost. Furthermore, while validators are chosen at random, the more token staked on a validator, the more likely it is to be chosen to validate transactions. Basically saying, “Hey, I have so much faith in the legitimacy of this transaction that I’m willing to back it up with my own money.” B

Problems with Proof of Stake: However, larger staking portions having higher chances of selection can be detrimental to decentralization and equality.

Lets take Eth for example: Large institutions have been staking insanely large amounts of Ethereum on their validators. Meaning that they have an exceptionally high chance of receiving any and every transaction, further meaning that they have somewhat of an unfair authority over Ethereum transactions.

With most transactions going through the validators of these institutions, it gives them the ability to have somewhat of control over the transactional network.

Proof of Work: A system used by participants/miners to verify  the validity of a transaction. In proof of work, rather than randomly choosing which participant validates a transaction, participants/miners compete against one another to solve complex mathematical problems. The first miner to solve said problem is granted the ability to validate the transaction and receive the token award.

Problems with Proof of Work: While this puzzle system excels in maintaining a decentralized platform, it is frowned upon for its energy consumption rate. Running rigs that can efficiently compete with other miners requires a hefty load of electricity. Furthermore, with these proof of work puzzles only getting harder over time, proof of work miner systems will only become more and more energy intensive; eluding to the world how environmentally unfriendly the entire Proof of Work system is.

Ethereum Zk Applications:

All across Ethereum there's already been the implementation of zero-knowledge proof systems, with some of the most famous projects being: zkSync, Loopring and Polygon. As more time goes on, the hype and backing for these projects only increases as individuals are able to witness the massive benefits that zk systems have on blockchain transactions.

zkSync

zkSync is an existing Ethereum layer 2 trying to solve Ethereum's scalability problem. In production since 2019, this long awaited project is looking to be the most efficient layer 2 compatible with Ethereum’s Virtual Machine. Over the course of its testnets, alpha releases and beta launches, the project has been able to gain over 600k avid fans and raise over 450 million dollars from funding rounds and private investments. Currently in a private mainnet, the project is set to launch its official mainnet in around 80 days or so. If successful, this layer 2 could completely disrupt Ethereum's current layer 2 market; and furthermore, revolutionize the way transactions are handled on the world's most widely used blockchain. Backed by the likes of Andreessen Horowitz Crypto, Variant Capital, Dragonfly Capital, Blockchain Capital, and many others, it's no secret how promising this technology looks on paper.

Loopring

A once unknown name back in 2017, now a fan favorite in 2023, Loopring has come a long way. Known primarily for their wallet fabled to make ethereum gas fees disappear like magic, loopring is in fact the first zk-rollup to be established on Ethereum. Loopring also has a DEX which boasts some impressive stats! Rather than going the VC funding route, loopring did an ICO on the 15th of August, 2017. They sold 687,540,000 tokens at a starting price of $0.06. While not much has been released from this project besides their wallet, rumors of a GameStop partnership in 2021 has kept them somewhat afloat for the past couple months.

Polygon

While I'm not completely sure what Polygon was initially, the company has made many strides toward implementing a zk rollup system on Ethereum’s Virtual Machine. As they’ve even said themselves, “Polygon will be focusing on ZK (Zero-Knowledge) cryptography as the most promising technology for scaling blockchains”, setting aside “1 billion dollars to support this effort”. C Through their hard work, Poly has released Polygon Nightfall, Polygon Hermez, and Polygon Miden. Nightfall being an optimistic rollup that heavily utilizes zk-proofs to solve Ethereum’s privacy problem. Hermes was initially its own separate project from polygon. After seeing its success in solving Etherem’s gas fee and transaction problem, Polygon acquired the company for $250 million. Lastly we have Polygon Miden, who’s a little more ambitious than its brothers. Polygon Miden is a stark based zk rollup that has its own personal stark based virtual machine built in, called Miden VM. Miden VM attempts to solve zk rollups’ major problem, its ability to support “arbitrary logic and transactions”. D If successful this can be a great advancement for not only the polygon team but Ethereum zk rollups in general.

Scroll

One major problem with existing zk rollups is their incompatibility with the Ethereum Virtual Machine. This issue has forced current zk rollups to be very application specific. While these rollups are scalable, they ultimately can’t be used to their full potential as their design makes them non-compasable with other decentralized applications. Scroll hopes to implement a zkEVM designed to make current zk-proofs compatible/readable on the current Ethereum Virtual Machine. If successful, scroll will essentially have created a general purpose zkrollup compasable with EVM; fundamentally, allowing for existing decentralized applications to migrate/integrate onto this rollup and make use of the new tech.

Non-Ethereum zK Applications

Who wants a rollup when you can have a whole layer 1?

Introducing Ziesha Network: An ambitious new layer 1 blockchain aiming to build a system based solely off the concept of zK proofs! Utilizing zK proofs at the heart of their contracts, this chain promises a more scalable, yet easily maintainable, public blockchain for all.

How It Works

In order to make their insane idea work, Ziesha Network introduces a new type of contract called a Zero Contract. As one may have guessed, Zero Contracts operate quite differently than their smart contract counterparts. Firstly, Zero contracts are written as mathematical constraints, unlike smart contracts which are written as bytecodes of their respective virtual machines. In doing so, transactional data is simplified and compressed to a state that is much more efficient to read,send, and verify for validators on the network.

Executing these zero contracts are Transaction Executors. These machines function similarly to that of zK rollup operators on Ethereum, and are one of the main building blocks of Ziesha. Operating as efficiently as possible, these machines were built to process the potential thousands of compressed transactions locked within each Zero Contract.

The MPN or Main Payment Network, is another Ziesha specific addition, implemented to aid in the success of this new technology. Ziesha’s Main Payment Network is a “builtin smart-contract that is created in the genesis-block of the Ziesha Protocol.” E Utilizing the Groth16 proving system, the MPN manages a merkle tree of accounts that possess the ability to transfer  ℤ  with each other for a very miniscule transaction fee. This network will be the main payment mechanism used by wallets on the blockchain.

Mina Protocol

Here we have Mina Protocol: A newly functional layer 1 striving to accomplish a high level of security and privacy for all, while remaining scalable and efficient. Mina Protocol possesses a heavy focus on these aspects, as they believe that security, privacy and decentralization are core parts of web3 and are aspects of a future we all deserve to see come to fruition. Attempting to solve the blockchain trilemma, Mina Protocol introduces the use of  zk-Snarks. Zk-Snarks are one of the two proof systems utilized by zero-knowledge applications. Snarks “provide the ability for one party to prove to another that they know a secret without revealing the secret itself.” F

Mina solves the blockchain trilemma

The blockchain trilemma is an overarching problem that constrains most, if not all, current blockchains currently utilizing proof of stake and proof of work systems. It's the situation that while blockchains were made to be scalable, secure, and decentralized; they’re only able to accomplish 2 of those goals at once. In Bitcoins sake, it satisfies the security and decentralization aspects yet fails in the scalability sector. This is due to the fact that with Bitcoin “each time a new participant joins the network, they must check every transaction since the beginning of the network to verify correctness”. F As time goes on, and more transactions take place on Bitcoins ledger, the process a new participant must go through in order to join the network gets increasingly longer. To combat this issue, Mina implements the use of zk-Snarks. Rather than having new network participants back track and verify the correctness of every past transaction, new participants are given proof-of-correctness of transactions (zk-Snarks) which are cryptographically verified to contain accurate information. In simpler terms, Mina Protocol “replaces the blockchain” F ,and all its transactionactional history/contents, “with an easily verifiable proof”. F

Verifiers

Due to the fact that Mina stores its blockchain information in zk-Snarks, an overwhelming majority of its users possess the ability of verification. As they state, “full node security” F can be accomplished quite simply as each zk-snark is “only a few hundred bytes” F and takes less than seconds to verify. These snarks contain consensus information and a merkle tree that directs back to the last saved ledger state. If wanted, verifiers can easily request merkle paths to desired areas of information, such as their account balance.

Block Producers

Block Producers are similar to that of miners on Bitcoin’s system, or stakers on ethereum's system. These producers are persuaded to act by the “form of block rewards or coinbase transactions” F and network fees that are generated by users upon transaction requests. Block Producers, as seen by that of miners and stakers, are inclined to include transactions with the highest fee transactions. To somewhat combat this preference, and maintain a state of balance in the blockchain, Block Producers are given another task: For every transaction added to their respective block, they’re required to snark a previously added transaction. If Block Producers deviate from this pattern, their blocks are rejected by other nodes. With this implementation, block producers are conditioned into a sequential equilibrium, despite their transaction fee preference.

Snarkers

Snarkers are individuals who generate the zk-snarks that verify transactions. These snarkers are compensated through an interesting bid concept. Snarkers pick transactions that they want to verify and put a bid price on said transaction. If their transaction bid is picked by a Block Producer, they then verify the transaction and the block producer takes a portion of the transaction fees and pays them the bid price. Many different snarkers are able to place differing bids on the same transaction; because of this, Snarkers compete against each other to produce the most cost-efficient zk-snark verifications.

Conclusion

All in all, there is no debate that zero-knowledge proofs will lead cryptocurrency to places far beyond what we imagined. Despite their short duration in the scene, they have already helped to solve problems that have troubled us for years.

As an avid user of cryptocurrency, I hope that you are as excited for this new technology as I am. It has only been a couple of years, and we have already seen the launch and success of many interesting conceptual and financial systems utilizing zero knowledge theories . We have made strides to solve problems previously seen as unsolvable, and we have brought ourselves to the brink of evolution once again.

I sincerely believe that we have only seen the tip of the iceberg in terms of what is possible. There is so much left to explore and experiment with; industries we once believed to be out of reach are now within our grasp, and concepts we thought were not computationally possible are now easily achievable.



Sources A:https://www.boazbarak.org/cs127spring16/chap14_zero_knowledge.pdf

B: https://www.forbes.com/advisor/investing/cryptocurrency/proof-of-stake/

C: https://polygon.technology/blog/the-polygon-thesis-strategic-focus-on-zk-technology-as-the-next-major-chapter-for-polygon-1b-treasury-allocation

D: https://polygon.technology/blog/polygon-announces-polygon-miden-a-stark-based-ethereum-compatible-rollup

E:https://hackmd.io/_Sw5u2lUR9GfBV5vwtoMSQ#2-Ziesha-Network---Bringing-L2-cleverness-inside-L1

F:https://minaprotocol.com/wp-content/uploads/economicsWhitepaper.pdf

Helpful Links:

https://cointelegraph.com/news/polygon-acquires-hermez-network-for-250m-will-merge-native-tokens
https://polygon.technology/
https://loopring.io/#/
https://zksync.io/
https://scroll.io/blog/zkEVM
https://scroll.mirror.xyz/EYn7ODhQAnNWABwWcu5xZLts_wEXTZAEWyTgExGS1DA
https://blog.chain.link/zk-snarks-vs-zk-starks/#:~:text=zk%2DSNARKs%20can%20be%20added,and%20amount%20are%20kept%20private.