Cracking Proofs: The Benefits of ZKPs and Fraud Proofs

August 21, 2024

Guest post by nairolf.

Welcome to the Cracking Series, a four part series diving into Lagrange's core technology! Ah, crypto… that wild, jargon-packed world that can seem totally impenetrable from the outside. Here at Lagrange, we’re on a mission to break down those barriers. We’re all about making the complex simple and saving you from the headache of reading tough research papers. Whether you’re new to this or just like easy-to-read stuff, you’re in the right place. Join us for our Cracking Series, starting with Cracking Proofs, and enjoy the ride!

Introduction to Proofs

Throughout the centuries, one adage remains: for something to be trusted, it needs to be proved. Charles Darwin had to prove his theory of evolution with fossil and genetic evidence. Similarly, Albert Einstein demonstrated the validity of the theory of general relativity through observations of the bending of light around the Sun during a solar eclipse.

In recent times, the importance of proof has become crucial in combating fake news through fact-checking and source verification. Moreover, humans often consult with a variety of experts and trusted sources before making decisions, verifying that their opinions and actions are well-informed and validated. Proofs have always been, and continue to be, integral to our lives. They help us discern truth from falsehood, ensuring we make informed decisions.

On their side, blockchains have enabled greater transparency by making data available to anyone at any time. However, with this increased accessibility comes the need to ensure that this data is valid and legitimate.

That’s precisely the purpose of proofs: allowing trust in data without relying on a central authority. For instance, consider a DeFi application that wants to determine the average price of ETH on a decentralized exchange like Uniswap V3 over the past 10,000 blocks to issue options. As a user, the result of this computation directly impacts you. You don’t want to rely on a centralized authority to guarantee the price's accuracy, nor do you want to depend on an oracle that could be compromised. You need guarantees that the information is accurate, much like how our ancestors sought proof that the Earth is round.

Similarly, rollups need to verify the legitimacy of their transaction batches before recording them to the base chain's state. They must demonstrate to their users that their data has been published and their funds are safe. They need to prove their state transitions for users to continue using their solutions.

In essence, proofs are extremely important. They enable users to eliminate the need to depend on central authorities or intermediaries and make informed decisions without going through the complex work of proving something themselves.

The Different Types of Proofs

There are two different types of proofs: fraud proofs and validity proofs. The latter is also known as zero-knowledge (ZK) proofs.

Fraud proofs operate on the assumption that the computation or data submitted is correct. A designated period is allowed for network participants to challenge this assumption if they believe the data is incorrect or fraudulent. If incorrect data is detected, a fraud proof must be generated to demonstrate the error. Fraud proofs rely on economic incentives to ensure honest behavior: validators or network participants who successfully challenge fraudulent data are rewarded, while those who submit incorrect challenges are penalized.

In contrast to fraud proofs, which focus on detecting and rectifying errors or malicious behavior after they occur, ZK proofs ensure that only correct transactions are processed from the start. This means the system doesn't just assume transactions are valid (as with fraud proofs) but rather proves their validity upfront. Additionally, ZK proofs preserve privacy. They are proofs where one party (the prover) can prove to another party (the verifier) that a statement is true without revealing any information beyond the fact that the statement is true.

To better understand the differences between fraud proofs and ZK proofs, let's use an analogy.

Fraud Proof

Imagine you're trying to enter a nightclub. You show your ID and name to the bouncer, who checks if you're on the guest list and of legal age. The bouncer assumes your ID is real and lets you in. Inside the club, there is a system where staff or other guests can report if they suspect someone is underage or not on the guest list. If an investigation proves you used a fake ID, you're kicked out, and the person who reported you gets a free drink. 

This process is similar to how fraud proofs work, assuming transactions are valid unless challenged. The challenge and resolution process in the club mirrors the fraud proof system, where issues are found and fixed afterward.

ZK Proof

Now, imagine you arrive at the nightclub with a special device. Instead of showing your ID, this device interacts with the bouncer's system and creates a proof that you're on the guest list and of legal age without revealing your name or age. The bouncer verifies this proof, which guarantees that you meet all entry criteria without exposing any of your private information. 

This cryptographic proof is like a ZK proof – it proves upfront that you meet the entry criteria without revealing your personal details.

Returning to our onchain examples, whether it’s a rollup verifying the legitimacy of its state transition or your favorite application querying the average price of a token on a decentralized exchange over a specific range of blocks, they both need to use a proving system. 

At Lagrange, we focus on ZK proofs.

The Benefits of ZK Proofs

ZK proofs present several compelling attributes due to their design.

Firstly, they enable verifiable computations. As mentioned earlier, ZK proofs ensure that only correct computations are processed. In other words, if a computation is ZK proved, its validity is immediately guaranteed.

In addition to verifiability, scalability is another strong advantage. A ZK proof allows a statement to be proven true without revealing its content. This reduces the amount of data that needs to be stored onchain, making the proof easier to store. Since the proof is more compact, it requires less computational power to verify, which can speed up the process. However, it is important to note that ZK proofs do not guarantee how quickly a proof reaches its intended recipient. This can create constraints and lead to trade-offs. Currently, an application utilizing ZK technology multiplies verification time and costs by several factors. At lagrange, we are working to solve this issue (which we'll talk about in the next article!).

Finally, privacy is a significant benefit. With ZK proofs, the content of a computation or transaction can remain hidden and private, even while being proved and verified. Zero knowledge, indeed.

This first piece cracked the complexity of proofs, which have stood the test of time from Darwin to us. Whether you’re a user or a developer of an application or a rollup, proofs impact you. The power of a proof enables us to make informed decisions in a timely and accessible manner. In this article, we discussed the two most prominent types of proofs, highlighting the benefits (and a limitation) of zero-knowledge proofs. In our next piece, we will take a deeper look at our very own ZK Coprocessor and the problems it solves. Spoiler alert: we already addressed one in this article (speed and scalability).