Upgrade Summit 🚀 EIP-4844 from a Layer 2 Perspective
ETHOnline 2023 · 15 Oct 2023 · 26:29
Muhammad, a researcher at Scroll, explains EIP-4844 and why rollups care about it. The talk defines data availability, shows how optimistic and ZK rollups need it, and describes how Scroll commits batches in calldata, with about 80 percent of its costs going to data posting. It then covers blobs, blob-carrying transactions, the separate blob gas market, the roughly three-week retention, danksharding as the next step, and realistic fee expectations.
Topics
From ETHOnline 2023, hosted by ETHGlobal.
Transcript
[Music] W thank you uh thank you for having me thank you everyone for tuning in so today I'm going to talk about EIP 4844 it's one of the most uh you know debated and you know expected eips it's going to improve ethereum's utility as a data availability layer and if any of these terms are new to you I'm going to explain this terms to you in a bit so my name is Muhammad I'm a researcher at escroll scroll is a ZK rollup and one of the main users of you know this EIP are rollups so I'm going
to talk a little bit about the uh perspective of rollups on this CIP as well okay first of first EIP 4844 is about data availability and data availability is a big you know piece of puzzle in the grand scheme of scaling ethereum uh so quick reminder ethereum is decentralized blockchain it's very secure but we can't do more than like roughly 12 transaction per second on ethereum which is clearly not enough for a you know worldwide scale of computing so people have been thinking about how to solving this SoCal trilemma and making etherum scalable too while preserving the centralization and
security uh and we are finally closed if you think about the you know progression of ideas for scaling ethereum first people thought about making blocks larger and in fact EIP 2028 did this with you know reducing the gas cost of call data and there were other attempts to push this even further but for multiple reasons such as you know risk of centralization risk of destabilizing the consensus mechanism or sometimes peer um you know just sheer complexity the iips were too complex to implement and block those atoms and then people thought about you know State charting State charting was
this idea that we split the blockchain the whole ethereum blockchain into a smaller blockchains and you know rotate validators uh in this you know smaller blockchains and all U stuff like that that ideas are U now abandoned um again for them being too complex complex and also uh you know other Solutions like draup showing up that uh Prov to be uh easier to implement and you know uh easier to argue about and required less things to be enshrined in protocol but the important thing here is while people were studying State charting and working toward it we encounter this uh problem
of data availability uh which I'm going going to be explaining in a bit a little bit more and then rollup were introduced the idea of rollups is to do the computation off chain and prove that the computation was done uh you know the execution of the transactions was done correctly VI via a proof onchain uh but this proof is not enough we also need a data availability solution we also need to make the transactions that were executed available somewhere to the users who want to check uh so we have two parts in a rollup first is a state transition proof and and the second part is a data
availability solution uh and as I said ethereum Community came together and they decided okay uh the way to scale etherum is R through rollups and they adopted a rollups cic uh approach to scaling that means rollups are now first collapse citizens of ethereum and people try to make the experience of rollups better uh so that it makes the experience of every user ethereum better and data sharding is a idea that came after you know adoption of rollups so we abanded State charting but we still want to you know benefit from this idea of splitting work among different validators not everybody has to do
everything something like that and the EIP 4844 is the first step toward State charting which we are going to talk about uh more in uh you know upcoming slides okay so the data availability problem is to ensuring some data that was supposed to be openly published is indeed openly published and everyone who wants to download it can download it uh maybe data availability name is a bit confusing maybe it was better to call it data publishing as you can see in tweets by donr one of the people who worked on the VIP for for four uh and U the interesting thing is uh you cannot make proofs of
unavailability so if you want to ensure that some data is available unlike you know execution of transactions you cannot rely on fraud proofs because it's impossible to prove some data is unavailable uh so everybody has to download every you know uh data to make sure it it's avail something like that or at least it's the case now uh and I want to I want you to remember this because we will revisit this concept and a data availability layer is infrastructure that allows people or other protocols to publish data and it guarantees that this data will be available meaning that uh
anybody who wants to download it can download it okay okay now let's focus on rollups so you might have heard about optimistic rollups and ZK rollups this optimistic or or ZK you know refers to the way that the rollup proves its state Transitions and it's the way that the rollups uh get Integrity of execution or guarante Integrity of the execution op rollups rely on fraud proofs and to make fraud proofs you need to know the whole state of the rollup so for that reason in op rollup data availability is required even for proving Integrity of execution okay so if you're a um optimistic rollup
you have to make your uh you know State available otherwise your proof system is broken for ZK rollup it's not necessary like you can have a ZK rollup with proves and users can be sure that everything is executed correctly and data availability is not required uh but Integrity of execution is not everything we need other things in a rollup as well if you want to you know preserve the level of security decentralization that the layer one has for instance uh if data is not available and we just prove the uh you know correctness of execution with some ZK proof uh and the person who has the full state of the uh rollup
never makes it available then if they don't show up one day the rollup is breaked and if you want to make a transaction they are the only way to make the transaction because they are the only entity that can make a you know new proof and make the state of the r of progress forward uh there are other issues like if you want to enable permissionless withdrawals there's no way because the prover can just resist including those uh withdrawal transactions that are enforced it could this could result in a bricked state or censorship depending on the design so it's not ideal situation to be in uh so full state of the rollup has to
be recoverable and the rollups do it in two different ways one is to make the all the transactions that are executed available some most likely on L1 or make the state diff of you know after execution of a batch of transactions you have some uh update to the state of the rollup make these updates available this is just a technicality but the end goal is to make the full estate of the role available to anybody who's interested to have it so that we can have things like multiple provs decentralized provs premission lless withdrawals and things like that okay now how scroll appoaches data availability and what data availability
look looks like in scroll the rollup process in scroll is quite complex it has a lot of steps uh but the two steps that are important for us are commit and finalize so if you look here the rollup nodes submit you know transaction batches to rollup contract this phase is called comit and the goal of this phase is to publish transactions on chain uh to you know get data availability and also commit to the transactions that are executed in this patch and the new state that results from this patch the second uh you know thing that we do or we focus on here is uh finalize in finalize step the prover
sends uh you know the proof to rollup contract which is verified by the rollup contract and then the state of the rollup is finalized know the new state is finalized so as I marked here you can think of it this way comit is uh taking care of data availability and finalize is taking care of Integrity of execution so how we com it now in a scrol we come it with call data and uh while what I mean is that we want to execute a batch of transactions we want to make this batch of transactions available so we encode it in call data or put it in call data of of some function called commit batch of our
rollup contract we just submit it on chain the roll up the contract uh never stores the whole you know call data it just uh computes uh some commitment hash of you know the call data the transactions that are going to be executed and store that but the call data is gone or is it actually it's not stored in eum state but it's recoverable from ethereum blocks so anybody who wants to download it can download it forever like it it's it's there forever until eum is a thing so uh yeah so it's available uh the call data is cheaper than you know storage but it's not cheap
enough in the sense that currently 80% of our cost oper operational cost of you know paying gas fees on chain is for doing commit and only 20% for verifying you know uh proofs so 80% cost is for data availability that means we need cheaper data availability Solutions but we don't want to compromise on security we could have you know used a data availability solution other than ethereum which could could be quite cheaper but it would have been centralized and you know carry a lot of security assumptions we don't want that so EIP 4844 is here to solve that uh EIP 4844 has you know two objects in it like there's one object called blob a
blob is you know a piece of data like 125 kilobytes of data you can think about it this way if you look closer it's 2 to the 12 elements of field elements of bls2 381 uh uh so what can you do with the blog you can you know put your transaction batch or state diff inside the block and publish it uh and uh remember data availability is not equal to permanent storage while call data is permanently stored we don't need this you know uh data that we make available to be permanently stored we just want to make sure anybody who wants to download it
anybody who is interested gets a chance to download it maybe you know for a while a blob carrying transaction which is you know a new type of transaction that's introduced in EIP 444 can carry multiple blobs so in a transaction you can have like two three blobs and uh the transaction actually has only a commitment to those blobs so only a commitment to the blobs goes to you know the evm execution environment and a smart contracts uh and the blobs the content of the blobs is stored only by consensus clients uh consensus nodes uh for roughly three weeks okay now what does a blob carrying
transaction look like it's actually a same old EIP 1559 transaction with two additional Fields one of them is Max Fe per blob gas which specifies how much blob uh how much you want to pay for each blob gas which I which I'm going to explain in a bit and a list of you know commitments to the blobs you carry and those commitments are vergent hashes uh it's just a type of commitment okay let's look closer to these two Fields so the max Fe for per blob gas is there because EIP 444 introduces a 2d gas market we have regular gas and blob gas and we have to
specify how much we want to pay for regular gas like before and how much we want to pay for blob gas uh so that's why we have this field and the you know blob gas also has a e559 like pricing mechanism and the mechanism works like this anytime we have more than three blobs per block the price is going to be increased and we cannot have more than you know six uh blobs per block so the the mechanism works so that in each blob we have roughly three uh in each block we have roughly three blocks it's an important number we will revisit this okay and the second uh New Field is
a blob version uh hatches field it's going to store a list of blob version hashes yeah each version hash looks like this one byte version it specifies the version of the commitment views and then uh you know uh some a hash of a commitment to the Block it's a kcg commitment so it's a polinomial commitment scheme uh there is a good reason for this but for now just focus on how it works a blob is just an array of 2 to the 12 field elements we can apply a log range sorry for the type of log range interpolation to it and get a polinomial where you know the I element
of The Blob is encoded in uh you know p p on uh evaluated on Omega to the I uh okay so why we have this version bite because we can upgrade this commitment format without you know breaking the format like we can bump up the version and in of casg use something else right uh and why kcg uh it's going to be handy when you want to use this you know commitment scheme in ZK rollups and optimistic rollups I'll show you that uh but with kcg we are committing to this polinomial not the array right and it's useful actually okay before proceeding let's
compare blobs versus call data call data is what we use now and blob is what we potentially use in future blobs are only temporarily stored call datas are permanently stored blobs have no um smart contracts have no direct access to blops but call data is accessible from Smart contracts and uh blob has its own gas which makes it you know separated from the fluctuation of the regular gas market for all this reasons uh it seems like blobs has have no necessary no unnecessary feature they only have things that are required for data availability so we expect them to be cheaper but for the fact that they have
their own U Market there's no way you can be sure like we have to see this events fold out and you know see how it goes but the expectation and it's a reasonable expectation is that blobs uh be a lot cheaper okay the EIP also introduces a pre-compile the pre-compile uh is a point evaluation pre compile what it does is that okay you have the blob and you make a polinomial out of it and you come to that polinomial but the good thing about this polinomial is that you can evaluate this polinomial on any point Point like if you want you can use the point evaluation polinomial and uh show that or you know assert that on
point Z the poal evaluates to Value y this may look very unreasonable so why not just query the highest you know value of The Blob but it will be handy in a bit and remember we have to pay for this uh invocations of pre-compile and it cost 50K G to do so okay back to the rollup process we saw how we you know commit to do the commit phase with call data but now we want to do it with blobs it's very easy the rollup nodes used to submit a batch of transactions as call data now they submit them as blobs and
the rollup contract had to you know calculate a commitment to the you know batch of transaction calculate the hash of the batch of transaction we don't have to do it anymore we just Store The Blob version hash of the corresponding BL and again The Blob the transaction badge is not stored in ethereum state but it's available from consensus clients for you know roughly three weeks so anybody who's interested has enough time to download it but remember we are only storing the commitment to this you know transaction batches and the commitment is not enough for ZK evm to execute we have to open
this commitment and then the ZK evm circuits can execute there is this uh Pi or public input subcircuit that takes care of opening commitment uh so improver has to provide the pre-image of uh you know uh transactions that are actual transactions and uh Pi circuit checks that these preimages are consistent with what ever was committed to unchain why we only have the commitment because it's very costly to have large public inputs for the verifier and what pi circuit does you can think of it as decompressing public input and uh why we should have this because otherwise
prover can you know execute any batch of transaction commit to something and don't do the consistent to check Pro can do another you know execute another batch of transactions which is you know undesirable okay after we have PLS Pi circuit is very easy to implement I mean relatively easy to implement because we have these random Point evaluations so if you want to make sure two pooms are equal you can just you can just look at a random point and see if the two pooms evaluate to equal values on that random point it's called the short zle LMA and uh with the point evaluation uh
pre-compile it's easy to do so I'm not going to get into details because we don't have time but uh you can uh expect a blog post to be published by scroll in a week or so that explains uh these things uh in detail okay back to blobs and the capacity they introduce as I mentioned the blobs have this EIP 15 59 like mechanism which targets three blobs per block and doesn't allow more than six blobs per block what does that mean it means on average we have a 380 kilobytes additional space per block provided by
these three blobs okay and that translates to 100 uh transaction 100 ethereum transactions like typical transactions transactions like swapping on Unis swap which doesn't sound a lot like across all rollups we only get 100 uh transactions per second uh in contrast you know ethereum has 12 roughly so we are just 10 exing the number of transactions possible somehow uh okay why why these you know parameters are said so why we don't allow more blobs per block so if you think about it the amount of you know
storage requirement added to you know consensus clients who have to store these blobs is only 50 gabt it's nothing we can double it triple it easily clients won't you know won't be unhappy and people who run noes won't be unhappy but the problem is the larger you know the blobs or the more blobs we have per block the network propagation delay for uh you know each block will increase and this is bad because every block has to be attested to in you know 4 seconds like it has to be well propagated across Network in 4 seconds and if a block is too large ATT testators or validators cannot attest to
it in time and it would make the consensus you know mechanism unstable for that reason we are very careful with these parameters we are not pushing these parameters too high but on the other hand we don't get much from it okay when EIP 444 will hit the main net it's included in the Denon you know upgrade it's it's expected as far as I know to be here next year and probably we need a lot more testing before it's finalized okay I mentioned that there is this uh there's this uh you know other uh proposal uh data sharding and data sharding proposal it's mostly called
dunk sharding dun sharding is the same idea of you know having blops but instead of everybody has to download all the blops like every consensus client has to store all the blobs and serve the blobs and you know before uh a block is you know considered fully downloaded you have to download all the blops and such the idea is uh we don't enforce everybody to download all the blops people just have to run some tests to make sure that the blobs are available while we can't make proof of of unavailability for blobs we can you know efficiently test availability of the blobs and that's the idea of data availability sampling and EIP 4844 is a step towards this because
it implements some components are going to be reused in dunk sharding so if we have this we can have more blobs like we can have like 10 or 100 or even more blobs per block because uh you know the cost of efficiently testing a blob is available is far less than just downloading the hor blog okay so that allows us to not worry about the propagation delay that much okay conclusions so we have come a long way implementing EIP 444 was quite hard uh you know making D sharding design uh you know finalized was quite hard and I believe these are that the things we
achieved so far and we can expect uh you know um very good results in a short time like maybe now it's not enough but in a in a few months or maybe a year or two we can expect to hear better news uh so the fees with EIP 4844 will go down I expect them to go down 2x to 5x but it's important to remember it can be still quite high if you have another Bull Run and a lot of transactions that's not you know low enough for people to transact and the community has to keep working on dunk sharding but uh I can assure you that the design of dun sharding is
almost finalized EIP fre4 delivers a lot of components that are reused in dun sharding so we can expect good things to happen so uh thank you that's all
Related talks
- Scaling After the Merge: How We Can Massively Lower Transaction Fees on Rollups
- Danksharding | Dapplion, ChainSafe | ETHTaipei 2023
- Core dev updates, Eclipse SVM L2 detailed and more - The Daily Gwei Refuel #660 - Ethereum Updates
- David and Anthony unpack Modular Blockchains
- On the state of scaling research in Ethereum - @protolambda at @ETHDubaiConf
- DappCon 2023: Exploring The Future Of Gnosis Chain - Philippe Schommers
- Ethereum's Latest Upgrade: Fusaka
- What’s Going Into the Pectra Upgrade? by Christine Kim | Devcon SEA
- Les Amis d'EthFr #31 — Comprendre PeerDAS et les enjeux de politique monétaire
