BanklessDAO
Published in

BanklessDAO

Ethereum Scaling Solutions

A Comparative Technical Primer on Plasma, Optimistic Rollups, and ZK Rollups

Image credit: Chameleon
Source
  • 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

Source
  • 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. Source

--

--

A decentralized community onboarding 1 billion people to crypto.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store