Ethereum Scaling Solutions

BanklessJan 05, 2023
Ethereum Scaling Solutions
  • Optimistic Rollups, which assume that transactions are valid by default and only run computations via a fraud proof in the event of a security challenge
  • ZK (zero knowledge) Rollups, which also run computations off-chain, but submit a validity proof to the chain (Mainnet)

Plasma Scaling

  • Plasma keeps all transaction and computation data off Mainnet, while Rollups keep some of this data on Mainnet
  • To keep all transaction and computational data off Mainnet, Plasma needs to adopt an explicit notion of owners, which prevents them from being general; on the other hand Rollups do not need this because of their hybrid approach of keeping data both on and off chain

Optimistic Rollups

  • Compressed rollup transaction data
  • Pre-state root hash
  • Post-state root hash

Optimistic Rollups in Practice

  • There are a few key components of the system — the rollup itself, Sequencers, Adjudicators (fraud-proving contracts) and the Optimistic Virtual Machine.
  • The rollups in this case are the regular smart contracts on Mainnet — they receive the transaction data on-chain, send it to Layer 2, and receive the results of Layer 2 computations (Layer 2 computations only happen when a Fraud Proof is valid and is executed).
  • Sequencers on Layer 2 receive the transactions sent to the rollup contracts.
  • Sequencers respond with a signed pledge to accurately execute and order the received transactions.
  • Sequencers are rewarded for executing transactions as expected.
  • Sequencers stake funds that are deducted if they behave maliciously.
  • Anyone suspecting fraud in a Sequencer’s action can alert the corresponding Adjudicator contract for the specific Optimistic Rollup on Mainnet.
  • The Adjudicator contract on Mainnet can validate or nullify the results coming from a Sequencer using the Optimistic Virtual Machine.
  • The offending Sequencer is slashed.
  • Some of the staked funds of the slashed Sequencer are awarded to the whistleblower (the entity that raised the alarm for Sequencer fraud).

ZK Rollups

  • Prover, who wants to prove they have the information
  • Verifier, who wants to judge the Prover’s evidence
  • Completeness: The Prover can convince the Verifier of any true statement.
  • Soundness: If the Prover is dishonest, they cannot fool the Verifier.
  • Zero Knowledge: The Verifier will never know what the information is, but it has a secret parameter called the Witness.
  • The key generator G takes a secret parameter lambda and a program C, and generates two publicly available keys, a proving key pk, and a verification key vk. These keys are public parameters that only need to be generated once for a given program C.
  • The prover P takes as input the proving key pk, a public input x, and a private witness w. The P algorithm generates a proof prf = P(pk, x, w) that the prover knows a witness w and that the witness satisfies the program.
  • The verifier V (which is the V algorithm) computes V(vk, x, prf) which returns true if the proof is correct, and false otherwise. Thus this function returns true if the prover knows a witness w satisfying C(x,w) == TRUE

ZK Rollups and Ethereum

  • The smart contract maintains the state of all transfers / transactions on Layer 2.
  • Most or all transaction data continues to remain on Layer 1.
  • Validation of a block is quicker because the state of the transfers can be updated using the cryptographic proof (without needing the actual transaction data).
  • Validation of a block also becomes cheaper because you are not using expensive and scarce Ethereum processing resources.
  • ZK Rollups can be optimized even further to reduce transaction size by representing an account as an index on Layer 2 rather than an address (reduces transaction size).
  • Transactions are also written on Ethereum using ‘calldata’, which reduces gas fees.
  • Regardless of the size of a transaction, the zero-knowledge proof can be quickly verified on Mainnet, making transactions faster (for example, a withdrawal).

State of Scaling Today and Beyond

Three paths towards the same destination.

Author

This article is for informational purposes only. It is not offered or intended to be used as investment or other advice.

Lastest information

see all