New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Scaling Ethereum Summit | How Rollups *actually* work - Kelvin Fichter

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Kelvin from Optimism for a talk titled " How Rollups *actually* work". As new users flock to web3, critical infrastructure advancements are needed to scale. Scaling Ethereum is your chance to shape the future of Ethereum. Join us March 10th-29th for three weeks of hacking and summits featuring teams like Gnosis Chain, Scroll, Hyperlane, UMA, IPFS/Filecoin, and more. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Applause] [Music] so without further Ado let's welcome Kelvin to tell us about how Roll-Ups actually work one coming hello Karthik how you doing how you doing doing one and I can't wait to see what you have for the next 30 minutes because I got some he's on Twitter and uh I'm excited so I'll lie to you take on the floor thank you thank you all right so away are we we're good all right hello everybody this is am I lagging maybe I'm lagging no I don't know whatever this is how roll ups actually work this is a talk for all of you who think you know how Roll-Ups work but you don't I know you don't because I don't even know how Roll-Ups work and I've been working on them for for far too long I've been working on them since before you were born this is a talk about how Roll-Ups actually work also known as where is it ZK Roll-Ups aren't real that's correct ZK Roll-Ups are not real I don't believe in them birds are not real the ZK Roll-Ups are not real that's correct my name is Kelvin I work for op Labs I'm building the optimism Collective because I believe that we can actually change the world with the stuff that we're doing and not just build a whole bunch of garbage let's go all right I want to tell you a story I want to tell you about how you think Roll-Ups work because I know exactly how you think Roll-Ups work and I'm going to tell you in this story check it out this is you right you're happy you're on you're on ethereum and you got some money who doesn't right in this in this situation then there's this scary Bridge smart contract right and this is also on ethereum and it and and the British smart contract kind of gets you over to optimism land or it kind of protects optimism I don't know I know you think that this is how it works and um and so then you wanna you wanna get your money over to optimism land right so so you you know you send your your uh your money over to the bridge smart contract the scary bridge and you know it goes nom nom nom and it eats it and spits it out on the other end and it and somehow it gets over to Optimus and and belong with the sequencer can be malicious or something and so we we need to turn the uh we need to turn the the bridge smart contract into into securing a guard and we need to give it some sort of uh ability to protect the roll up and so we add these things these proofs right we had these like fault proofs that protect the roll up the fall proofs it's like you know so I'm giving the security guard in AK-47 and then everybody knows that obviously uh Ezekiel Roll-Ups are better than optimistic robes because because uh the marketing department told you so so that's like adding a second AK-47 but this time it's gold-plated and uh and now and now we're really protecting the roll up nobody's getting past the the security guard Bridge contract with two AK-47s um and and that's and everyone knows that the bridge to our contract is how we protect the roll-up right wrong RMS is wrong every single thing in here is wrong if you think that this is basically how Roll-Ups work you're wrong and that's okay because everybody is wrong they all think the role of stories that work like this and they don't they don't work like this so I'm going to tell you how Roll-Ups really work all right so I want you to forget everything you've learned you know here's you I want you to take your your mind eraser and blast yourself in the face with it what is a roll-up right boom a function over an input array that is a roll-up at its core right when we think about a roll-up we always have a data availability layer we have some sort well there's actually two important things about this this input array there's two really important properties there's ordering and there's data availability and those those two things are both critical ordering is really really important because if the order of my input array changes then the outputs that I get change and data availability is really really important because if I don't know what the inputs are then I can't compute over them so in a roll-up you have an input array right and we usually think that that's a blockchain but it could even be more than one blockchain put together uh but let's just say it's one blockchain for now and we run some kind of code over that input array and we generate an output array this is how a roll-up functions right so simple this is the roll up this is the roll up and I want to I want to note that there's not necessarily A one-to-one correspondence between the inputs and the outputs it could be that one input produces multiple outputs or that multiple inputs are required to produce a single output but the point is that this picture right here what you are staring at right here is the roll up this is the roll up when you think of a roll-up it's this thing right there's some inputs that's the L1 blockchain there's some code that's the roll up node software and it produces some outputs and that's the roll up blockchain itself and so there's a very important question which is how do you actually append stuff to this input array because a roll up is not useful unless we can put data into it and add transactions to it and so we need to be able to append things to the input array so generally one way of appending inputs is to append things directly right so here's the input array you know it's the blockchain we're at the latest block here's you you're happy you want to put a transaction in depending on the capabilities of the layer 1 blockchain that we're interacting with you can usually just insert a transaction directly right so most Roll-Ups have this capability there's some sort of smart contract that you can interact with where you can send a transaction to that smart contract and you can insert a transaction into the L1 directly that adds stuff to the input array which also as we see in this picture will produce outputs right so that's approach number one and then a very common secondary approach is this thing called a sequencer now a sequencer the idea of a sequencer is that this is very inefficient posting data like this is very inefficient because there's a lot of fixed overhead when you submit transactions to to a blockchain like ethereum in in ethereum this is you know specifically there's this 2100 gas base cost for every single transaction that's actually a lot of gas for most transactions when most transactions can be compressed down into a lot less so we tend to want to be able to batch things together which allows us to do this fancy compression stuff and really take advantage of of sort of economies of scale so we create this thing called a sequencer the sequencer is our little King of the castle and essentially all the sequencer does is that it takes user transactions and it bundles them together and and what it's going to do is it's going to create bundles of these transactions and it's going to publish them to the data availability layer to your to your L1 system but the important thing is that we want a really we want a good user experience publishing these getting these bundles together can take quite a while we don't always want to publish these bundles immediately and so what the sequencer does is the sequencer pinky promises that they're going to include this bundle in the future and you see I've I've represented this Pinky Promise by highlighting this in Gray and essentially what we can do is that we can run our rollup code over what we think the roll-up or the the the input array is going to look like in the future and we can generate these outputs and we know what the outputs are going to look like in the future and this is before the sequencer has even published anything to the L1 we just know that this is what it's going what is going to look like assuming that the sequencer comes through on their pinky promise and eventually the sequencer sends off the transaction to the actual data availability layer and this becomes real so the inputs become real and the outputs become real right so that's the gist of the roll-up this thing that I've represented to you is the Roll-Up and I'll note that I haven't talked about any sort of proof mechanisms or ZK Roll-Ups or optimistic Roll-Ups because all of that stuff is fake and I'll explain to you that in a minute so the next thing is well we have systems right and and we want to connect these systems with other systems because connecting with other systems is useful um you know if we just had this roll up I guess we could interact in our own little bubble here and this is what you might call a sovereign roll-up right uh it's you know you can post data to this data availability layer you can interact in your own little bubble but if we want to interact with other things we need to be able to connect with other systems so how do we connect with other systems well we have an automatic connection to the parent system where the parent system is where the L1 data lives where the inputs live because sort of whereas the I want to do the spinny Thing by definition that's how the roll-up works the roll-up is is taking its data it is defined by the data and The Ordering of that data right so we have this automatic connection to the parent system which is why I can include transactions by sending a transaction directly to the parent system because just by definition I am deriving the roll up from that parent system but what about other data sources where you don't have this type of trustless connection this this definitional connection to these other data sources what if there's another blockchain there's you know there's uh you know kelvin's super roll up two and and I want to bridge Kelvin super roll up two and Kelvin super roll up one right I wanna I wanna get information from from this other roll up into my roll up well like we said anything from the input is trustless because the roll-up is defined by the input but for anything else we need a convincing argument right why should smart contracts on my roll up listen to stuff that you're saying over on your roll up or that smart contracts are saying on your roll up why should I listen because at the end of the day they are two separate independent systems and I don't have this direct connection so why should I listen to you well we need to be convinced right so how did how do we do this how do we generally be convinced of things on other chains this is just asking how bridges work how do bridge protocols work well there's a lot of different ways that we can make Bridge code protocols work uh people do Authority based Bridge protocols right which is like oh where is it God coming down you know with God's little weird finger coming down and saying uh this is what the other roll-up or the other blockchain looks like right now just just trust me right listen to me and if you trust the authority if I'm a smart contract on my chain and I trust the authority and I'm like whatever you know God's not going to lie to me who cares then I'm fine then we have sort of a strengthening of this we have threshold thresholds authorities so maybe you know God has three hands now and two of them have to come down we have like clients you know which is sort of the the ugly little brother of the chain coming in and saying you know good enough it's a it's a representation of the chain it's not the chain itself but it's a representation of the chain with pretty good trust assumptions where where we can say okay I I'm convinced you know that this is this is the state of the other chain we have fault proofs right fault proofs are essentially two people going back and forth saying no you repeatedly until we figure out who's right and then we have validity proofs and that's the you know that's the math nerd coming in uh with such a convincing argument that you you simply can't uh you can't reject it right uh this is how we communicate between blockchains this is how blockchain communication happens if I have a third party chain and it wants to communicate with me it has to convince me what its state is now what's the worst thing that can happen in this situation what's the worst thing that can happen when somebody is trying to communicate with me in this way well I would argue that the worst thing that can happen is that apps on our chain could be convinced of something invalid right the the mechanism by which I'm convinced of the thing that's happening on this other chain could break and it convinces we could convince me on my chain that something happened on your chain that didn't actually happen right where's my oops and and I want to put this in caps because I'm going to bring I'm going to come back to it later but this does not directly impact the other chain what has broken here is my view of the other chain the other chain is is is running independently right it could be that the other chain has absolutely no clue that I'm even trying to read data from that other chain if my view of the if that other chain breaks the other chain does not break I mean my smart contracts might break because I might be making decisions based on bad data but the other chain doesn't break all right so let's get to withdrawals right because I've talked about all this stuff and I've talked about a whole roll-up system but I haven't talked about this bridge stuff and and the proof mechanisms yet so what is it what about withdrawals right so what are withdrawals let's look at this picture again we have the roll up this is the roll-up when you think roll up I want you to think about this we're adults now so we know that that I was sort of lying to you and that these things there are blockchains um what are withdrawals well I want to put these pieces back together and I want to show you something so here's you and let's say you want to send some funds from the parent chain into the child blockchain into the L2 from the L1 into the L2 what do you do well you use the mechanism that we talked about earlier to directly add inputs to the input array you send a transaction to the L1 blockchain this adds an input to the input array that tells the L2 kind of trustlessly that it can mint funds on the L2 all right so this is the same picture that we saw before it's one directional it's one directional and again there's nothing in here about proofs optimistic or ZK but now I want to get my money out so I light my money on fire on L2 and I tell the L1 that I burned it and the l1's like I have no clue I don't I I the L1 doesn't read the L2 the L1 has no clue what's happening on the L2 and so the L1 says prove it right this smart contract on L1 that is that is uh locking up these funds says prove it and so you got to put on your your judge your judge wig or your uh your lawyer wig and you have to prove it so let's go to court right here's you with your lawyer wig here's the smart contract on L1 that has the key to your safe how do you prove it well one way to prove it is you could use a proof of authority and that's God's finger coming down then there's a threshold system and that's and then there's like clients and then there's fault proofs and then there's validity groups wait a minute this is exactly like we what we just did when we wanted to receive data on the roll up it's the same image but in Reverse just like when we want to receive data when we want to send data to the L1 we need to make a convincing argument to the L1 about what and this is this applies to any chain when we want to send data to any other chain sending data is like receiving data but in reverse that should seem obvious to us but in our mental model as it traditionally isn't but it is obvious withdrawals are just another chain receiving data from the L2 yes that's how this works withdrawals in this case the standard thing is that withdrawals on the L1 are the L is the L1 receiving data from the L2 just like how we talked about how the L2 can receive data from other Chains It's a symmetrical image and so when I if when I talked about this what's the worst thing could have that could happen it doesn't doesn't directly impact the other chain right the worst thing that can happen is that the the smart contract on L1 releases some funds that it shouldn't release which is bad but it doesn't directly impact the L2 and this is a really really really important property to understand if the bridge breaks the roll-up does not break this is such an important thing to know about Roll-Ups I think so many people have this mental model that the bridge defines the roll up but in reality the bridge does not define the roll-up at all the bridge is a view into the Roll-Up if the bridge breaks that is obviously Bad Assets on the roll-up can become under collateralized but if the bridge breaks if the bridge finalizes a state that is not what what's in the Roll-Up that is a problem for the bridge the roll-up is still going to continue operating as if nothing ever happened because just like I said in the slide many slides ago the bridge or the roll-up may not even know that the bridge exists and in many cases the roll-up has absolutely no clue that the bridge exists so let me get to the second part of this talk which is that ZK Roll-Ups aren't real now obviously ZK Roll-Ups are real in the sense that people create these things and they call them ZK Roll-Ups right you know we've got CK sync uh we've got polygon ckm evm the wait is over but I'm still waiting and then we've got scroll right um when I say ZK Roll-Ups aren't real what I really mean to say is that the ZK part is not fundamental to the Roll-Up in the way that we just described Roll-Ups there is a roll-up part and then on these other chains there's an implementation detail of a smart contract on a completely different system that has nothing to do with the Roll-Up that either uses a ZK or an optimistic or a like client or a or if an authority proof or many different sort of things to establish a view into the roll-up on a completely different system the ZK part is not fundamental to the roll-up there is no such thing as ZK or optimistic Roll-Ups there are just roll-ups at the end of the day there are just Roll-Ups and then we create these view mechanisms on other systems completely separate systems and then they have proof systems and those things are ZK are optimistic but if you tie these things together if you think that there's a thing called a ZK roll-up or an optimistic roll-up and somehow ZK and optimistic Roll-Ups are fundamentally different you're going to be at a disadvantage in the mental model for what a roll-up is and the reality is that I think the optimistic crew gets this now but why not the ZK crew why why like what is this and and I think the answer is that CK is really hard and people feel like they have to create the ZK proof because if you don't create a proof If you don't create a ZK proof are you really a ZK roll-up right that's sort of are you really a ZK evm if you don't have the proof so they start with the proof and they build this proof right they build this proof system and they spend all this time building this proof system and it's really really hard and then they sort of cram the evm inside of this proof system they shove it in and it sort of you know looks like this and it's kind of like it doesn't want to be in this tight little space and parts are sticking out and it's not quite the ebm and then they pat it on the head and they and they say that it's just you know it's just looking extra equivalent today um you know but it's not really it's not really the ebm I mean let's whatever uh but what's the correct way to do this what is the real what's the right way to build these systems the right way is to build the evm in all its Glory you know this is weight lifting evm super evm and what we want to do then is we want to build the Box around it instead of cramming it cramming the group The the evm into the proof system we want to create a proof system around the EPM and this is what's really going to make it obvious that ZK Roll-Ups don't exist or is he or optimistic Roll-Ups don't exist really it's just roll-ups and then we want to make a proof system around it uh that's the gist of the talk I cut it a little bit short because we we had some technical difficulties earlier but thank you for coming to my TED Talk uh remember that ZK Roll-Ups aren't real uh optimism is not a roll-up optimism is an upgrade to capitalism join the collective change the incentives and you will change the world come check out the uh the vision of what optimism and the optimism Collective is trying to come check out the op stack docs if you want to build your own your very own blockchain uh your very own Layer Two today and you know I just want to say understand this property about Roll-Ups understand that the proof system is not fundamental what you want to do is you want to build a really good roll up and then you want to build a proof system on top of it and if you build a role up that way you can build a roll-up where it doesn't matter whether it's ZK or optimistic you can slap a ZK proof on it later you can slap an optimistic proof on it later you can slack slap 10 different proof mechanisms at the same time that's the right way to build Roll-Ups but if you think if you tie the bridge to the roll up you're thinking about these things wrong the bridge is an independent system the bridge is a view into the Roll-Up so think about that that's how Roll-Ups really work ZK Roll-Ups aren't real optimistic Roll-Ups aren't real join the optimism Collective optimism is an upgrade to capitalism change the incentives and you change the world have fun build something cool and if you want to fight me on Twitter we can fight on Twitter thank you so much and have a wonderful day amazing well it still worked out at the end we got everything and we'll make sure that once this goes edited out on YouTube it's smooth and perfect thank you and uh that was a really informative talk I think it's a really good way to think about those Primitives and just break them down into those R components that actually matter and uh personally what I got of it was that optimism is the real blockchain only serious blockchain there are other real books they're on the real watches but optimism is the only serious one that's correct basic well Emma thank you so much for joining us and we'll see you all on Discord hacking away on the op stack thank you bye everybody foreign

Automatic transcript — names and jargon may be misspelled.