DappCon 2023: Building your application-specific Ethereum Rollup - Luis Schliesske

DappCon 2023 · September 2023 · 23:29

Application-specific rollups let a single application control its own execution environment on Ethereum rather than sharing block space and fees with unrelated activity on a general-purpose chain. At DappCon 2023, the talk walks through building such a rollup, covering the tradeoffs and design decisions involved in tailoring its parameters and architecture to one application's specific needs.

Speakers

Topics

From DappCon 2023, hosted by Dappcon Berlin.

Transcript

hey everybody all right so um thank you very much for coming to these early talks and thanks Freddy for warming up the the room all right I'm going to talk to you today about how you can build your own app specific rollup and uh yeah I'm Louis I'm the founder of gelato Network and normally I give talks about our smart contract automation protocol that some of you here might have used in the past already that's what we sort of invented four years ago it's been pretty much used by every defi protocol out there and many others um or I would talk about our uh relay systems that have uh super high

throughput gasless transactions on a relay API for for two years now in production uh and that really have seen a lot of uh great scale or I would talk about our web three functions that uh is a serous um web3 environment that we built last last year where as a web developer you can write some typescript you can connect to apis like I don't know 1 in and and all these things Bridge aggregators you can generate payload from these apis and you can automate smart contract protocols trading all of that in your serverless environment um and with offchain data with any resource on the internet really so gelato automate before was restricted to onchain data now with web Tre functions you have the web to World open to be connected to your smart contracts

as well but none of that today um I'm talking today about something very different I'm going to talk about how ethereum scales with layer twos I'm going to to talk about how layer twos work uh I will look into um how to choose your um data availability layer like rollups versus validium um proving methods optimistic versus CK um and then also will help you to decide whether you should even have your own L2 because today it seems like my grand Ma and everyone else has an L2 but you know why why is that the case do you even need one what do and what do you need to run a ZK rollup so there will be a bit more

focus on ZK rollup um and and yeah then at the very end I'm going to reveal to you today how you can use gelato to run your layer to um and some of you might have already heard that the news cuz I did this talk at safe con as well on Sunday but um maybe you're here again and maybe I should open friends. tech for that I guess thank thank you very much for coming twice if you're here a second time all right so let's uh let's jump into that how does ethereum scale with layer twos um so by the way this talk won't be super technical if you're a technical guy or girl you might be a bit disappointed there's a lot of great articles out there I'm sure you know so

so this is more like really for a general audience more high level um what are layer twos what are rollups right so ethereum today has this issue that that it's a a monolithic client where sort of the execution data availability consensus settlement are pretty much done in one or two clients and um every node on the network needs to do everything and that has essentially led to it not being scalable we've tried for many years who remembers hyper quadratic uh sharding never happened really right so so yeah that doesn't really scale and um what rollups have sort of uh come up with is this idea of separating out the execution of transactions into a centralized environment essentially for

efficiency gains and so on uh and just using ethereum for data availability so actually storing the inputs to this to this uh execution and the sequencing of these transactions the ordering consensus around this of course so that all remains with ethereum very critical pieces that a decentralized network uh should do um but the execution of the transaction the actual State transition function and so on is completely done offchain on essentially like today a single sequencer sort of centralized environment sounds bad but why does this work why is the still ethereum aligned and and and cool is because of proofs right like ZK proofs especially but also in the optimistic model fraud

proofs and here the idea is that you run the computation of chain not every node in the network has to run it anymore it's much cheaper much more efficient but you can generate these proofs that it was run correctly and that is very succinct very compressed and that can be stored on chain so that anyone who's on the layer 2 if they detect a fraud or if they don't agree with with how the uh the protocol rules were abided by an offchain they can exit uh on the L1 they can prove that something was done incorrectly they can get their assets out again so um that's a bit spicy um but but like I mean where do layer twos come from right like we already had side chains for many years um so um so what what is you know why why why did side CH

not work in in most cases and obviously there's some cases where it did work pretty well um but but in many cases it was simply like people tried in 2017 18 already I mean there were some Enterprise chains I think and and many others um to to to actually have a separate blockchain to have app specific chains and so on but um it didn't really work because uh security was at least in most cases didn't work because security was very hard to do you had like a very low um security because you have to bootstrap your own external validator set and I think apart from noses chain almost no one has really managed to do that uh well um maybe some one or two others I don't know but but yeah that's

extremely hard whereas with layer twos you don't have this requirement because uh you can use the decentralized validator set of the data availab availability layer like no chain or ethereum or Celestia um and uh and you don't have to sort of build your build your own validator set and also that's much cheaper because you know uh if you do do a side chck and you have to pay all these validators you have to create a token you have to inflate that token it's extremely expensive to to run a decentralized network um and with the layer toos you don't really have to do that you still have quite a lot of cost today because you have to P the data to ethereum uh if you have a rollup if you have a validium there's some nuances here um uh but yeah it's it's it's still like overall the infrastructure cost are

are much reduced in this uh architecture one other key aspect is bridging so um sens have had horrible experiences with bridging bridging or um in many cases I mean uh let's let's remember rest in peace Ronan side chain uh ronand bridge I guess yeah that was pretty bad so usually side chains like they really don't have that much available to them in their toolbox again there's some do it well but a lot of them didn't do it well and often there's like a multi Bridge or something I think Hashi had a good talk here yesterday that you should probably catch up with as well for for how we can do better here um but yeah you don't really need this lack of security in the layer 2

construction because there you have a in the ZK case you have a fully cryptographic bridge that goes both ways you can use validity proofs to move assets between this chain it's it's all mathematically verifiable in the optimistic case you just sort of uh you know everything's happy and easy and then if you detect a fraud you can do this interactive fraud proof game um uh which isn't fully Done Yet optimism doesn't have it yet but but it's coming I think so so yeah that's another big thing and then in general infra costs are much less on a layer to cuz you can technically run like the single sequencer uh you don't need to have multiple like that many notes and so on right for exe executing transactions very quickly again super simplified this is not a technical talk

about l2s at all I love them they're on YouTube from you know many great teams uh but this one like very simple if you haven't sort of don't know how they work yet very roughly speaking there's a smart contract on the layer one that um keeps a record of of the state route of the layer two um the layer two uh notes to All of the execution of the transactions that get sent to them they you know do the state transition function they calculate the new State Route they H they stall the new state route on the L1 contract so that the L1 sort of is the settlement layer they post all of the data all of the transaction inputs to the L1 as well and now anyone can recompute the state on the L2 um and the assets on the L1 sort of are also locked behind this the the

state roots and yeah if and now the cruxs is that a proof is computed like a zero knowledge proof ideally and and that is also posted to L1 along with this so that you can validate on the L1 if the computation was done correctly or not and if it was done incorrectly you can get your assets out the smart contract will release them for you because you can verify and prove that they were it was done incorrectly in the optimistic case there there's a bit more of complexity there um so how does an execution flow on layer 2 look like it's a very high level explanation but you know the user users the whole point of an L2 normally is that you use the L1 assets like I I always refer to ethereum for example as the decentralized asset layer it it should be really good at storing our

world's Financial assets and nfts what have you um and then l2s are these environments into which you can upload your assets and and benefit from from the cost benefits and and the application sort of execution on there so so yeah you lock your assets on the L1 Bridge contract uh you send transactions to the L2 sequencer via normal opes uh your transaction is finalized and by the way this flow is again a bit more specific to ZK rollups ZK EVMS I guess um so transactions finalized on the L2 um but not on L1 that's that's the trusted state so at this point you sort of trusting the L2 operator which is centralized so you uh you know you can have soft commitments and so on but it's a bit like fine in most cases but it's not super robust

then the these sequencers send this batch data to the data availability layer so anyone any note can synchronize from there this is the virtual States a bit better already and now um You the the the aggregator approver takes takes these transactions and and creates a proof um that the the state update was done correctly and and settles that on the layer one and that's the Consolidated State and now you could you know you have finality you basically have almost as good as guarantees as if you had done everything on ethereum itself but you didn't that's the magic about it so um rollups versus validium uh in the optimistic case uh you might have heard of plasma like I think um optimism

for example is also thinking about validium uh but they called Plasma on the optimistic case what's what what are the what are the like what's the comparison here rollups use onchain data for data availability versus validium store the data offchain and by the way I mean rollups are usually like more secure validum are less secure but much cheaper so onchain data availability versus offchain data availability SL data availability committees these sort of things um yeah transaction through put today roughly 200 transactions per second for rollup th000 for for validium 5 cents per transaction for rollups one cent for validium uh although I think this should in the future be more of a discrepancy there um the trust mechanism for rollup is

cryptographically secured or or crypto economically secured with these proofs that I talked about versus an the validum it's it's not really that great because the security relies on a data availability committee for data storage it's it's pretty good for many use cases still but but yeah it's not as robust of as a rollup again it's cheaper though so so security and censorship resistance uh on a rollup technically in the ideal state every user can force the withdrawal from the rollup although today caveat that's not fully uh the case on every rollup yet whereas in a validium technically it should be the case but if the data is withheld then you might not be able to to get out so again you you have a bit more trust in in some of these more centralized parties here uh ideal use cases for rollups are obviously high value high

stakes use cases crypto payments um yeah these sort of things where you are willing to pay for a lot more security so probably like you know card issuers all of all of that and then for for validium it's more like maybe games really low frequency use cases um high frequency use cases and and low cost use cases yeah and in terms of Frameworks in the rollup Frameworks today we have OB OB the op stack is very popular we have the polygon ZK evm stack we have arbitrum orbit um and ZK Zing hyper chains um and then for validium polygon just dropped the cdk that we're also working with arbitrum has any trust and and I'm sure there's many many more

coming there as well optimistic versus CK rollups um so you know what's the what's the difference here caveat um as as normal like I think a lot of people are very bullish on ZK I think the optimism team for example are also like looking more into ZK now so so this is maybe a bit biased here towards ZK but yeah um it's still factual I think so uh transaction finality with optimistic rollups takes much longer why because you don't have these uh need ZK proofs you need to wait for someone to come in detect fraud prove it that that's quite quite a long process here H versus ZK rollups where it's super fast you can have finality as

soon as the proof is generated although today that still takes quite a lot of time is quite costly um fund withdrawals again same reasoning in optimistic rollups if you go back to the L1 and takes forever if you use the the crypto bridge now of course there's liquidity Bridges like uh Conex layer zero and so on that you could also use that sort of abstract this for you but if you use the the actual cryptographic way then it takes quite long um where with CK rollups we have sort of this future of instant bridging trustless bridging between all of them which I think is currently also all the rage for polygon 2.0 and so on everybody builds these sort of Internet of rollups right things um inter where where interoperability is essentially solved via ZK uh ZK

communication um optimistic Ro UPS today can do like 200 TPS ZK rollups roughly 100 TPS 5 cents versus for optimistic rollups versus seven cents for ZK rollups per transaction optim the validation mechanism for optimistic rollups is fraud proofs CK rollups have validity proofs and um in general optimistic rollups are more evm equivalent ZK rollups are usually more compatible although there have been great advancements made by the polygon hermis team for example on that front and I think scroll is also doing great work there um in terms of security and sensorship um optimistic rollups uh do have some more vulnerability to censorship um probably although it is a

one of n honest participant in the system um assumption which is pretty good uh but but ZK rollups as long as there aren't any bugs and probably bugs but as long as there aren't any bugs uh it's perfect like mathematical uh security um you can you can reason about that in a mathematical sense uh Frameworks optimism arbitrum and um ZK evm is polygon ZK sing linear right so should you have your own L2 if you need low transaction fees High fast processing finality more control over ux very important part more customizability kyc token utility you should really

think about it but if you need Atomic composability like flash loans and so on frequent uh entry entry and exit to like L1 assets and sensorship resistance like a strict like super good sensorship resistance and resiliency then uh maybe not um yeah the screen is back now all right so here is just some ideas like this might change but like who who should have their own L2 and actually some of them are already launching now right like Perpetual protocols right um Perpetual dexes need very high frequency trading very much better in instant finality much better for for an L2 than for an L1 where three games nft marketplaces like Zora right U social media platforms like lens I'm sure they will have their own L2 at some point I

think they're already working on it Enterprise blockchains ecosystem chains like base payments like noses pay amazing use case um and vertical integrated def defi um so if you don't really need access to any other composable apps but you have built everything yourself that's also a good idea but you probably shouldn't worry about an L2 if you're like a yield aggregator or Dex aggregator um what do I what do you need to run as Z rollup um just a quick list here so infra you need is you just need to run rpcs on on all networks like the L1 and then all the L2 networks that you want to provide you need to run a ZK approver and aggregator all of these things are sort of being built by polygon and others right um You need to deploy them can be quite costly still a

lot of sort of changing code you need a sequencer synchronizer some databases bridging API and you need to deploy the L2 smart contracts on the L1 and then the additional Services you need and that's really the crooks because you can sort of spin up your roll up all cool but it's completely useless if you don't have the suite of tools that we're used to from the L1 ecosystem so you need a block Explorer you need TX debugging tools you need indexes like the graph and so on you need oracles right Bridges Rel layers offchain computer some of these things we already provide at gelato like we have offchain computation with web pre functions we have relayer account obstruction with the save team right um a lot of actually a lot of apps and chains use our web functions to stream data from oracles like pith and

and Redstone and so on to chains so a lot of this we can already provide today and that's what I want to talk to you about today because at gelato I'm quite excited to announce that we are introducing our gelato rollup as a service platform which is essentially there to make you your life much easier if you want to deploy an L2 a zkm or op stack chain we're there to help you we are there to integrate with all of these Services you need and ideally we want to get to a stage where on day one you can come you can commission your chain uh you can launch your applications on there and you have all these tools that you would have on an L1 available to you as if you've never left the L1 right that's the that's the goal here and yeah uh so um basically the

most advanced rollup as a service platform will look like that it's like one click to deploy and then you can sort of pick and choose from all of the tooling you need on the Chain it all gets commission same day you have a very simple pricing model for it and now you can launch your application at super low cost like that you can cut your fees your gas fees and your users fees by 100x or more um depending again on what configuration you choose if you prefer security over over cost and so on that's those are the decisions that we will help you make uh it's super fast and scalable so you don't have to worry about Network congestion anymore in your app specific rollup is just your app if you want that um and yeah you can have thousands of transactions per second um

Native account obstruction is something that we're really happy to to ship from day one as well so that you can finally have bet better ux you have way more control over the ux on your chain you can have everyone have a save like as a smart account I think Z sync did something cool there with with their native account abstraction and you can sort of do away with the need for gas and so on at all um and you can have native access to Oracle smart contract automation all of this we provide we're working with a lot of great Partners here already like layer zero Connex safe um also great infra infra teams like Gateway um we're hoping to collab collaborate with and and yeah um uh this is what I'm announcing here today and uh we will I think have a working prototype very soon ATT Tes it very soon as well

and expect more announcements to come this year and um soon also some some actionable uis so yeah you can think of the gelat rollup as a service platform as essentially your Deb with this middleware layer of scalable rpcs uh block explorers indexers and then test forces Bridge plugins of non-rs KC very important for Enterprise chains and then you have account abstraction oracles automation offchain data vrf and so on uh you can then pick your uh your rollup stack do you want ZK evm ZK rollups or do you want an optimistic rollup uh and then you can also choose your data availability layer uh so do you want to settle to ethereum do you want to use Celestia do you want to use data

availability committees so all of this will be available to you there and that will allow you to you know build your rollup just the way you needed with just the properties that you'd like yeah uh we make it easy for you with you know Partners like graph Gold Sky um piff for oracles Redstone Bridges like layer zero connects block Explorer explorers and other key infra like U monium who are also giving a talk today great guys and and safe team um yeah and so to today I'm introducing the gelato rollup as a service um and uh later this year we are launching zkm rollups uh Mains and then on q1 2024 we will add support for validium so you can also have these cheaper chains and then in Q2 we also

want to integrate with kyc provider so that if you're an Enterprise customer you can also have a fully kyc rollup which I think is super great for to get more non- crypto people into the space that simply need this sort of compliance that's it I think I'm already over time but yeah so come build with us uh to scale eum that's our ecosystem like uh you know gelato has been doing many many great things over the years and we have been sort of integrated by everyone out there I would say uh yeah so you're in good hands with us and would love to talk to you I'm here all day if if you want to build something let let me know yeah that's it thank you so much we uh really exciting news we have time for one quick question if there is a question in the

audience yes over here while you wait for the microphone I tell you that we have amazing ice cream uh sponsored by gelato which is really delicious please so most of the crypto project rely on a token do you think a way how to um extract value from your system and give this value to those token so if I I have a project with a token I want to run on your system my L2 can I use my token to let's say pay G pay gas fee or something else because yeah yeah absolutely actually a lot of uh projects

ask about this I think everybody is longing for utility um yes this is totally possible I sometimes I don't think it makes that much sense because ideally you can do away with the whole hey you need a token to pay for something to do something cuz I think that's a blocker for mainstream adoption but totally up to you definitely works um just have to be also careful like if you have a rollup that settles on ethereum we can allow you to pay have your users pay with your token but that token will then have to be swapped to pay for the ethereum cost on the one end but but yeah it it definitely works we can already do that today with our one balance system yeah that's it unfortunately that's all with a question thank you so much Louis thank you

everybody as he said he's here all day let's give him a round of applause and uh we're back in 1 minute