Hackathon Workshop:OP Labs_ETHTaipei 2024
ETHTaipei·Wed, Oct 9, 2024, 12:00 AM
Transcript
hi um my name is Winnie I work at op labs and I am the a contributor to the optimism Collective and um I guess today's agenda um first I'm going to run through what is the op stack give a quick overview of what is the op stack and the super chain and then I'm going to give introduce what is scaffold op optimism um official boiler plate for building daps on the super chain and I'll just show a quick demo on how to deploy a daap in under 5 minutes or if I don't do it I guess I can shave my head so you can hold me to the 5 minute test um yeah so can I have a show of hands of how many people here actually know what one second uh it's not sharing okay like this what about now is it sharing what about now no okay I see what the problem is okay so let's just do this um what about now okay okay I'll just go with this I think this is fine and this is also not showing crazy oh yeah wait wait I can do this what about now okay amazing okay so let me get back to this um yeah can I have a show of hands of how many people actually know what the op stack is or have heard of the super chain Okay so so how many of you have actually built something on the op stack or on the super chain before like okay nice so you've never heard of the op stack but you've built something on it yeah cuz you didn't raise your hand on like the first question no it's fine it's fine yeah um so yeah I guess because there's so many diversity of um people here I would just explain what exactly is the op stack and the super chain a little bit um so I guess zooming out um why do we need l2s in the first place like why can't we just like deploy everything on L1 and just call it a day and the reason is that like L1 fees are extremely expensive um so right now it costs about $4 to send just a ethereum trans action and if we're trying to compete with something like Visa then we need like something much much much cheaper and with something like EIP 4844 that rolled out recently now we have like Subs fees on op mayet which is amazing um but why do we need like why are fees expensive on L1 fees are expensive in L1 because we have limited block space and the reason why we have limited block space is that we need to bound compute somehow on ethereum otherwise like like people just never the program will never end and basically like validators would not be able to um validate blocks within a 12 minute time frame a 12C time frame so this is why L1 fees are expensive and we need l2s um so one way of like lowering the fees is is basically to kind of take compute off of L1 and use like basically take the compute offchain and instead of like doing the compute onchain now you're just posting a commitment of that transaction onto L1 so this significantly decreases the cost of transaction and that's essentially what an L2 is today it's offchain computation but secured by onchain commitment um so now that we understand why we need l2s and um let's look at the state of L2 today we have a lot of l2s like a lot of l2s and this is actually quite an amazing thing like I think that's the best thing ever happened that we have so many l2s because even if like op mayet were to run on like the beefiest super computer today like we still need like basically one way to think about it is like if you only have one L2 you can have one super computer but you would not be able to have parallel Computing or sharded Computing so the reason why we have a lot of l2s is to kind of enable this um parallel computation and but the problem with the way we're dealing with l2's today is that the way we're introducing new chains is not exactly um good um so there's like primarily three problems in my opinion so first um with every new chain you introduce a new codebase which means a new security model and that also means new zero day bugs that have never been seen before so right now whenever we deploy a chain um or at least the process of optimism is you deploy a code base and that codebase needs to be audited and even though it it's gone through serious auditing you still need to kind of um put it in the real world and get it battle tested and if you have to do that for every new chain that is deployed that's that's endless amount of unknown bugs that is just waiting to be caught and these are high security systems that need to be extremely secure so that's not good and another problem with the way we're deploying new chains today is um every new chain is new software that means we need to bootstrap new validator sets and sequencers and the third problem is fragmentation and liquidity um so the big question is then is there a way to have this kind of horizontal scalability but um with a unified security model and unified liquidity and this is a really tough question question but the answer that we have at op stack is actually quite simple and elegant and how you would achieve um this is essentially through establishing an open-source standard in the L2 landscape so and that's exactly what the op stack is so the op stack um basically is the a way of creating a and it's an open- Source standard that we built internally for op mainnet before but now we're open sourcing it for free and for anyone to use and to um deploy their own chain so by creating and collaborating on the same open like open source standard we can actually recycle code that has been battle tested and avoid a ton of zero day bugs so that's why the op stack is where you should build because this is where things are happening um yeah and also because of the shared um code base now you have this like just naturally you get this like very nice property of interoperability like like it's not happening now but like you can imagine if all the chains are using the same standard bridging liquidity from base is going to be from base to Zora and then Zora to op mainnet is just going to be like a lot easier because now you have the same security model and the same code base so um yeah so that's really exciting and okay so to reiterate the op stack is basically this open-source standard for l2s that anyone can freely use um and to deploy their own chain and the super chain is basically the ecosystem of like all these chains who are working in on top of the op stack and contributing to the cause of the optimism Collective together um yeah does anyone have any questions about what is op stack and the super chain or why you should build on this yes Z how do you patch all how do we patch all of them that's a really great question um so I'm not on the engineering team but the situation is I mean it also depends on like what kind of bug is this if this is a bug in the op node which is like the software that the validator runs then it's a very different process cess and let's say if this was a bug in the smart contracts on L1 securing the funds right and the way I understand it is if you have like a um bug in the L1 contract today um we actually have a security Council that allows you to roll back the row up and to aate before it was it was screwed so um so that's one way of mitigating the zero day buug is to literally just roll back with the the consent of this decentralized Security Council um if it's something that's happening on the op node then it's likely like a situation that's causing like the block to not finalize or like um like the head not sinking to the front then like in that case um I'm actually not really sure what happens um I think I think we definitely have like teams who would look into like there's obviously people on call so they will look into this issue immediately and also the op stack is like a collaboration between like multiple core teams so it's not just like op Labs who's working on the op stack there's also coin bases base Zora and also test and prod these are all teams that like we can rely on to build out features and also like secure things if things go wrong but that's my understanding of your question I'm not sure if that was a good answer yeah um so okay so this is that's the end of my presentation on the super chain and op stack and I guess next I'll explain a little bit about scaffold op so scaffold op I don't know how many people here have used scaffold E before but it's basically the most popular library to uh build any dap um in ethereum today and scaffold op is basically this minimum difference Fork um that implements some native support for the super chain so scaffold op is uses like nextjs hard hat wagm typescript so all of the most like userfriendly and also the most upto-date stack to build a daap today and um it also offers like a really smooth deployment experience to the super chain um test Nets and got some other daap examples that make more sense than the original repo so this is what scaffold op is and um just to show you guys like how easy it is to use I guess I can run through like a demo um let's see if I can do this in 5 minutes um okay so I have copied the code here I don't know how I'm going to do this do you think you can hold it for thank you so much yeah so right now now I have get cloned everything the the original repo and also installed all the dependencies and to start a chain I just have to do yarn chain which spins up the Loco test net um and the default test net is going to be on hard hat so you see the hard hat chain is spin up and now I'm going to do yarn start which starts the front end on nextjs and let's see okay yeah so this is going to be like what you see when you deploy the the boiler plate and there's some nice features here like um if you're on the let's say let's switch the right Network and you can see like a I I'll show okay let me do this first um I guess I will also deploy the set of contracts that I have in this so just to show what is in the contract oh yeah yeah packages hard hat contracts so there's two examples here one is called buy me a coffee and the other one is just called your contract I'll show you in a second of what it is oops yarn deploy calling yarn deploy basically deploys the contracts here into the lowco testnet um and for anyone using scaffold op or even scaffold E I would recommend ex just ignoring this bug it's just something in metamask that I haven't been able to figure out what's going on um yeah so now if you go to deploy contracts you can actually see the contracts that you deployed and scaffold op provides this really simple interface for you to interface with the functions in the contract um and if you're using a locco test net there's also a block explorer that you can take a look um to see exactly what transactions you've called and there's also locco test Nets that you can just get direct eth from and now I have deployed a simple dap onto a locco test net what if I want to deploy the same dap onto the super chain test Nets and there's also this really nice um easy way to do this and it's just called yarn deploy Network options I believe yep and then you just select whatever chain you want to deploy to you can actually deploy to multiple of them at once let's say if I want to do all of the above okay wait let me roll back a second I forgot to mention that what exactly am I following so this is the repo of um scaffold op and it contains like all the instructions that I just demonstrated yarn chain yarn deploy yarn start and what I'm doing right now is basically trying to deploy a contract to any of the super chain test Nets so for example if I'm trying to deploy to optimism sepolia then first I would have to basically create like a like use my private key that has sepolia e in it and update the environment file which I have done so as to not show you my private Keys be like during the presentation um but so I've done this step already and now I'm running yarn deploy and let's say if I want to do all of the chains so now it's just going to deploy to like right now for example it's deploying to Opia one second yeah so you can check that it is deployed successfully on the yeah so it got deployed 12 seconds ago yeah and that's how you deploy AAP on on any op stack chain in under 5 minutes um and let me go back to my presentation oh okay there we go yeah so that that was the demo um I have a bunch of um is there a way that I can like share the repo for the boiler plate is there somewhere I can do that okay um I will somehow find a way to share the repository to the boiler plate um but yeah if you have any questions regarding the super chain op stack how to build on it how to deploy on it will be in the hackathon as a mentor um for the next two days and uh I would love to talk to any developer who's interested in optimism super super chain and yeah this is the end of my presentation I did wrap up in 5 minutes yes okay thank you thank you we
Automatic transcript — names and jargon may be misspelled.