Here's a primer to rollups (hopefully simpler than vitalik's article). First, some definitions:

State: set of all addresses, balances, contracts at a given time.

State transition: Changes to be made to a state to get to the next state

Valid state transition: Changes do not violate rules

State root: Hash of state. A hash algorithm takes a large amount of data, s1, and returns a small amount of data, H(s). It is almost impossible to find an s2 such that H(s1) = H(s2).

Optimistic rollup: Operator publishes state roots (H(s)) and state transitions.

If the operator publishes either an incorrect state root or invalid state transition, a user needs to submit a "fraud proof". How does the user do this?

State is not stored onchain. A user determines state by computing all state transitions from the beginning of the rollup (or he asks someone for the state).

Now if H(s1), t1, H(s2), ... should be published. If H(s2) is incorrect, user submits s1 and t1 onchain

Basically only computation from the last "checkpoint" if you like, needs to be checked. Also you dont have to store state anymore.

In zkrollups, operators publish a "proof" that the state transition is valid.

That way there is no concept of an invalid transition. These proofs (zk proofs) are a mathematically complex new tool we discovered a couple years back.

An L1 transaction uses about 110 bytes. An L2 transaction uses about 10 bytes

Bytes are also saved by this new tool called BLS signature aggregation. Basically every transaction has a signature. Instead of publishing all the signatures, you use them to generate a mega-signature - which again uses less bytes.

This focus on bytes is there because ultimately the limiting factor is L1 blockchain size. you want everyone to be able to store the chain and run a node, at the same time you want high number of transactions.

therefore each tx must be storable using less bytes.

Checking for fraud on an optimistic rollup is computationally intensive (cause duh, more tps). Running nodes is expensive. The benefit over just having L1 with more block size is ... in L1 case, if I need to be safe, *I* need to run a node, its not enough if someone else does

In L1 small blocks + optimistic, I'm just trusting that atleast one person is running a node and interested in claiming the bond (fraud claimers get a bond).

A zkrollup does not even need nodes, this makes it even more superior. Only issue is we cant do complex programs ye.

Oh and btw if you're wondering ... arent we storing all state transitions in optimistic and in L1, yes we are. the only difference is in optimistic, the transitions dont need to be checked by "every" node, its enough if atleast one person does it.


• • •

Missing some Tweet in this thread? You can try to force a refresh

Keep Current with Samuel Shadrach

Samuel Shadrach Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @SamuelShadrach4

2 Apr
Energy estimates very interesting. PoS criticisms completely off-base.

PoS does capital lockup, PoW does capital burn. You can still use locked capital by tokenisation / derivatives like rETH (@Rocket_Pool).

Differential access to cheap capital (and technical know-how) is a centralisation pressure in PoS, agreed.

PoW has far more - higher min investment, differential access to cheap energy (govts regulate energy), and variability in mining rewards which forces pool formation.

Rules are ultimately decided by token holders not miners / stakers in both PoW and PoS. Majority wealth controls BTC too, they can fork into BTC2 with different rules if they want. Your original BTC will be left on a minority fork.

BTC immutability is social not set in stone

Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!