Back to blogs
Written by
Ciara Nightingale
Published on
October 3, 2024

A Full Comparison: What are Fraud Proofs and Validity proofs?

Fraud proofs and validity proofs are both used by rollups to check the validity of transactions. Delve into their differences, functions, and advantages and disadvantages

Table of Contents

Fraud proofs and validity proofs are both mechanisms used by rollups to check the validity of transactions. But how do they work, and what are the differences between them?

This article delves into the key differences between fraud proofs and validity proofs, how they function, and their respective advantages and disadvantages.

Prerequisites

What are fraud and validity proofs

Fraud proofs and validity proofs are mechanisms used to ensure the correctness and security of transactions in layer 2 blockchain rollups, which are scaling solutions for layer 1s. These proofs enable rollups to achieve higher throughput and lower gas costs by processing transactions off-chain while leveraging Ethereum's security.

Fraud proofs: How do optimistic rollups work

Fraud proofs are used in Optimistic Rollups and, as the name suggests, optimistically assume that all transactions are valid by default. This approach allows for high throughput and low latency by not requiring every transaction to be verified immediately. Instead, transactions are posted to Ethereum, and there is a mechanism in place for these transactions to be challenged within a certain time frame using fraud proofs:

  • Default validity assumption: Optimistic rollups assume all off-chain transactions are valid by default. This means they do not require computational verification for every transaction upfront.
  • Proposing state: Operators can propose what they believe to be the roll-up chain's current valid state by publishing it to the L1. These proposed states are based on the transaction batches processed off-chain.
  • Challenge period: There is a specific time window known as the “challenge period,” during which any operator can challenge the validity of a transaction in a batch.
  • Submitting a challenge: If an operator identifies a potentially fraudulent transaction, they can submit a fraud proof. This proof is essentially a challenge against the proposed state.
  • Fraud proof mechanism: The fraud proof mechanism is a game-theoretic mechanism that involves a process where the challenging operator and the operator who proposed the state engage in a "call-response game," narrowing the dispute down to a single computational step. This step is then executed on the Ethereum. If the outcome of this step differs from what the proposed state suggests, the fraud proof is successful.
  • Outcomes of fraud proofs:
    • If the fraud proof succeeds, the roll-up will re-execute the disputed transaction batch and revert to a previous valid state.
    • The operator who included the incorrect transaction is penalized, often by forfeiting a staked deposit.
  • Finalization: If no challenges are raised within the challenge period, the proposed state is accepted as valid on the L1, and the transactions are finalized.

Validity proofs: How do ZK rollups work?

Zero-knowledge (ZK) Rollups employ validity proofs. Instead of assuming transactions are valid and then proving them invalid when challenged, ZK rollups compute a validity proof for every batch of transactions before they are submitted to Ethereum:

  • ZK proofs (validity proofs): ZK rollups use ZK proofs, also known as validity proofs, to verify the correctness of transactions. A validity proof provides a cryptographic guarantee that a transaction batch is correct.
  • Proving and verifying: A prover computes a validity proof for each transaction batch submitted to L1. This proof is then verified by an L1 smart contract, known as the verifier.

Key advantages and disadvantages between validity and fraud proofs

Advantages of fraud proofs (optimistic rollups)

  1. Lower computational overhead: Fraud proofs require less computational effort upfront since transactions are assumed to be valid until proven otherwise.
  2. Simplicity and flexibility: The optimistic approach is simpler to implement and does not require complex cryptographic proof systems.
  3. Lower gas fees: Optimistic rollups typically have lower gas fees as fraud proofs require less computational power than validity proofs for transaction validation.

Disadvantages of fraud proofs (optimistic rollups)

  1. Longer finality times: Transactions are confirmed once processed by the L2 sequencer, but they need to wait for the challenge period (usually lasting roughly seven days) to pass, resulting in delayed settlement on L1 and, hence, longer finality times.
  2. Potential for malicious behavior: The assumption of validity by default could be exploited if insufficient incentives or mechanisms exist to detect fraud.
  3. Economic security model: This model relies on economic incentives (stakes and penalties) to ensure honesty, which can be weaker than cryptographic guarantees. Fraud proofs rely on the honesty of the operators.

Advantages of validity proofs (ZK rollups)

  1. Faster finality: Because every transaction batch is finalized when it is posted to the L1 and validity proofs are verified. Finality is achieved faster than when using fraud proofs since there is no challenge period.
  2. Strong security guarantees: The cryptographic nature of ZK proofs ensures that only valid transactions are processed, making it virtually impossible to include fraudulent transactions, providing the cryptography is sound. It relies on cryptographic mechanisms for security rather than the honesty of the operators.
  3. Scalability and efficiency: ZK rollups can offer greater scalability as they enable a high number of transactions to be compressed into a single proof.

Disadvantages of validity proofs (ZK rollups)

  1. High computational costs: Generating validity proofs requires significant computational resources, which can increase costs, especially with complex transactions.
  2. Complex implementation: The cryptographic algorithms and proof systems required for ZK rollups are more complex to implement and maintain.
  3. Trusted setup: Proving systems, such as SNARKs, require a trusted setup, which, if not handled properly, can compromise the rollup's security.

Summary

Both fraud proofs and validity proofs are transaction validation mechanisms used in Ethereum rollups. Optimistic rollups use fraud proofs with a simpler design at the cost of longer finality times and potential security risks. ZK rollups, leveraging validity proofs, provide faster finality and greater security but involve higher computational costs and complexity. For security-conscious protocols, ZK rollups are preferred due to their externally verifiable proofs.

  • To learn smart contract security and development, visit Cyfrin Updraft.
  • Or request a security review for your smart contract, contact us.

Secure your protocol today

Join some of the biggest protocols and companies in creating a better internet. Our security researchers will help you throughout the whole process.
Stay on the bleeding edge of security
Carefully crafted, short smart contract security tips and news freshly delivered every week.