Open Research Problems in Rollup Design
Open Problems in Rollups · 28 Jun 2023 · 1:07:43
Dr Franck Cassez explains his analysis of open research problems in rollup design. A good watch for anyone following where rollup research still has open questions.
Speakers
Topics
From Open Problems in Rollups, hosted by Ethereum Engineering Group.
Transcript
hello and welcome everyone my name is Peter Robinson and this is the ethereum Engineering Group Meetup today I've got Dr Frank cassay who is going to talk about his perspectives on the open problems with roll-up design so Frank before you dive into the talk um can you please introduce yourself yes thank you Peter so I'm Frank I'm a computer scientist with an interest in concurrent systems and formal verification and I've worked as an academic for a number of years in France and in Australia and four years ago I joined consensus and started to work on
the blockchain systems uh things I've worked on mainly were the formal verification problems like verification of a beacon chain the deposit contract smart contracts in general and more recently semantics of the Ethereal Mutual machine with David and Joanne and Horace and a couple of months ago I joined mantel which is actually a formerly big Dao uh which is a an institution developing a layer 2 a roll-up uh and as the head of research of course I'm interested in identifying
research issues and problems that we can try to solve to make our technology better uh hence this token trying to uh ER roll ups work and what can we do to make them better all right well it sounds like um sounds like you've got the right background to give us an awesome talk so let's hear it do you want us to ask questions at any time or what do you mean yeah so feel free to interrupt me anytime and if I'm I'm not as I said before a role at Guru so if I make a mistake and you think it's inaccurate or a completely wrong feel free to stop me and I'll fix that for next time
okay cool all right please far away right so I won't see you I'm going to minimize the windows of Peter I rely on you to uh something in the chat right so yeah so today I'm going to talk about uh what I think are some open problems in our Labs I'm not claiming that these are all the open problems that you are in enrolled and and um so the first thing what I'm going to cover is probably to go back to the of the origin uh what's the issue that roll ups uh are trying to solve and this means the
scalability problem in ethereum where does it stem from and what are ironic doing to try and improve on it and I'll talk about the design of polyps and again open problems and at the end I've got a short list of resources not exhaustive again so if you're like me and a couple of years ago I started trying to understand what wallets were if you uh Google it you'll find lots of different things and it seems to be magical because it solved the scalability issue and again if you look it up you'll see all of these these words if you understand all of them and you can explain all of them uh this talk probably won't give you anything new but on my side for
instance I was trying to understand how roll-up can provide scalability what's the Magic in there what are the differences between frog and validity proof so that's not too hard to understand some Notions of finality things that you see in uh in in standard blockchain let's say Technologies so I'm going to try and talk about some of these things not all of them uh if you if you want me to talk a bit about other well some of the topics in on this slide that I'm not to cover later on feel free to ask questions I may have some answers right so what's the problem with ethereum so just a reminder that the ethereum network is basically
implemented a replicated State machine so in this state machine you've got users submitting transactions to local nodes and then these nodes are going to communicate to the transactions uh run the consensus algorithm to order them and then execute let's say a step transition and replicate the state uh in an asynchronous manner so the ID is that everybody is going to compute the same sequence of states of course at different speed and that's how the ethereum networks network works you you archive everything all the well the the the full nodes are archiving everything the transactions the states and so on
and it's public so you can replay the transactions and check that the computation of the next date so whether your transaction has been processed correctly whether it has been processed directly or not and so on and at the core of the ethereum network there's What's called the ethereum virtual machine that's in charge of computing the next state so you take a given state with the let's say the current balances of the accounts there's a transaction transferring some assets from at least to Bob and this ethereum virtual machine is going to execute and produce a new state so in this design um there's lots of communication uh there's some security provided by some mechanisms staking and slashing nodes that are
trying to cheat so there's a lot of things that are going on the more details so sorry um what does it mean in terms of of timing and scalability so I'll try to show you this slide it looks complicated but it's not too complicated so you start in in the if you're Network by submitting a transition to your transition you want to transfer some assets and it goes into the memory tool of some local node and from there on this node is going to send with these P2 Spears the transition the transaction three that you want to execute and at some point uh one of the nodes is going to get this transition these
transactions all right uh from the main tool and propose it as the next transaction to execute so first in PCP I would say in this talk I'm going to assume that in the block we put only one transaction with the this is without plus of generality but it it simplifies the problem so this transaction is going to be picked by a given node and this node is going to propose it as a transaction producing a state transition from s to S Prime and it's going to broadcast this proposal to other node so at some point this transaction will be in a proposed block and then these other nodes in the network are going to re-execute the proposed transaction to check that the
computation of The Next Step has been done correctly and produce a next state and there's also a next stage in this let's say process um they may be let's say different options for successive States because everything happens in parallel so every node doesn't have actually a sequence of States but a tree of states and they have to decide which string they want to keep and this is happening in a consensus mechanism where nodes are voting for the head of the thing and after a certain amount of time when some blocks have been or transaction in blocks have been somehow voted for by a super majority the transaction in the block will be confirmed so the origin uh
the node that you submitted your transaction to will get a sort of a notification that the transaction has been included in the block and this block has a achieve the special status which is called finalize which means that it's very very unlikely to be reverted to to revert it and cancel this block you would need a very high stake in in terms of ether and in terms of money to to revert it so it's very likely very very likely that this block is is immutable and won't be changed and that's called the finalization of the transactions so overall the trip of your transaction takes around 16 minutes and you can see here that actually if you want to to
have a blockchain systems adopted as mainstream payment systems for instance it's far from optimal and we can't really wait when you're in the shop 16 minutes for your transaction to be validated so what can we do I give you first maybe more insight into what's happening so there's a real scalability problem in ethereum and on the left hand side I've got this table that's summarizes actually and the sort of the timings are things happening so in the ethereum blockchain time is divided in two slots and Slots are approximately 12 seconds and the 32 Slots make an Epoch which is approximately 30 well 6.4 means so
in the ethereum network a block is produced on average most of the time right every at every slot so every 12 seconds sometimes it doesn't slot without the block but it's supposed to be a rare event and at boundaries of epochs there are things happening and these things are finalizing blocks and so on so the blocks are not actually um finalized at every slot but they are finalized every 6.4 meter at every boundary of an Epoch and to finalize the blocks of questions we need to exchange messages and so on it takes some time so the average time here in this table is that a new block is produced every 12 seconds a sort of an intermediate status
between a new block and the finalized block is the Justified block so this is unlikely to be reverted but um still more likely than the finalized block so there's a sort of a you know a grade of uh let's a final finality for Block so a Justified block is supposed to be happening every 6.4 minutes the finalized block every 13 minutes and for your transaction because your transaction can be submitted just in the middle of an epoch on average it takes 2.4 2.5 Epoch so this is around 16 minutes so if you want to know uh how it translates into a let's say transaction uh in terms of the throughput so we can
take something which is uh the maximum capacity in the theorem which is given by the maximum uh let's say gas or resource that can be consumed uh in a block and this maximum amount of gas is 30 million gas so this is when the block is full so this is not the target I would say in ethereum the Target is to achieve an average of 50 million half of it you take the the best case for your transaction so transaction that costs the minimum which is just a transfer of assets of ether which is 21 000 um gas and we divide by 12 seconds so that means that what you can expect for very simple transactions is a throughput of 120 transaction per second per second
which is TPS and what's observed on ether scan and so on statistics is actually 50 transaction per second because of course you may uh let's say send transactions that are not the simple transactions but more complicated one running some smart contracts and so on they would consume more guests so that's what's happening and the blocks of course are not at full capacity every every time so what what is observed is 15 transaction per second so clearly this is a far uh from uh being enough to be adopted as a mainstream payment system any questions so far so if not I'll continue
so is there any magic so that we can improve things in in the blockchain ecosystem there's What's called the blockchain trilemma so this is not um for me this is not a theorem or whatever this is something that people believe is true which is uh the following uh what you would like to get is decentralization security and scalability so decentralization means that you need only low trust in the components low cost so um they can be some malicious actors in the system but if a fraction of them is malicious you're still going to achieve a correctness low cost everyone can participate with some custom
well-standing Hardware you don't need to buy very expensive computers and decentralization is usually achieved with the consensus mechanism for instance in ethereum there's a fourth choice and lmd goes through security what you want to do is to add your system to be resilient to a tax to have the data publicly available so that people can verify that transactions have been correctly executed and scalability that's what I was mentioning before you'd like of course your system to be efficient with high throughput and so on so there are solutions that can be implemented on on the ethereum network which is called layer one and these Solutions will be implemented in the
next couple of years the main one is called sharding which is a bank sharding or prototank sharding which is supposed to get a 100 000 transaction per second so we'll see if they can achieve it but in the meantime there's no really good solution to uh to to get more transactions per second so what rollaps aim to achieve is to provide more scalability so a higher throughput and of course if you believe in the broadcast in trilemma this means that you're going you're going to compromise on either decentralization or security so I'll try to cover these topics in the next couple of slides right so how do you scale with Roll-Ups
so the main IDE is that you're going to introduce some sort of parallelism so you're going to remove the execution from What's called the ethereum chain which is usually uh called on chain on chain means on ethereum on the ethereum network you're going to execute the stack transitions of chain so of course this is nice because you provide you get more CPU you can have activities running in parallel but at the same time it means that you have an execution engine so basically the ethereum virtual machine that's running on another chain the problems that can arise with that the other thing is that you really need
to uh be to be able to bridge or transfer your assets from on chain to off chain to the off chain the roll-up because otherwise right there would be some race conditions if you if you were in two parallel thread modifying let's say the balance of two different accounts they won't be synchronized or you could be double spending or have some again rest conditions on some state of the system so you will need to transfer your assets from the main chain or start of your assets from the main chain ethereum Unchained to the off chain to be able to work with them the other ID in wallet is to use what's called sequencing and the idea is to batch State and transition so I'll
describe it later on but what what did it results in is that there's no look on census usually in in roll up so you don't run a consensus this saves times but of course at the detriment of decentralization so that's basically where the blockchain trial name is showing up you increased the throughput but you decreased the decentralization and finally how do you preserve security you're going to commit the transactions that you're processing and the results of the computation you're going to commit them on on the layer one on the magnet so you're going to make some data available
so that the computations and state Transitions and so on can be audited or verified and by a third party which means again so that you need somehow some cross-chain communication there will be some still some throughput limitations because you have to send some transactions to this layer one so if player one is limited in terms of the number of transactions per seconds um this commitment of data to or states to L1 will at some point limit your ability to increase your workbook right so how does it work in in a roll up so I I don't make a difference right
now between uh Roll-Ups let's say optimistic Wallops and the ZK Roll-Ups if you know what that is but this is the main mechanism that's adopted for them and you've got a user and users they submit transaction to a single main pool and the transactions are ordered so there's usually a single actor on the roll-up which is in charge of ordering the transition deciding the order of the transition and then the other the transitions the other transitions are published by our smart contract to layer one so you publish the data and what you're doing here is that you only publish the transaction data you don't
require the layer one to execute them so what you can do is to use a mechanism called using the call data when you you call a smart contract on on major one and it's fairly cheap to publish data corresponding to transactions compared to executing some code so you're publishing you're ordering on layer one and at some point of course when when this transaction of publishing will be uh finalized you will have committed to this sequence of transactions and in all of the Roll-Ups this is the immutable one is decided you're not going to change it and at the same time on the roll-up you're going to compute the state
transitions for this sequence of transactions and create a new block so that's your sort of State transition on the layer two so you create a new block with the sequence of transactions and where you're going to uh to speed up and gain in terms of time and space is that instead of committing all the single States on layer one you're going to commit uh an encryption or let's say an encryption of the sequence of states that you've been Computing so in practice this is done via Smart contracts also and you commit the hash of the sequence of transactions and if you want to know how to do it you can actually use a miracle tree and you commit the hash root of a
market tree of this sequence of states that you've been Computing at Layer Two so the layer two is going to store of course the different states but you're going to commit in one let's say in in sort of a one hash you're going to use one hash to commit the sequence of states that you've computed and that's where you you gain in terms of cost as well you're reducing the number of data you're posting to layer one so that's the main IDE of so I haven't detailed in this in this type the of the mechanism right because you've got no decentralization in this system there's a unique actor determining which sequence of
transactions is going to be executed um you don't really know whether this actor is malicious or not so they could be Computing of course bad States right they could be tampering with the states that are obtained after each computation and so on so we need mechanisms also to add to this uh to do this first phase we need mechanism to be able to verify that things have been going well the way it's usually done in roll up so there's two things that you can do you publishing the sequence of transactions so the order is published and is immutable and what you can so what you can do is that external parties can actually read the sequence of
transactions and if they know the initial State the genetic state of the of the roll-up they can in theory right recompute everything the state that would be obtained after executing the sequence of transactions and they can detect uh whether this state is different to the committed states that have been published by the main actor running the role in so in in optimistic collapse you will have a sort of a Time window to contest the states that have been computed in the layer two so you have let's say seven days to check the sequence of transactions the corresponding states that have been committed and to contest it in uh ZK
Roll-Ups when you push the states you have to push as well a proof that you've computed properly in the sequence of states and this proof is going to be checked before you can actually commit this state so there's different let's say strategies that can that can arise from this design so what are the the main things that you have to bring great care of any question yeah yeah yeah so in the chat you might want to have a look at the chat it's been quite active and uh but so we might want to have a have a run through do you want it can you open the chat or do you want me to read that yeah I'm doing that now yeah all right so are these changes specific to all roll ups or primarily Z care
optimistic olives so I think there's not specific to any DK or optimistic problems they apply to uh all of them yeah and then the consensus will need to exist for decentralized sequencing yes I'll talk about that later yeah this is one of the challenges um there's a mental structure exists in rollup nodes so yeah they have to buffer the transaction so it's usually called an inbox or a mailbox so you push your transactions in and the sequencer is going to pull uh transactions from the uh the inbox so roll up nodes out there and then put
different yes uh are they decentralized the year two networks right now um I don't think so so I'll talk about decentralization later on and I can come back to this question uh specifically I think it's in the next few slides so I'll try to if I don't talk about it remind me about it for sure thank you um it looks the sequencer operating so yeah I'll talk about it this is the the the the issue about the sequencer operator and front running and so on is actually related to decentralization so I'll talk about it later
sounds good are you off your slides sorry I said thank you and sorry to throw you off your slide slightly no no that's okay so yeah so these are the things that I'm going to discuss in the next couple of slides so um I'm usually used to provide the technical talks and solving uh let's say uh well formalized problem so this one this talk is not about that it's identifying issues and I'll give you some uh let's say some uh description of the problems that can arise so that if you're a researcher or an engineer whatever you can probably say oh yeah I can solve it or maybe I should try to solve it so what what do we have to do again we have to bridge
assets from one layer to another one and Bridge them back so the way role at work is you're going to um to take your ether for instance and say yeah I would like to use the roll up to to use my ether but you you need to have a sort of a a bridge to enable you to work with a copy of your ether and so on and then at some point you'd like to let's say uh off-ramp and and get some money or transfer them ether to another currency you need to transfer them back to ethereum so you need to bridge in both directions you also need if you want your wallet to be successful is to be able to run the code that you would be running on day one to run it on the layer 2 on the rollout and it should probably give the
same result right so that's that could be an issue um you want to make sure that the data you are you are providing so when I was talking about posting the sequence of transactions that you have committed to you want to make it available for third party to be able to verify that you have computed correct the state correctly so how do you do that on on layer one you've got the blockchain you've got the Genesis block all the blocks are available so you can verify how it works how do you do it on Layer Two there's some finalization issue as well so when you submit a transaction when is it irreversible when is it finalized and immutable
so on on layer one again the protocols the super majority justification finalization and so on and as I was mentioning before it takes an average to 16 minutes uh there's another issue as well you're going to post let's say consequences of transactions and the the computation of the sequence of stakes that should arise from executing this sequence of transactions uh so you would like to verify that these uh the states Computing are correct or not so on the ethereum virtual machine uh your computation is a transferred posted sent to lots of other nodes and they can recompute the next step and if they disagree of course they wouldn't vote
for your uh your next computation they would vote for another one and your your wrong computation would not be accepted and there's a mechanism with some stakes and so on and you can show that if you want to force let's say the wrong computation you would need more than one third of all the stakes of the validators in the system so um with client diversity and the fact that the computation is uh performed by lots of different nodes you can sure that the uh the computation of the next state is somehow correct according to what I'll discuss it later as well the decentralization is also an issue I saw as well in the chat
right because you've got a single sequencer deciding which transitions are going to be in the next batch so the thing is of course you can censor some transitions you can decide to order transition as you will and maybe front run or whatever yeah this can exist as well so in ethereum this is supposed to be uh handled by uh choosing the validators in a random order adding The Proposal bit the separation scheme and stuff like that so but we need something as well only two and now um on the ethereum virtual machine when you execute your transaction of course you pay for the execution of your transaction uh as a user and a as an actor and it's a
validator and so on you can get Rewards or be slashed when uh you you you verify some transactions or where you do something wrong so the same mechanism may be needed on the does it work exactly and what are the problems that you can that you can have so I'll try to cover some of these issues in the next few seconds foreign so the first one is bridging and so in this context what you have to do is to make sure that you can take some of your assets let's say ether um have a sort of a copy of your ether on the roll-up on the layer two and use your ether on layer 2. so this is usually the simplest way to do it is to
have some smart contracts to to sort of twin contracts that would Bridge from layer one to Layer Two and layer 2 to layer one and the standard solution is to when you want to send your your assets let's say ether to a negative two you would lock some of your ether in a bridging contract then there will be some mechanism to trigger the minting of the equivalent number of tokens but copy of them they are usually called The Wrap whatever tokens or right ether the copy of your token that you've locked in the bridging contract on name one with the made available to you and minted on Layer Two you use them on Layer Two and at some point when you want to transfer
the remaining tokens that you have on your on your account you will try to transfer them back to layer one and the mechanism that's usually used is that you're going to burn them so they will disappear on layer 2 and this contract is going to synchronize with the the bridging contract on layer 1 that will deliver somehow unlock some of the ether and and send the equivalent of the tokens you have on layer 2 back to your account on A1 so you can see here that there's a communication l12 messaging so you need to have some a good communication and if you want to transfer the assets from one layer to another
another thing that you have to do is to be able to execute byte code so Ed and byte code that you will have executed on layer one you'd like to execute the same on the YouTube so why it's because if you have your smart contracts for instance compiled to a 3D and byte code and you need to change them or have a specific compiler to a random or Layer Two you may not be very happy with it and you can't really ensure that it does the same thing as it would be doing a layer one so these are the two problems that you have to to solve and what are let's say the the main challenges in there is that there's a cross chain interoperability so how do you communicate let's say generically from
layer one or a layer to to another one so the way it works if I understand well correct me if I'm wrong at the moment is bridging from L1 to L2 you've got the bridging contract on L1 and it will send well produce some log or events messages the there should be some mechanism on Layer Two that's monitoring the log messages on N1 and the retrieve them and triggers some some minting when they see some messages coming from their own bridging contract and so on so that's a complicated mechanism there were lots of attacks in the last few years on Bridges and if you want to get a reminder of this they were recent talks at this meeting actually by
hernia's a couple of months ago and David a couple of weeks ago so I encourage you to watch them again so basically the problems here are to design some cross-gen in terminal operability mechanism that can be used out of the box so this is not fully sold as I understand it and it's a mechanisms or templates that you could try to get to show that your Bridges or the smart contracts that you implement to to perform the operation of the bridges are secure so you won't lose assets they won't be attacked on the let's say code site so you want to execute the same bytecode so do you have to modify it or not so the issue
here is that some of the uh the op codes are in the evm uh we have some meanings that are actually uh strongly tied to uh what's in the evm on layer one so some of them for instance like the base fee EIP 1559 gives you the current base fee and Armature costs to to to how much the gases in the current block uh block number is also an OP code in the ethereum virtual machine that's of course related to the blocks that you have built so when you port your code and you execute it on layer 2 you have to deal with these up codes and and decide what's going to happen what's the base thing what meaning as the base fee on Radio 1 uh on on Layer Two uh it's
not probably sometimes you can even pay in another currency the gas on your Layer Two you don't need to pay it in if you could pay it in Arbitron or option some token and so on so what does it mean the basically the the current solution is that some of the outcodes are somehow disabled so you can't really use them um so that's also that's an issue and this issue is usually bundled under the term evm equivalent so what exactly can you execute on Layer Two Can you execute a modified code and does it have exactly the same meaning so they are currently solutions that are trying to implement the all the op codes
so there's a different there also different levels of what's called evm equivalents so again equivalence here I'm a bit sorry about it but it's not formally defined usually it's a wish so there's an article by Vitali describing different types of evm equivalent in increasing order of strength so now another issue that can of course arise is What's called the data availability issue so in this uh in in this slide I've shown that actually you publish the transaction data so you publish them on layer one at some point they become finalized um the thing is that if you if you publish them on layer one uh you still
have some interaction with layer one and again it's going to limit your throughput you can't publish more than 15 per second so you are dependent on the somehow performance of layer one to determine your overall performance of the you may have to wait to push a more sequence of transactions to be uh to be uh archived on A1 and when you push them on so the solution that I'm going to show is maybe to change layer one to have the dedicated layer to handle data variability but then you'll have the issue of deciding um and showing that you actually can retrieve the data and the data are available to others it work so you could for instance a couple of weeks ago as
well there was a talk by SRI Ram cannon on eigen layer and eigen da which is sort of a layer that can for you handle data availability so if you do so then you may increase if the eigen the data are very big the availability layer has better performance than layer one of course you increase the throughput potentially but at the same time you'd like to know whether you can retrieve the data so when you push the data to this data availability layer what kind of proof do you have that the data has been stored and not corrected how long is it going to be stored for and so on how much is it going to cost to retrain it
um so just a minor point on that on that note is that if you use a different layer one a data availability layer the roll up that you're building is usually called I think a validium rather than a roll-up because the security is not inherited directly from layer one on ethereum so you have to solve these issues so another problem that rises as I mentioned before is What's called the finality problem so on neural layer 2. at the top right you're taking transactions execute them pushing the sequence of transactions to the layer one and normally or two what's happening is well once you've determined the
sequence of transactions that you're going to execute on layer 2 this is final this is final because you're not going to change this order and this transaction pushing the the order of transactions on layer one at some point it should be you're not going to change your mind right you've decided which order it was and you're not going to change it so that's the order of transaction is final and you can recompute the state by processing the sequence of transactions to retrieve the current state so this is not going to change but now assuming you would like to transfer some asset from layer 2 to layer 1 and you've performed some computation you still need to wait for the
confirmation that your sequence of transactions and of course the sequence of states that you've computed has been accepted and has been validated somehow so that the computation is not corrupted so you'll have a finality at some point on Layer Two so um yeah I wrote L1 finally that's a bit misleading it depends on everyone's finality but it's L2 finality so at some point you will have finality of a transaction too it depends on the finality of the transaction on L1 or the data availability layer if you're in an optimistic hold up because the mechanism to to verify that the computation has
been done properly is a sort of a Time window that you have to wait for you may have to wait for up to seven days before your transaction in final and layer 2 and then that means that you contact your withdraw your fund from Layer Two to layer one bridging them before this period of seven days if you're in the ZK roll up so you have finality when you publish your sequence of States but still you may be dependent on the 2.5 epochs finality for uh for layer one because your verification in the ZK Roll Up is a code to a transaction and a call to a Smart complex so you need to wait until this process has been fully done so the
question here is how do we determine finalization uh can we shorten finalization there are lots of I think solutions that have been proposed if I understand well Arbitron they rely which is an optimistic Wallop they wait until transactions have been finalized with the publication has been finalized on layer one plus of course the seven days optimism they have some mechanisms to try and fast and somehow speed up the finality but you need a mechanism to sort of handle potential reorganization on layer 1 that would impact the results
on Layer Two so that's not very easy to understand I don't really know how it works if you know please let me know but this is an issue to try and shorten the time between finality on layer one and the other layer and be able to transfer terms rather quickly between the two layers so it's not a matter of transferring the phone but when can you do it and can you do it fast enough if you have to wait for seven days to withdraw your funds from layer to to layer one that's that's a big issue so yeah I've talked about that already so I'm going to see that so now the verification in a roll up this the What's called the sequencer is going to pick up some
transactions from the Manipur order them and compute the sequence of States um and to do so of course this sequencer is going to use an implementation of the uh of the evm so an evm interpreter it's going to compute the transition function and then it doesn't matter whether it's an optimistic wallet or a validity um you've got some mechanism to be able to verify that this actor the sequencer is not malicious so in optimistic collapse you've got seven days to to check when this computation has been properly performed or not and in ZK Roll-Ups you're going to get a proof posted with the resulting State and you can check
the proof the commonality between these two things is that you've got the sequencer Computing the sequence of states or the new state with an interpreter an evm interpreter and the verifier be it ZK verifier or a verifier let's say an optimistic wallet that's going to recompute the state has got their own implementation of evm virtual machine so what's going to happen is let's say in an optimistic roll-up you may have a verifier that picks up the sequence of transactions within the seven day window replace it and say oh no there was a mistake uh well I I there was a difference into the in the state and I
found a state after one transaction that's not the one that has been computed so there's a dispute in that case and you're going to have to resolve the dispute the same thing could happen with the ZK roll up your posting a proof and the verifier of the pros could say no I don't accept the proof the proof is wrong I reject it so at the end of the day what's happening is that you've got a mechanism with the resolver again an external third-party node in optimistic wallet that's going to redo the computation and and maybe narrow it down to one instruction in the evm and so on or a verifier on the ZK roll up but they have their own version of the semantics
of the evm and you're going to have to trust the semantics of this verifier so the question is how do you know what the reference semantics is that that's going to be used is it equivalent to uh in an optimistic called the fraud proof resolver semantics or the ZK median semantics so there are several issues in in there so for instance in Arbitron uh which is uh to my knowledge the the only optimistic wall up with the fraud proof mechanism enabled at the moment the fraud proof is actually a third party that can run gef and gef has been computed with the target which is wasn't
so you compute you compute let's say you've got an execution of Geth with a Target code which is uh to get compiled to wazam and you execute GIF written in wasan whereas the sequencer in arbitrum is executing GIF compiled to go but they are the same Source version of death um you need if you want to trust this mechanism you need to trust the compiler from uh go to the native bytecode of your sequencer where you execute the code and uh I don't know arm 64 or M1 or whatever and you also need to trust that the compiler towards them and the semantic of wasm and the runtime of
resin all of this is equivalent so that's a huge trusted computer base for ZK Roll-Ups you've got this uh sort of semantics of the evm which is given not actually by a function but truly by a relation so you need to trust that the relation and the semantics of the evm that's been written in circuits and constraints is somehow a trusted what an equivalent to some some reference semantics that that you would have let's say the yellow paper which is not a good reference semantics because it's ambiguous so yeah who do you trust if you have a dispute why would you trust the component that that's replayed the computation better than another one so
issues like that can arise actually right then if you uh if you have different versions of the evm you update one that you don't have to take another one and so on so when you resolve some disputes how do you make sure that you you can trust the results uh another one yeah that I'm going to summarize here I'm checking the time yeah I'm going to conclude in a few slides uh it's the fees and rewards so um I'm going to give you a perspective in this slide of uh an operator of a rollup so when you operate a wallop what you have to do is you've got batches of transactions arriving on your layer too you're going to execute them very fast and then you're going to post the the
data of the transactions to layer one but you don't really know at that time how much it's going it's going to cost so you know how much gas is going to consume you can compute it from the uh the size of the transaction data but you don't know the gas price at the time where the transaction uh the the the data available transaction is going to be executed on layer one so when you're going to charge your users and you're going to charge them with the predicted version of what it's going to cost when you're going to post them later on so ideally uh you would like to get the right price or you can overestimate it
or whatever if you overestimate it you're going to charge your users even if you spread the the data available in key field you're going to to check your users more than they should have been charged if you earn the charge then you're going to be out of your own pocket you're going to pay fees for posting the transactions but you haven't charged them properly so What mechanisms can you can you try to implement to uh to to get the better let's say a strategy so in terms of problems this is the how do you ensure that you've got lower tax fees and also can you make some profit or at least not lose money when you operate your Layer Two again if you post transaction data
and every time you post them you lose some money it's not good so what are the strategies how can you adapt dynamically to the current price of ether on layer one so that you you you're getting your money back and you're not charging your users too much so at the moment most of the layer Tuesday work using gas oracles or simple prediction mechanisms uh to to predict the price that's going to be the price of publishing and the data the transaction data and they try to adjust it dynamically and finally decentralization so as it was mentioned in the chat earlier uh you've got a unique sequencer in all
overall it deciding the order of transactions so that creates the of course the potential censorship or delay in processing your transactions or font running so ideally you'd like to decentralize the sequences to have no Central authority to decide the order of transactions you can try to do so but then you probably need a consensus mechanism which is going to introduce uh to impact the performance of your layer 2. they're going to communicate the the different nodes involved in the in the decentralized sequencers and so on and you may also have to deal as on ethereum with the front running and met attacks so it's not an easy problem to solve
it's the same actually I think as an experience so you have to be careful with it um so that's probably uh yeah the best I can cover so I can say that the mechanism here with the decentralized sequencer that have been proposed by for instance optimism uh in the upcoming Bedrock or or the next iteration of it uh they are mentioning that they would transition to decentralized sequencing by rotating the sequencer um I think rotating the sequencer is not at all decentralizing the sequencer it's rotating the centralization which is a very different concept so um a good mechanism to provide some let's say some Road trust low cost decentralization on
layer 2 is still to be uh to to be a design and properly analyzed I'm going to check the chat right so um I'll go to the chat after yeah I'm going back so that's the the end of the year let's say the problems that I have identified again that's not an exhaustive list of all of the problems you you can get but that some of them and I'm going to look at the chat if there's no question I'm scrolling back because I don't know which ones have been yeah yeah yeah
there's an awesome set by Peter yeah and I know an attempted to be answered by Peter but you know you should put in your own thoughts and I know I've got a question of Tim myself but but let's just why don't we fire through a few of them in the chat yeah um yeah I'm still scrolling up so this one I remember I answered um it's good to have a popular topic isn't it Frank yeah yeah it's good to have questions yeah so let's see um the sequencer I was I stopped there so here's the future
for dependent is the future of four lips dependent on the robust infrastructure of bridges or is it tilted toward the towards a bridgeless design so there's some answers by Peter and Twitches everyone on lips are straight for World bridging roll it to another and one not another two right yes so I don't know I can't answer this question I think it's moving very fast and I I wouldn't claim that I'm aware of all the solution so um I think it would be nice for instance
let's say for an um roll-up designers right uh your customers are going to ask you or can I Bridge my assets my uh my token ether to to the roll up so at the moment if I'm correct uh most of the bridges are on an add-on basis for each token so you design a twin twin contracts for ether twin contracts to bridge ether from Layer Two to Twin contracts to bridge near to Layer Two and layer one and so on so it's another process and and even if it's an erc20 contract there's no real good generic solution to bridge
erc20 assets they usually customize the contracts uh that's what David from and optimism say that they are doing so having a sort of a more streamlined solution uh would probably help and and the communication as well the N1 and messaging and two and one messaging via the logs or the event it's something that that probably not optimal you have to extract from lots of texts and also encrypted messages you can't communicate in plain text right you can't say oh I'm bridging 10 10 ether from this account to another one because I could publish the same message and take it so you have to really make sure that it's properly encrypted so the
bridging I think is a is an issue and lots of attacks on Bridges uh happened last year I think it was more than 2 billion US Dollars stolen with purchase within Bridges so the verifies that Peter has answered some question terms the verifier is a contract on anyone proverb works with sequence set to generate protested me to verify only one okay but the Challenger of optimism with desid o if I'm correct um optimism even in the newest Bedrock iteration they don't have fraud proof enabled
and so um uh I don't know what the Challenger he's in this in this city if the Challenger is a very fire that's not enabled yet yeah I think I I recall there were some contracts to a that sort of looked like they were going to allow you to challenge but um then there was another point that someone had that maybe that wasn't that um I think there's an interesting mechanism in Arbitron uh you can have of course you can you can well in I'll become the mechanism is that you can have validators proposing new States
and there's a mechanism such that if at some point you have one state with more than um two children there will be a dispute and the dispute will be resolved and the states that have proposed the different states they have to stake them assets to to to to to to step to it so the dispute will be resolved and the stakes may be slashed and so on so this is a mechanism that somehow incorporating some third-party verification or validation so it's in between voting like on ethereum and and it triggers the thought so the fraud book is triggered when after a certain
amount of time you've got two two children branching out of a given State there will be the dispute resolution in case the malicious word is this one the Challenger foreign verification takes seven days what's the seven day oh yeah so the seven day time window it's an empirical number uh so some people have decided that seven days should be enough for you to contest but it could be one hour or two hours I I
honestly I don't know uh if there is anything rational that can justify uh this yeah so I think the idea is that um you don't want to have something bad happen just as there's a lot of network congestion yeah yeah so like you can imagine someone does something that caused the whole network to be completely blocked and then someone says hey let's do something malicious now because no one be able to put a fraud proof in and so yeah but the seven days I mean yes it could be two days or three I don't know actually yeah yeah yeah why seven days not one uh yes yes yeah yeah well I I could yeah I I it would seem
incredible that the whole of the ethereum network could be completely jam-packed for a whole day but I don't know maybe I mean a week felt feel safer for a a proof so here's a question for you for asking one live so so we in um so in polygon Edge um you've got like a decentralized um sequence so you've essentially got an ibft2 chain blockchain so you've got you know instant finality and um and so all the blocks of producing state um and um you've got these um you know I ordered list of transactions so that's your
decentralized sequence so and then you've got zero which is taking the trace of the transactions and producing a proof you post that proof onto L1 and so we've you know we've been you know like trying to think what happens if there's a bug in the prover you know in the previous so that's part of the verification uh issue that I was mentioning you can have a you cannot you're right you can have a burger let's say you can have a burger in the evm engine that you're going to use to replay the transaction in the verifier let's say the ZK uh ZK Prova for instance you can have a bug in the
proverb you can have a bug in the circuit you can have a bug in the program and so on so yes I agree yeah yeah and I mean the way we came down to for recovering from that is you'd have a hard Fork of essentially the proving engine you know it's like you know how you can have a hard Fork of a blockchain having a hard Fork of an approving engine and then but I'm just trying to think of would you actually detect you know like because from what I can work out you're going to create a valid proof so it's still going to verify on the contracts on L1 um so maybe you would have incorrect state but no one notices or cares I don't know I'm I've been grappling with
that one for a few months to try and think about you know what does it really mean and does it really matter if you've essentially got two versions of the UVM running producing yeah yeah so the thing is basically nobody can tell right we can't formally prove that let's say um a ZK proof which uh in a ZK proof you have embedded the semantics of the one semantics of Varian in your proof relating to different states to sequence of states and so on uh you have let's say on the other side that's an implementation of the Cinematic that two implementation somehow the question is um how do we decide which one is more trusted or trusted
right which one is the reference one and I think it's something that you can't really resolve because you need a formal well you would have a formal specification of the semantics but what you need to know is probably uh your your computation is going to be checked against these semantics that's implemented in gas or whatever so you should know the Target or the reference of the uh the semantics otherwise it's very hard to know and I mean you can honestly compute the correct next state but the sort of the verifier will have the wrong code and and you'll be slashed so this is not right and what you can observe is there's a difference into the
the next states that have been computed what do you do in that specific case do you slash straightforwardly or you say all right um maybe we should check a bit more whose right is wrong there's no reference semantics so friends I think the the problem to me is really uh between let's say Geth or Basu and so on you can test them right you test them against a huge number of tests test tweets so you got some confidence that they produce the same thing on a lot of different uh evm byte code but for ZK EVMS you're encoding the semantics of the zinc of the evm into constraints constraints and then circuits and then polynomials and blah
blah blah you don't have an executable semantic so you can't really test it against an existing one so that's a big issue and the encoding into all of these different layers right polynomials constraints and Tony is not trivial so there's a lot of room for uh Heroes that in that encoding yeah yeah yeah yeah um so there's a discussion um in the chat about um whether patching the prover is not a bigger as big issue because it's non-chain um and the code's not on chain but I think
the proof would have been published on train so on chain so if you um I mean the thing I was thinking is if in your constraints engine inside of your circuits um you had missed a constraint and then had a bug in the circuit that wasn't being detected because you were missing a constraint and I think you're going to end up with an invalid yeah in the wrong state but then yeah and then you'd have to do a hard Fork to get to back to the correct state yeah I agree with that yeah uh
yeah so I see the chat invalid proofs will be rejected yes I understand that but the rejection will be the prover has rejected the proof but we don't know whether the prover itself is not buggy so the Provost should be um I would say yeah that should be okay to design the program that's not biggie The Profit self the mechanism to generate the proof is very tricky so you can have a mistaking the in the semantics that you've encoded in the in the DK proof and then you can't really trust that the fact that the prover accepted the proof is is well and that's the thing if
you yeah if you're missing a constraint then you could accept the proof but it still could be wrong yes we accept that there's some trust and some trusted components and I think to me that that's what we should be aware of uh what is assumed to be trusted and we can't do anything about it so it's not about having the correct semantics but it's having the reference of what is the correct semantics what what is going to be used to um to resolve disputes that you need to know yeah yeah and Ron has said something about um Elia Elio is working on a certified compilation but yes exactly yeah yeah so that's again these problems
these are problems that I have identified on my own these are programs I think are important and there are some people working on them already yeah that's good to know sounds good could you share your slides again and can we do those last slides oh yes sorry oh no that's okay let's talk about what's coming up next if I can retrieve it let's see um no no that's it that's it sorry
click on the wrong one oh yeah that's I can't find it I have I think I've just about to have it here and um and I'm just gonna have it open and hopefully in five four three two one yeah
all right just gotta wait for it to turn up but anyway he looks like I shouldn't share mine then yeah yeah oh actually that's not happening for me so let's you know how life is sometimes when you just want to look at something and I can uh I can share it that's okay I've got the um this one okay yep yeah yeah that's enough yeah all right yes so the so the merch store is is open so um get your cool merch which is good including
this t-shirt here um next slide all right so we've got a few talks coming up so we're actually got a winter break for um a few weeks now and then after we come back and for those in the northern hemisphere a summer break um and um so we've got attic Banger um who's on the call right now um is going to give a talk on paymaster Smart contracts which is going to be awesome and then the week after that we've got Jaden Wendell is going to talk about um ERC 6551 and then Philip zetner's Sentinel is going to talk about
um the case for bridge aggregation and um then after that we're going to hear about um Forge development so using uh Forge for solidity development and that's going to be August 30. um and then the last slide is this one so if you're here today there's a YouTube channel if you're watching this on YouTube you want to join live there's the slack invite for the slack workspace and there's the Meetup Group sometimes we have example code you'll find it on there if you're interested in formal methods there's a reading group that gets together reasonably regularly during the slack workspace and you'll hear all about that so um thank you Frank for that
and um yeah so look thank you for a great talk and um yeah hopefully people have learned stuff and um yeah I guess we'll see you all than about two or three weeks time and arag Banger is gonna um be telling us all about paymaster stuff at that point which would be cool so um see you all then see you bye-bye bye bye everyone thanks Frank that was awesome
Related talks
- Ethereum’s Native Rollup Roadmap with Justin Drake & Federico Carrone
- Exploring Blockchain Scaling Solutions
- Control Flow Graph Reconstruction from EVM bytecode
- Ethereum Needs Native L2
- ZK-EVM
- Are blobs good for Ethereum?
- The Execution Layer of EVM Chains: Scaling, Fragmentation
- Interblockchain Communication for Eth 2.0
- The Argument for Ethereum and Layer 2 Solutions
