Optimistic Rollup
EDCON 2020 · August 2020 · 14:01
Karl Floersch introduces Optimistic Rollup and the Optimistic Virtual Machine as ways to increase Ethereum throughput. At EDCON 2020 he also discusses sequencers for faster transaction confirmation and miner-extractable-value auctions as a way to support the network.
Speakers
Topics
From EDCON 2020, hosted by EDCON.
Transcript
[Music] hello hello this is called.tech coming at you live from the blockchain um today we're going to talk about a lot of optimistic stuff and so let's dive right in alrighty so optimistic roll up you may have heard of it before we're going to talk about that we're going to talk about the optimistic virtual machine in fact we're going to talk about everything together in the package optimistic ethereum and so let's dive right in so we have ethereum and unfortunately right now there's you know it's got a bit of a ball and chain because
of the latency and the throughput latency for ethereum is like you know 15 seconds in the best case that is not that is just too high we want it to be five seconds the throughput is insane the we absolutely need to increase the throughput this is the price fees over the past while it's been just going off the charts and so we need we need more in fact we need 10 you know 100x more probably more than that so how how do we do this well of course we cut that with optimism optimistic ethereum and we're good but okay we haven't actually gone into
any detail so how does this stuff work we're gonna talk about both of those two things throughput and latency first we'll start with throughput how do we get a little bit more throughput so scaling throughput with optimistic roll-up and the ovm that's our first section so ethereum l1 scalability this is kind of a recap of why ethereum layer 1 doesn't scale we have all of these different nodes and they all you know there's some percentage of good nodes and bad nodes and we have some kind of gas limit some throughput rate limiting thing and as we increase the throughput because all of the nodes need to process all the transactions on the network
some of these nodes start going offline and in fact if enough goes nodes go offline then we have a 51 attack and there is you know clearly here there are more dishonest nodes than the single honest node right here and so this is this is not this is not good and so we actually have to reduce the number the total throughput is very sad um so that all of the nodes can participate now if we go inside of one of these nodes what are they actually doing what is the transaction cost coming from well they receive a raw message they download the transaction and that kind of costs some amount of money then what they do is they start processing the transaction and they update their state
right and that costs a whole lot of money uh the state updates the you know the actual computation itself um and then they compute a kind of block cache and block header and stick it in a block and then propagate it so this is you know at a high level what happens on l1 but let's talk about l2 scalability so if we zoom out again we can see that there are multiple nodes connected these l2 nodes connected to the l1 nodes and in fact they can you know they don't have to be connected one to one like this it just is like that in this video um however what the if we look in a kind of you know closer closer view now when messages hit l1 what happens is they download the
transactions and they just store them they don't actually do any processing they skip the processing step they skip the state update step and then what happens is that message gets propagated to an l2 node and inside of the l2 node that is where the actual processing gets done that's where the state updates happen and that's how you know we calculate the state route now of course there's also a validity game that is played on l1 to make sure that these these fingerprints or these state routes are the correct state routes but we won't get into the details of that you can look up kind of the optimistic roll-up uh
validity game in uh in other places and so this is actually an example of parallelism because in the system we have two different you know uh two different systems that are running in parallel you can still send transactions to l1 but you also now have the ability to send them to an l2 chain and that is really nice so we have all of these nodes that are all parallelized another thing is we can actually scale up raw compute performance and this is a little bit tricky this you wouldn't necessarily think of this so the um layer one compute requirements right as we scaled them up we you know couldn't really go very far before we started hitting uh hitting some you know 51 attack limits
however on l2 we have the same property where we can scale up the gas limit um and so we're you know the but the difference is that in l2 there is only one honest node required in in you know in on l1 we need 51 percent we need you know even more in proof of stake however on l2 it's just one that's it so what can we do well if we start scaling it up you'll notice that here here we already we still have our one honest node our one honest l2 node now of course here we had a 100 attack right because we scaled it up too far this was like to the max but if we just scale it down a little
bit we still actually have the ability to have a safe network in you know more adversarial conditions and this is how we can kind of get actually you know higher throughput i mean higher scalability um on l2 then like then l1 and that is a kind of like inherent property of l2 and so whoo yeah we're super strong in l2 um and in fact when ethereum v2 comes around and i'm not going to talk about this in this talk um but that gives us even more super scalable you know uh weightlifting peeps hooray so that is kind of how the throughput
happens but the one problem with this is that it's actually non-trivial to support all of these developer to all the ethereum developer tools and we need them right we need the evm we need spidler we need solidity we need all the block explorers um you know this is this is critical to the ethereum ecosystem and composability and it's actually a bit tricky um so when we go back here this is what is tricky it's very tricky to get the evm to be what is run off chain because we need what is run off chain to in the worst case run on chain and that's because of the fraud proof that's because of the validity game and so this is actually this whole step is really really tricky to do
but we can do it thankfully um and the one of the easiest ways to do it is using container virtualization so essentially what that looks like is it's docker plus the evm so what happens is we have our off chain node running the transaction in the ovm and in the worst case we can send that ovm optimistic virtual machine to the evm and it can actually be run inside of the evm and it doesn't escape the sandbox right the whole point of containerization is it just keeps it you know contained inside of a little sandbox and so that actually gives us the ability to guarantee the validity of an l2 evm and use the l1 consensus so we get you know the same development experience
across all of these systems we get all the things hallelujah all right that's the first section that's throughput right that's throughput and the evm now let's talk about reducing latency with sequencers and miva very exciting so sequencers what's the sequencer well it's basically a relayer plus plus it's a relayer plus some crypto economic guarantees so here's our little here's our sequencer and we can you know we have our a user who sends a transaction to the sequencer notably relayers um are already a you know popular popular thing they use
you know uh users sign meta transactions and broadcast them to relayers who then relay those transactions back to the network and so you know you have a user send a transaction to a sequencer or a relayer technically and that will that sequencer will send the transaction directly to the ethereum chain but before they even do that what they will do is they will take a they will sign a receipt and the receipt will commit to inclusion of the transaction and the ordering of the transaction and they will send that receipt directly back to the user and the user will verify that the signature does indeed check out and is from the sequencer now the sequencer has included the transaction and everything is happy and the reason why this is great is because
the user immediately gets this guarantee you know this commitment to inclusion and ordering great success now if we do that again but instead we have a malicious sequencer well they might be able to they might break their commitment to ordering by sending another transaction in first and breaking that transaction so that's that's no good or they might not you know include the transaction at all and just throw it away what what's going to happen is the user is able to just look at ethereum and send the receipt to an adjudication contract on l1 that contract looks at the the chain and then slashes the sequencer burning their bond
and so this is a kind of technique that is used in proof-of-stake and is this is almost you can almost think of it as like a very small you know very attributable proof-of-stake system and now you have a bunch of sequencers so if one goes down right one of them is malicious you can always send to anyone uh you know of the many others or you can just send directly to the ethereum main chain just like with a you know uh a relayer you can always send your transaction directly to l1 and you know it'll get mined and and everyone's happy so even in the worst case it's not so bad even greater success so um the way the way to kind of think about the benefits of this
is that you can see on l1 you have this kind of slowly increasing top cost of reverting uh a block but when you get these immediate promises that gives you an immediate bump in the cost of attack and actually notably this is also the same in you know if you're you know in proof of stake where you can get immediate promises saying oh i you know i'll include this and that's you know why the transaction latency actually goes down um in proof of stake but we can get that even before um youth two and additionally we can talk about like the actual latency so the inclusion latency so when the the time for a transaction to be included in the chain is you know is less than two seconds when you get
these commitments however of course it defaults if in the worst case if you you know if the sequencer is bad to you know 215 seconds the ethereum block time similarly the confirmation latency in the average case is you know two seconds and the confirmation latency where you know kind of the ordering latency is a little bit longer in the case where you you know uh where the sequencer is bad um you know two minutes it's still pretty pretty comparable but what we're doing is we're basically getting the most out of this average case or this you know this best case um and you know hoping that the worst case doesn't happen all that often um but even if it does we can gracefully recover so finality requirements remain
unchanged and i mean and so this the you know the general structure of the blockchain doesn't change it's just a kind of extra layer for extra you know low latency and there's a bonus section so funding public goods with minor fees so the uh uh then this is a little bit of a you know hippy-dippy section you know i must confess um so one thing that we like with the sequencers is they actually enable us to kind of re-engineer the incentives around mining because that's the kind of l2 miner and so users normally on l1 you know used apps and that pays miners but developers make those daps and they have to figure out a way to actually you know sustain themselves and so this is a kind of like kind of messed up system because all of the
money is just going to these miners who aren't necessarily producing the you know the dapps and so we can actually introduce this and this is this is a concept called mev now imagine there's a world where um where instead you have miners having to pay back the you know transaction fees essentially to developers or maybe just everyone maybe all the public goods you know uh funding needs and you know the world will be happy and we'll all achieve universal consciousness anyway there's there's a possibility you know a possible solution mev uh auctions and this is uh you know something to to be excited about coming in the future
um and a way to organize and elect sequencers so with that we have optimistic roll up the optimistic virtual machine miva you know optimistic roll up scaling throughput optimistic vm uh enabling the evm on you know this optimistic setting and then miva uh this you know the ability to you know lower latency and fund public goods take them all put them in a pot shake it up poof you get optimistic ethereum um and so that is a high level description of optimistic ethereum thank you