Base 🛠️ Building on Base - Ryan Nitzs, Carl Fluke
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join Ryan Nitzs and Carl Fluke for a workshop called "Building on Base". Interested in how you can deliver a piece of data from one chain to another? Find out in this workshop how LayerZero's Generic Messaging works to power the synchronization of states, triggering of actions, and sharing of information across different blockchain ecosystems. Superhack is the perfect place to experiment with the OP Stack. We, like many others, are excited about the Superchain future, and Superhack is the perfect opportunity to test what’s possible alongside pioneers in the ecosystem. Let us introduce you to our amazing partners: 🔴 Optimism builds open-source software for running L2 blockchains, like OP Mainnet, and aims to address key governance and economic challenges in the cryptocurrency ecosystem 🔵 Base is a secure, low-cost, builder-friendly Ethereum L2 incubated by Coinbase built to bring the next billion users onchain 🪩 Worldcoin is building the world’s largest and most autonomous identity and financial network 🌜🌞🌛 Zora is an open protocol for creators and just recently launched on top of the OP Stack The Future is Multi-Layered Without a doubt, Layer 2 technologies have emerged as the solution for a variety of Ethereum network problems. These innovations, which offload some processing and computation from the main Ethereum network, have quickly become our great hope for scalability, performance enhancements and ultimately onboarding the masses onto Ethereum. ----------------- Follow us: https://twitter.com/ETHGlobal Check us out: https://ethglobal.com Email us at: hello@ethglobal.com
Transcript
foreign [Music] and welcome to the super hack base Workshop Building on Base joining us today is Ryan nitz and Carl flug who will be taking us through this session and with that I'll pass it over to Ryan O'Connell to get this session started excellent thank you Roy uh nice to have everyone here so today we're just going to do a quick uh run through of talking about base um and then just show an example of how you can bridge ethereum over to base and start using it for gas so uh thanks everybody for coming to the super hack um kind of the motto for bass that we always want to kick off with is on chain is the next online so bringing those users to actually doing on-chain actions and kind of rebuilding our web tube world we live in today So today we're just going to give a big background about base we're going to talk about how you can Bridge uh in between gorilla adjustment and base test net so that you can have some funds to do smart contract deployment and then talk about scripting that um so I'm Carl fluke I'm a Solutions architect I've just started to do some developer relations uh at coinbase uh and been with the company for a little over a year and Brian hi Ryan it's a Solutions architecture at coinbase also working with Carl on on the base stud barrel side um so kind of what is coinbase's Mission uh we've been around for about 10 years so just high level um we wanted to make base just a kind of further economic freedom uh in self-sovereignty um so there's a few examples of the areas that we've done this across but that's just super high level uh what base really wants to focus on um as uh blockchain start to get cheaper and cheaper with great gas fees we see the l2s L2 summer is upon us um and it continues to grow so um they already have surpassed native ethereum transactions and they are continuing to grow so kind of coinbase has had this history of being a very centralized um crypto company uh and slowly we've been coming more on train by default um so we launched our stable coin with circle usdc we started doing non-custodial wallets we start new liquid sinking um and now as of um kind of on-chain summer is starting now and that's our L2 op stack chain so just give some examples and some uh partner ecosystem that we've been focused with we are very focused on helping the optimism team kind of bring these use cases on chain and helping grow um kind of grow the crypto market and uh Jesse's here so hey Jesse you want to say hey everyone I just wanted to pop in um thanks Carl and Ryan for the invite um thank you all for being here it's awesome to see we have a full room um I know there's a bunch of other people working on the live stream I hope folks saw my message and you know we were really excited to launch based uh opened up for bridging last week uh we're opening up base for everything this week I'm so excited for all of you all to be hacking in super hack um so it looks like Carl's solidly into this deck um I love all these use cases that are starting to be built and I'm really excited about the next wave of use cases they're gonna be built at hackathons like super hack by folks like y'all so uh thank you for being here thank you for Building on Base uh thank you for uh believing in the unchain future um and let's let's freaking hack um thanks for having me yeah awesome thanks Jesse glad you could make it um so yeah uh just to hear some of those example use cases 100 we want you to build some new ones um okay so kind of like what is what is base uh the real focus is that we want to have a million developers uh that's part of the super hack we're doing a few other ECC our Global focused hackathons uh we want to bring developers on chain and we want them to have it user based uh and that's something coinbase can really help is that we have a ton of coinbase users today and we're going to bring them to meet more and more on chain so as you're well aware with the op sack it's a layer two uh it's ethereum equivalent so if you're used to solidity and ethereum this will feel exactly the same um one of the things I really want to focus on is that we are becoming a core contributor to the op stack so we are trying to make the advancements that we create for base be able to be pushed back to the optimism team so that we can um contribute and help grow uh this stack um together um so that's a very big important thing is that we do work with the Optimus optimism Engineers to help open source and continue to expand the op stack um so some big things that we want to do is that we're um we want to keep growing the evm developer ecosystem um we're working on doing 4844 so doing charting coming out hopefully in the the next um ethereum upgrade um and then we want the super trained Vision uh we want to have these multiple app chains we want to work with the OB stack and improve that collaboration across those um protocol teams um so Ryan did you want to go through some of our prize money that uh kind of our four buckets we have yes absolutely let me just pull up that do you have it on the slide it's on screen okay thank you sorry switching Windows here yeah so basically what we want to do there you go all right so build a consumer products this is really up to you all to figure out what you want to build and we're just asking be creative we don't necessarily need the a copy of a of a something that's already out there so um it doesn't have to be Finance it doesn't that doesn't have to be D5 it'd be nft it could be creative it could be really anything and so we're just looking to be amazed and to be loud on this one for the next one uh we are looking at base native and what this is is we want base to have provider implementations we want constants we want as many open source projects as possible to have base as a as a native construct and have it be a core part of that Library so that when developers come online they don't need to go look up jid and they don't need to go do all the configuration for for for everything and so that's what we're looking for is we're looking for merged TRS pull requests as many as possible um that said we we will take in consideration if something doesn't get merged and there's no objection from the project and and there's at least some movement on it uh we'll take it we'll take those into consideration it doesn't have to be Builder developer tools either you know if you want to add base support to an open source wallet uh really anything that is open source that will take a PR uh and make base more part of the tool for the next one uh Carl do you want to talk about what you were thinking about on this one yeah so um a big part of what we want to do with base is make the user experience much simpler so account abstraction um is starting to become more and more common there's a lot of examples out there like I know by economy and safe and a few others have decent developer libraries um so being able to leverage some of that account abstraction to help improve the user experience and so we gave a few examples here um so such as like making minting in up to easier if they don't have gas making subscription Services easier um just anything that really makes it so that like a net new user can come on chain and be successful and then lastly we have uh kind of an infrastructure project so anything that could help make the base nodes easier to set up or operate um I think just last week we released snapshots so that you can now have a much easier time to you know be able to sing but there's tons of improvements that can go go into this I think right now there's just a doctor file set up but that can kind of be expanded to you know how how do you help um an individual be able to go from a bear machine to actually having a operating node right so those are our prize pools I will give us a minute here if there are any questions specifically about the prizes I do not see any okay so let's just jump into kind of like a UI friendly and then a developer friendly of how can you bridge things to base so um does my screen look okay here all right so um by default I'm just going to do an example through the UI um just so that we can see um so I have a coinbase wallet set up here and in test Nets I just sent one gorley ethereum here we do have umet funds if you need some also the default faucet on the coinbase website or inside of the wallet extension itself has the ability to get both Gorly Eep and Bassy so this wallet has had only one transaction it's sent nude for this demo um so I just gave it one eighth and I will go ahead and do this deposit transaction so we can look at what really happens so I will confirm that transaction and it's going to wait for confirmations while that happens so let's hope the test net is uh gonna behave for us during this session all right almost there and if this doesn't finish we'll just use a different example and come back let's just use a different example for a second so we just wanted to see a deposit transaction I'll use somebody else's while mine is still loading so really what I want to show here is that from that Transaction what we're actually doing is calling the bridge smart contract to this deposit transaction if we decode the input we can see specifically what what parameters is it passing so it passed a which address so I think by default the UI is just using your own address but by the smart contract you could bridge to a separate one it has a value so this looks like it's in way so the most significant units has a gas limit is creation false and data is null um so we'll reuse these parameters later and let's see if mine went through it did now and I have the exact same or a very similar output I just have a different amount here as I did starting with five there all right so let's see um kind of like how does this actually work so I pulled up the proxy address here and we can go to contract and actually see um what is happening so this is a proxy which means that we can upgrade it in the future so what we actually want to look at is for where it's pointed to so if we go into the read we can look at hey this is the API implementation for this contract so this is the real contract and then likewise we can do read and write here and be able to see these items so most importantly we would just want to look at the deposit transaction I can make this a little bigger and here's kind of those exact same fields that we had is there's an actual value and then we had the the two the amount the gas and integration false so how do we do this in a little bit more of a um developer friendly way so I was going to show through an example of just spinning this up through kind of like a hard hat script and show how you can get balances and you can do that bridge just from hard hat itself so to get started I'm just going to make a new project here call it demo Bridge hopefully this size looks okay for everybody um and then I will spin up hard hat and I'll just use an empty config file so we can run through it and then lastly I will also save some uh dependencies here just so I have ethers that makes it a little easier to manage contracts and this may take a second as well um for super hack project should be on mainnet or testnet that is up to you I'd recommend testnet you know we are we're hacking we're being developers if you wanted to blend mainnet you absolutely can okay so I have um this open let's just go ahead and get that in vs code all right so I have kind of my default dependencies here and I have hard hat configured so one thing that I do want to call out for everybody is that since we're on the op stack you do want to make um 8.17 version of solidity the highest um there are some issues in like 19 and 20 with new OP codes um so that's just a little gotcha there so the the next main thing I want to add in here is that there's going to be two networks that we're working with uh we'll set the default just to um Gourley um and then we have to set up our actual networks so uh on base.org website in our docs we talk about our Network information here so depending on if you want to use mainnet or testnet we kind of want to configure our um our Networks I think there's actually a very clear version of doing that in here of here kind of gives you also the helper of it's a little more straightforward um since I will be using Alchemy I'm in a copy um this out of another project just so I have it here so this is just adding base quarterly and it's saying hey here's this URL I'm going to load in a mnemonic and then I'm actually going to use a specific account on that mnemonic so to do that I will create a Secrets file so always the fun part of a demo is not showing off any uh keys or anything um while I'm in here I'm also going to require some helper classes and that just sets up hard hat so that I can have ethers available to me um which is just what I'm used to to make contract calls a little simpler um all right so then after that we would want to get that API from the bridge so I'll just make a new file here and just call it um ridge.json and so we went to this portal or we went to the actual Bridge contract and we'd want to go to code here if we scroll all the way down there should be an ABI so that's our API here we will save that so that formatted that for me um and then we are going to want to use that ABI here in a minute so I'll just add it while I'm up here uh all right there we go so I'm going to use um hard hat tasks which are just an easy way to be able to specify um that I want to have like a there are here we go uh that looks good and then we can add parameters so that looks straightforward enough AI is helping me quite a bit today on this um so our action is we just want to have an async task guards on that actually helps you almost all the way here so we just want to make sure that we get that account so let's just say um console.log perfect uh I might see if this all looks correct it looks okay to me and then I need that Secrets file so let me copy that over and there we are so I just have um in our example file I have a mnemonic so I have my account and then I have an Alchemy key just so I have an RP RPC node that I can trust um and with that this should actually just work so if I do npx art hat and then I do balance count and let's get that account out of the wallet so that listed our account perfect uh and then next we essentially want to switch this out to actually the balance so that's very straightforward with ethers we just await and AI is helping me achieve here and then I can just console.
log um let's do uh escargs.account we can just do balance as is we can see how that works all right so we have a balance here and then most importantly we're doing this across networks so we can also check that on base School league okay and I have someone basically as well so if I go into my addresses or go back into my wallet I just want to double verify that that's correct test net I have half on Gorly and I have path on uh basically so now that I can do a basic balance check um let's kind of do the the same thing except let's do that bridging action um so Bridge East to um base quarterly and in here we'll kind of do the exact same param for account and we'll do an apparel for amount the amount to bridge okay and then same we do our set action then I always like to make sure that my arguments are correct before I go farther so I have a new task bridge and it's going to require an account in an amount uh so I'll add an amount here that's 0.1 and we'll switch the balance call to bridge uh and perfect so I have these values all right next I want to make sure that I use this um ABI up here which I called API for some reason API um and I want to load that into an actual ether's uh uh contract so I'll just say um const Bridge contract equals new ether's contract yep it's got it and it's going to take a couple parameters it's going to take that API um and then it's gonna require a signer we'll just use ether's dot provider first and then I need that bridge address so uh bleed listen to one we want okay and now that I have that bridge contract I should be able to [Music] um essentially call any of the methods let's do something simple uh let's just do like L2 sender to make sure that I can read this so equals await that bridge contract um and then it's just the method so and let's log that out to make sure it works so just simple um make sure I got the contract correct make sure I have my API correct and press sender is that d-e-a-d which matches here so we have everything right so far all right so then we essentially just want to call that bridge call um so do some error handling in case I messed something up and then otherwise I just want to or let's say um honest Bridge result Bridge contract and then what is that actual it's called posit transaction um and then let's look at those parameters again so as a value we have a two we have the value gas limit and it is creation so since we add value here that's probably going to be in way and I don't want a necessarily send it away so let's do a format here really quick so let's skip the that for a second and let's say const uh format value um I don't think I actually need to wait I do not um just Etheridge uh you can log that just to make sure that we have it correct format value okay so it now understands point one means that with the appropriate amount of decimals uh excellent and then deposit transactions so let's put these side by side so we can compare right um so we have two which is just the tasks dot account we want that format amount uh we want the gas limit so I think um let's compare what my transaction was and just use the same right not that transaction where was I here we are we'll just set it to a static 1000 our hundred thousand uh and then as inspiration false and then data is null so I always just do 0x so it's a little more clear uh and I believe that's everything we need to actually just call this from rtad um so we can console.log that and then we can also await to make sure it actually happens so yeah it's helping me here right so I think this should be all that we need so I am loading up that contract I am formatting the value uh and I'm doing the exact same thing are you I did nope does not support sending transactions uh this is probably from me loading the wrong account oh I need to set up a signer so by default if there's dot provider it's not actually a signer I need to pull out the appropriate cider um so this is actually except I don't think I need to give it task guards because I have that set below yes I do and valid argument address oh that is what I'm looking for insufficient funds um I am probably loading the wrong signer I'm going to go ahead and just use my backup account [Music] um so always be prepared so in this account which I'll pull up on etherscan in a second uh we'll do the exact same command but a slightly different address here sorry let me clear this and make sure I have an appropriate amount of Gorly I do all right well that is live demos having an issue clap um let me see I'm using a different account here this is cbec6 oh I know why on this one I do not want a path so ones I got all right there we go so transaction submitted and then let's go ahead and pull that address up to make sure we can see it and so there is that bridging transaction going through or hopefully it goes back through I can get my hash here too and look up the transaction by that while it's indexing so here's a success set our value we have our method here and then lastly let's pull that up on base scan so we can see it on the other side here's our base scan uh different transaction so let's do it by address and this is me receiving that ridged value so it may take a minute to show up here it can take like four to six minutes so really that's what I wanted to run through today I know we're close up on time um let me go ahead and go back to our slideshow here that's just giving you an example of using hard hat boiling down like uh an ABI and actually calling it um so questions uh why I was playing with doing different mnemonics so instead of like having one mnemonic per demo I was trying to get used to the path so that was just me trying to upgrade the demo game and it did not work very well but are there any other QA questions on like base op stack uh the prizes so uh just a reminder if you're not already engaged uh there is a partner based uh Channel under the under the super hacks Partners uh where you can engage with us if you have any sort of questions about Building on Base yeah there was one question uh and what advantages does space have over other blockchains so basis is is there there are there are many different blockchains and there will be many blockchains uh out there um for bass we really wanted to find a place that we uh could Bridge the coinbase users uh on chain as well as we wanted a home where we could actually deploy our applications as well as we move more and more on chain as we move more of our centralized uh services on chains so that was the kind of the uh decision to launch phase space is a part of the optimism super chain Vision where it's a series of uh uh l2s that help scale ethereum horizontally uh in different namespaces you know they'll be different ecosystems and they'll be different developer communities uh so you know if you're comparing it to the main L1 cerium you know you're you're looking at many more transactions per second and you are looking at shorter block times and lower latency in general much lower feeds sorry all right uh Lewis asked how much cheaper space transactions fees versus L1 uh right now it's 10-ish 10 times less expensive with EIP 4844 that could go to 30 50 100x uh they they'll be a little bit more racial once the implementation is fully out the goal for us is to make the network fees as inexpensive as possible on the L2 we think that there'll be a lot more uh activity as the sheets come down further yeah we do have a company goal if we want transactions to be one second and one cent and so that's kind of the I know that 4844 will help that significantly but that's kind of the company Mission is one second one sent another question was how decentralized is base how many nodes are supposed to be managed by people outside coinbase so the nodes uh can participate in in the network but they are are not a part of the of the Roll-Ups or the sequencer right now the sequencer is a bit centralized this is uh somewhat of a technology uh challenge in and that's something that we're working on together with the optimism Foundation coinbase is now a core contributor to the to the optimism Foundation uh or to the op stock excuse me uh and we're working with them to invent the technology that will enable uh decentralized or more than one uh sequencer at a time okay and another question any ramps on-ramp apps already supporting base um so today yes so coinbase pay is coinbase's own on-ramp and it does support just eth and CBE today um but I think that was turned on like two days ago um so definitely developing we do have a couple on-ramp providers but they they kind of have control of their own marketing when they're going to announce support awesome yeah so we're a little over time now uh thank you Ryan and Carl for the great presentation Workshop uh for hackers to attended thank you all for attending and just a reminder that project check-in one is due later today so take advantage of that opportunity to submit your project current status and get feedback from partners and mentors on it so cheers thank you all have a great rest of the day and happy hacking
Automatic transcript — names and jargon may be misspelled.