Workshop Room 1 - ETHGlobal Brussels 2024
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Transcript
if it went too fast if I have any questions for anyone in the room please ask and I will answer otherwise you reach out like I said so what is zerit um zerit a fairly new zeron rollup um we've been building for a couple years but uh we came out of stealth uh and started sort of showing off our test at a Dev connect in Istanbul in November of 2023 and what we wanted to do is take an optimistic rollup infrastructure um that one built by the optimism people who are doing good things and put in a zero knowledge proof system because we were sort of sick of waiting seven days for withraw and everyone just said it should work turns out it was a lot of work uh but nonetheless um you know we got here and it's great um and what that means is we have a VM and a node infrastructure where everything just works on ethereum so it should be as simple for everyone in this room to change an endpoint to their favorite tool whether that's metamask or hard hat or whatever people are using these days to build apps uh and it'll just work and we've tested this so I know that this is a true claim more or less um but it's really cool because you get all this cool stuff that works with optimism and and ethereum itself out of the box with a Zer system that reduces the finality time and we got here through some research we had a lot of ideas for things on security and and um you know just different ways to do things in a rollup in the zero knowledge side for example there was always ways to optimize things but what we really wanted to do as a research idea was to figure out how to make um circuit more secure ecosystem than your average rollup ecosystem and this is a really hard challenge because zero knowledge proofs do that in the sort of sequenc or you know ecosystem the infrastructure for the sequencer I can't cheat if I'm using a zero knowledge um proof system and I've you know done my job correctly and there are no bugs and things like this but that actually doesn't give us a lot of protection for the rest of the users on the space I mean certainly it means I can't make up money for myself and then rug pull my users that's very helpful but it's kind of a solv problem with the zero knowledge proof what we wanted to do instead was bring something that even dap developers and users of our Network would gain even without doing any extra work work so what we want is to prevent hacks everywhere we can't do that we don't have total control of the ethereum network obviously so uh you know we can't do it everywhere but we can do it in some places namely on our rollup and so what we did was we actually add this idea of sequencer level security which I'll talk about very quickly in a couple of slides uh and I'll tell more about that but first let's focus on the first thing about building on it um and like I've already said anything that works on ethereum or on the optimism stack will work out of the box for us if it doesn't let us know it's probably a small configuration issue or a bug but in principle everything really works so you're your smart contracts are going to work your wallets are going to work but do note we're not on the super chain we're built on the op stack but because I uh we've done something different with our sequencer we're not on the super chain so you know it's going to be a slightly different setup but it should still be very easy then we took all the stuff that was good there and we already talked about how we put ZK circuits in there as AAP developer you don't need to know about that if you are interested in taking a look at our circuits or building stuff with the type of circuits that we were using we can point you to some places that look um kind of similar to what we're doing there are other open source projects right now that um you know use sort of a lot of the same ideas or were starting points for even our project and what this means is we have a nice developer experience or at least I hope so if it's not please let me know this is a hackathon part of what we're here is to get some feedback from you and um in terms of the zero knowledge proof systems um one of the places we could start was the uh privacy scaling expiration uh team zkm which has been out for a while I don't actually know if it's being maintained anymore I heard a rumor that it's not I haven't followed up um but if you are interested in trying to build your own zik rollup or seeing how complicated it was to build a circuit or something like this take a look at these um they're very good they're not necessarily as performant as you'd want or they have different you know configurations that maybe aren't ideal but we ended up using them if you're interested and want to learn more about Halo 2 this is also a very good starting point because this is the proof system that we use and at the end of the day we glued these two things together to come up with circuit I've already said this uh and the result was something that has really really good easy to connect infra that works as well as a very good well-developed set of circuits that were customized and optimized to do whatever we want and enables us to do some of those things that we wanted to do namely add some security uh so I think the next slide is the sequencer level security which I'll talk about but also you know if you also have very ambitious goals for this accathon you want to build a role up forking these two repos and trying to get them to talk to each other is is is non-trivial it does take some time so I encourage you to try but it's actually you know substantial amount of effort uh but it is a really cool challenge but what we really wanted to do is add some security okay I guess the next slide I'm sorry I haven't practiced this one as much as I should have uh so when you get from all of this is evm compatibility I think I've talked about this so in the interest of time I'm going to do this I will point out one note that I didn't talk about um we don't have support for canron so if you're building something that needs a transient storage the test net forer unfortunately will not support it at this time we're working on it but we got to get things up to date we just uh I think moved to Shanghai relatively recently sometime in the early year so everything up to that VM should work but anything else might need some things if you have questions or concerns or want to help us get there please let me know uh and you get better finality I've already talked about this so I I've alluded to this topic I'm going to spend some time here because I'm running out of time and I want to actually get to the Hands-On part of this I didn't actually want to be talking about what we're doing for too too long uh but the the main draw to circuit is really this idea of added security and the sequencer level of security so what what we do is we have a sequencer that's currently centralized and we actually have an AI in there that will look at transactions and flag them as malicious or benign and if they're malicious they're going to go into quarantine and if they're benign they're just going to go so if you're an honest user there's no difference to what your transaction does it's going to go through every time you're going to transfer your funds you're going toit your nfts you're going to do whatever you want to do on the blockchain but if you're a hacker and you're trying to execute something that certainly looks like the old old stuff that we've seen or trying to do something else that is still new but you know he going to wipe out a D5 protocol that's actually going to be flagged for quarantine and put into quarantine which means your dap won't be wiped out if you're the DAP person who's getting attacked and if you're the attacker that you know transactions not going to go through now uh that might be a little controversial but honestly we think it's a very pragmatic practical approach to security and everyone on the Chain gets it for free so if you build a defi app you come to zerit now you have an extra level of protection against Flash loans that you don't have on another level uh on a on a different network without doing any extra work and that's really really key we do all the lift with the AI to figure out what's a hack and what should be stopped um that does not mean you should deploy code that has a bunch of errors or bugs please don't do that do your part you know write good engineering engineered uh smart contracts and defi da to protect your users um the SLS is the best effort service it could not CCH something but ideally it does the point is though we get this nice great thing that gives us more security guarantees right so in addition to transactions being well formed they also have to be well intended in some some sense uh so that's what sequencer level security is and here's sort of how it works basically we do some stuff in the sequencer in the interest of time I'm not going to talk about it please hit up our docs um we have some prizes which I'll talk about near the end if you want to work on stuff related to SLS you need more details come find me or my colleagues and we'll see what we can do about sharing some of this information so that's circuit in a in a lightning round that probably was too quick um but let's go on to the Hands-On part of this so if you've never used a rollup this might be interesting and it might be surprisingly easy if you have used a rollup this may not be as interesting but bear with me as I go through I'm here with circuit so I'm going to point you to a bunch of tutorials and guides built from zirc uh docs. z.com is a great place to connect to our Network it has everything you need to know about connecting wallets or infrastructure or setting up you know whatever your Frameworks for development is um and we also you know have a standard Bridge e canonical bridge and a um standard block Explorer so Bridge or explorer. circuit.com will take you there feel free to use them please do use them if you're um trying to claim prizes for zerit you do need to have your code verified on explorer.
z.com uh and then if you need questions and we're not around or you know you're remote and you're not here in person ask us on on Discord we're happy to help and finally to other initiatives that aren't directly related to the hackathon but you might still be helpful um are builder.com so it's a place where we reward Partnerships um went to ecosystem so if you finish a project and you think it's actually going to be going somewhere and you want to deploy it come talk to us and Deploy on our Network and when we go live and um we can sort of hook you up with all the support you need there and if you're into LRT and L LST reaking we can also offer you points by by reaking um in stake. circuit.com but those are less important okay I feel like I'm talking a lot I've got six minutes left I got to get through this uh the Hands-On part we're going to use the zerka test net zerka test net is a test net unfortunately it's not quite live we're going live very soon but I don't want to promise any explicit dates especially as I'm being recorded and people you know always hold me to dates uh so you'll need sapoia eth good resources for seoa um there's a bunch of faucets eth Global's got a really good one it also gives you um uh eth on Z circuit itself directly on circuit so you don't need to bridge necessarily if you withdraw on the E Global faucet but there's other ones also if you do find me around and you ask nicely I can probably help you out a little bit I'm not going to give up tons but you know maybe I can uh do something otherwise once you connect it's pretty easy so I'll go through sapoia very quickly I'm going to use metamask for this example because I think a lot of people are still familiar with that maybe I'm just old and it's not popular but I like it uh basically to connect a spolia all you want to do is you want to uh switch this toggle to on so that you can see test networks and spolia should be baked in connect to that then you can go to the faucet collect the funds I was talking about and then to go to um zirc with those funds it's very easy just go to bridge.
circuit.com uh after you add circuit testet to the network all of this is on the docs you don't need to worry about the specific numbers or chain ID or anything like this but it's just this easy you go into metamask you want to add yet another Network you say add custom Network because I don't think we're in there by default just yet add these details and everything just works then you go to bridge. circuit.com It'll ask you to connect with metamask hit next you'll be fine and then you just choose where you want to bridge um right now I think the support mostly is for eth spolia eth so take you know from spolia onto zerit put in some number in that field on the bottom left say I want to Bridget this modal will pop up and say approve this in your wallet and then the next slide you just go to you know metam mask and say approve and everything is done and everything works so that's it's just that easy Once you have e on spolia um sorry on zirca testnet you can use it just like anything else you can send it to other people on circuit you can you know take your keys and put it into heart hat and produce or Foundry or whatever it is you want to do and and you're all set um I was going to say more but I I I didn't so there's a lot of docs I'm going to give you some homework instead the withdrawal is a little bit more complicated it's not prohibitively complicated um go try it out more importantly go to try to deploy contracts on it I think that's the more exciting stuff and build on it and see what you can do with this and because we're at a hackathon try to win some prizes um if you're here we've got a lot of prizes out there there's ones for best project best Integrations or analytics are still fairly new there's a lot of low hanging fruit that probably will work best defi best gaming and most creative project um you can see more on the E Global site for these descriptions they're pretty open-ended the best will just be the best whatever that means uh we want quality we want completeness you know good code and we want some of these requirements which are a little bit of a mouthful but essentially a read me that says what you did why you did it how you did it that type of thing uh and stuff to be deployed on circuit what a surprise uh so that's all really good but what I would really like to emphasize if you do submit for a prize um the one thing I will really ask you for is a personal favor here is feedback if it didn't go that well if it you know didn't work out I want to hear because I I don't want my network to not be you know easy to use or anything like that so feedback is greatly appreciated and if you think it did go well but we could do something even better please let me know I think that's really really valuable feedback so thank you I encourage you to build on circuit so that when sequence level security is is live uh I I I can I can send it to you or tweet about it or something yeah it's probably not the docs the doc should have everything else though um anyways build on us so when secret Lal security is there you can use it thank [Applause] you pull it okay e e okay are we good to start okay hello hello um this is kind of a two-part presentation because we don't know the makeup of the audience so I'm going to pull you guys for kind of what I need to explain and what I don't and depending on how it goes I might disappear immediately um so we'll start off does everyone here know like who here knows how like rollups work kind of okay cool um I will try to start from the beginning but talk super fast because we are super intense on time so we have building on scroll today we're talking about the intro to scroll as well as exploring l1s load we do a lot of internal research so today's bounties that will be doing kind of covers both sides um so I'm going to start off with like the basics right like what are rollups well why do we even have them ethereum is slow and expensive right exactly why we're going to talk about the blockchain trilemma so basically it's a pck two situation between scalability security and decentralization right you can't have all three together so what do we do I mean ultimately at the end of the day ethereum's like principles are security and decentralization so how do we solve that and so that's where l2s come in um so l2s are basically um what they do is we take the execution offchain right so rather than having to do all that expensive compute on ethereum we actually do it in a separate Network which is the L2 it's called a rollup because we basically roll up all these other transactions and then post them to ethereum what that means here I specifically specify here is data availability so we inherit the security and decentralization of ethereum because all of that data gets posted back so I think another thing that I want to clear about a lot that I think people get confused about is if you know polygon proof of stake polygon proof of stake is a scaling solution it is not a layer two and it is specifically because they don't post their data back to ethereum so that's like an important thing to kind of differentiate um now we dive into like the different types of rollups so in kind of the history of rollups you might have heard of optimistic Roll-Ups they're kind of the ones who came first um and they differentiate themselves basically on how they prove so when we post that data back to a and we want to verify that it's true we can't just like post random right so what that looks like is with a fraud proof we just optimistically assume that it's true there's like cryptoeconomic incentives that basically make it like so that you don't want it to not be true um but what that means is we have like I guess something called The Challenge period right so we need to set aside time for people to come and say hey that looks kind of strange let's do a fraud proof um and then actually check whether or not this is correct or false right um so what this means is we have like what we could say like slower finality finality being like the like it's time to finalize on the L1 right um which also means withdrawal times or so withdrawal means pulling from the L1 so getting your funds out right um so there's like a little bit of liquidity fragmentation if you interact with rollups you probably actually don't experience that because you're using thirdparty trusted Bridges to basically give the feeling of instant finality um but obviously we know oh hopefully you know Bridges have been I think the major hacking point that uh We've touched so anyways that was the first iteration what what's the next iteration we talk about ZK proofs right so instead of proving uh like having a challenge period let's say let's be proactive about it let's mathematically prove this first and then submit the proof of verification first um the other thing that I always like to note here as well is with ZK proofs people often think privacy with ZK we don't use it for privacy use it for scaling and what that means specifically is proofs CK proofs have the smallest amount of data that we can post back what makes a rollup expensive is that data size that we're posting back as well as like the verification compute time anyways so that's the quick overview and now we're going to dive into a little bit about like okay wow there's so many ZK rollups how do we decide between all of them right so um if you're not familiar with the different types of ZK EVMS basically there's four different types e EVMS being at a very high level kind of the the way way you translate uh code into math in order to make it provable right um so type four is going to be the farthest away from a ZK evm so or like a pure evm so what that looks like is a ZK sync or a stark net what that means for you as a developer it's highle language equivalent it is not bite code equivalent so you're going to have to download plugins it's not going to look exactly the same um we can kind of scroll down to type two so that's kind of where scroll sits we are bite code equivalent so what that means is you know it compiles down the same your pre- compiles off codes are covered um it should feel uh developer experience- wise exactly the same so normally you deploy you're like oh my network is aolia you literally just switch the words to say scroll um and it should work right U and then type one is going to be ethereum equivalents um we're uh basically the main difference here is like the way state is hashed and stored is a little different um but for the most part as a developer type two is kind of the seamless experience that you'll get the trade-offs here are going to be like type four because you're the farthest away it is easier to be faster and cheaper whereas type one is going to be like the hardest to become fast and cheap um but that being said technology is ever moving and I think the assertion that a type four will always be faster and cheaper is not necessarily true so anyways move on we talk about scroll how does it fit into the picture um I don't know how much time we have left so I'm going to talk about this really fast so like I said we are evm compatible we're type two what that means is we leverage the network effects of of ethereum oh we have 5 minutes okay we have 10 minutes oh oh God oh God um um we're secured by ZK proofs I think the other thing that I want to touch about was security especially when we think about bik code compatibility um how many of you guys are familiar with a Viper hack nobody okay so basically Viper right is a high level language right so you can write smart contracts in Viper what happened was I don't remember which protocol but they lost a bunch of money and why was it it wasn't because the code smart contract code had a bug the Viper language itself the compilation had a bug right so that's not like something you can really protect yourself from so when I talk about like bite code equivalence I think something I also like to think about when it comes to like a type two is because it mimics the behavior of ethereum like the evbm like you have that additional level of security that you wouldn't otherwise because from an smart contract auditor point of view the farther you are away the more kind of layers you have to think about which could potentially open up uh more attack vectors um anyways so scroll is this so we talk about I think someone always ask me like okay there's so many rollups what are we thinking about um the spicy answer is Tech doesn't matter ecosystem is the only thing that is there right um I don't necessarily think that's true I think it's a a marriage of the both but if we're going to talk about what squirrel looks like on the ecosystem side um you know I think we have we'll talk about grants a little later if you want but I think we're really focused on like definitely like supporting Builders um like a lot of one-on-one interactions uh what I say when someone is thinking about like where do I know build the things that you to think about for a chain is longevity and legitimacy so there's a lot of different like technology coming out is what you're building on going to last um in scroll we have like a really strong name um and so yeah the other thing is I really I think we have a really great support for emerging markets so if any of you guys are from there please talk to me I want to figure out how to help build your uh community anyways growth is insane those are big numbers anyways so that that was the part one to the deploy kind of casual I think we're going to dive into like I said Scrolls really heavy on the research side uh you have a question we can talk afterwards um Daniel is going to come up and talk about something really cool called l1s load that you guys could also potentially hack on all right thank you Emily I don't have quite Emily's energy but we'll get into this anyways um cool so that's the background on scoll I'm going to talk to you about something that we have only on our Dev net so we have our sapoia test net that you can hack on for the hackathon for this hackathon we also have a devet that has a special feature called l1s load going to be a little bit lower level probably but we're going to dive in here the idea is that we want to have a contract we want L2 contracts to be able to directly read L1 State okay that's about it and we're going to look at like why that's may be valuable why that's interesting how to use it um and it's a uh it's something we're introducing to try to get all the rollups in the ecosystem to align around because we need this to be a standard uh across L2 ecosystems so why well there's plenty of reasons to read uh L2 or from L1 into L2 there's a lot of value in the ethereum storage slots right it has the best security and decentralization guarantees it is a kind of politically common ground but amongst all these l2s uh has a lot of credible neutrality it's the default for protocols and also like past activity on ethereum is lots of valuable and interesting data there both on sapoia and mainnet and every rollup has a canonical bridge that finalizes its state there what that means is the state route contains a lot of information that you can extract out of it and if that's sitting on the L1 you can start reading about other l2s from your L2 by getting that off of the L1 we'll kind of see that a little bit but um I think we'll have to push to have some conversations outside as well one thing that we've been uh looking at for this is the key store the idea here is that your verification Logic for your smart contracts can live on the L1 and you're able to reference it from all your smart contracts on the L2 um think oh data on L1 is expensive though um we've been kind of like working on a proposal where you read it off the L1 but you can delegate to update it from any of these l2s also happy to talk about this at any point uh this weekend I'll be around why are we doing this because direct reading from the keys uh from the L one is like way easier and cheaper for users and there's a lot less infro work required for app developers wallet developers or anything else there's lots of other ways to like prove State um including all these paths here but they're complicated they're burdensome and instead we get to do something like this as smart contract developers uh this is a full contract that will read from l1s for from the L1 you pass it your contract address you pass it the store storage slots in that contract and it will return that back to your contract so you can use it for whatever you need to we'll talk about some of those use cases um so this is uh the Crux of it here you pass it the pre-compile address you make a static call to that and you pass up the arguments um cool I skipped a few slides one kind of interesting demo that we did last month in uh Berlin was we worked with the safe team to where if I have a safe wallet on the two it will read the signers and how many signers are necessary from an L1 so that way if we have a treasury on L1 it's being managed by some folks every time that gets updated I don't have to go to Every L2 and update the list of signers and go ask everyone to go do additional signatures like all of this stuff can now become seamless cross chain so that's kind of one of the things that this unlocks but when you start doing cross chain stuff it might get complicated we might be doing Merkel trees we might be calling eth get proof RPC methods you might have to deal with like Scrolls ZK TR and our ZK TR verifier so there are resources that you'll have to dive into if you want to get really complicated with these architectures but you can also just read a storage slot you can read the name of a erc20 token or something else um and I'm happy to like sit down at our booth and kind of walk through some of these resources if uh the documentation that we've provided doesn't get you there what does this enable well we can now have trustless cross-chain coordination this is something that's like not necessarily possible using um the other kind of tools and bridges that you're imagining uh that are accessible to devs we can start building asynchronous composability we can do things like the key store um we can have ecosystem agnostic minimal rollups that's a mouthful but the idea is that you can devote just a really simple rollup to doing one behavior and then just utilize that from other chains we can think about bootstrapping new rollups by reading from L1 Oracle data into the l2s we can think about verifying asset or nft ownership to uh from a different network because you know oftentimes people want to keep their nfts on the L1 and then if you want to get uh really fancy you can think about using uh l2s to do the ZK verifiers and co-processors for L1 protocols and then Bridge the state back and forth um there's lots of there's lots of design room here when you're thinking about the patterns and architectures for your hack uh and we would love to see all sorts of wild and crazy ones uh for me the weirder the better we uh have introduced this as an rip to the ecosystem we're looking for feedback so if you're also like on deeper into the research side or just have comments on how it worked um please give us feedback on this uh in The Fellowship of The ethereum Magicians and help us iterate on it uh for roll in ecosystems we really want people to either get behind the RP or give us reasons why they won't be able to implement it um but for appdev it's more about testing ideation feedback and for hackers here we have two prizes at $2,000 each and remember you can just read any state from sepolia so if all your hack project is on sepolia and you find an interesting reason to like pull that into an L2 um make it happen so this QR code will get you to a kind of hacker resource page with information on our prizes there's a link to both a telegram bot that has a faucet uh for the devet and for scroll seia and um there's also a link to what we call a hackathon cheat sheet that should tell you all sorts of different projects that scroll seoa supports so if you're looking to hack on three or four sponsors at a time uh scroll sapoia is a good option for that as well you wanting to wrap this up or should I take the rest of these slides cool all right wrap it up here um so hack with us we've got 10K in prizes uh I already told you about the l1s load ones but additionally we have best project on scroll um how much was l1s load 4,000 that means there's a remaining 6,000 for best projects on scroll um I don't remember I think we have a winner and two Runners up maybe um so you know that can be on l1s load or not um we're just looking for creative projects weird projects Innovative projects technically wild projects uh or just really good applications and use cases for problems that you kind of see in your own life so we also have a brand new grants program um there's plenty of more information here but we have a deadline on August 7th so if you're a builder looking for funding either you're just kind of getting started or you're needing support to like get your project to that next level and get really get it launched check this out we have up to $10,000 on one track and a 100,000 on another and we'd love to have you building with us building with scroll thank you and this is a QR code again for the the ECC URL one more thing one more thing two minutes read Rey ver contract address in the GitHub verified on the Explorer always a good thing it's so easy um I guess we have like one minute any questions question uh the question is do we have block hashes on scroll um do you mean like every single block is there a block hash that represents the header there a function and that ah yes there are challenges with that but I can't give you the off the top of my head the actual answer to it so I'm going to show you where to self service which is on the developers area of our documentation you can see that block has returns uh it's so basically it's not a proper block hash but it is a value representing the block uh that is going to be unique to the chain so yep cool thanks everyone for your time appreciate it e e all right hey everyone thank you so much for coming to this Workshop today I'm going to talk about how to build a blind AI application on million and just to introduce myself quickly I'm St orilia I lead developer at million and I'm also oceans 404 on Twitter um if you want to ask questions there or say hello so we at Nan are building Humanity's first blind computer and the first time I heard that I was like what does that mean how could a computer be blind um computers are just reading numbers what is that all about um but what we're building is a dual architecture Network so it is a pet net plus a coordination layer so what the P net is doing is it's combining different privacy enhancing Technologies uh like MPC garbled circuits um FH all types of different cryptographic Primitives to do interesting math on and to do blind computation and then the coordination layer is how we pay for all of the different operations that happen on the pet net so whether it's like storing data retrieving data or Running Blind computation to do any of that what you do is you pay on the coordination layer which is a blockchain and then you send a ZK proof of a receipt to um the pet net and so once it knows that you've paid you're able to perform your operation so that's kind of what the network looks like at a high level and we have a test net right now and also a local devet so when you're building your apps you can connect to either uh but I'll show you the test net today let's go back to this idea of blind computation so blind computation basically just lets functions or programs be performed on secret inputs without ever revealing them or showing those values so this is really great if you have a type of application that needs security and privacy especially if it's combining inputs from multiple different parties so if you've heard of like a ZK proof that is a powerful primitive for verification or checking against a single value but something like MPC in blind computation is powerful because you can compare compare Secrets add Secrets do anything with secrets from multiple parties uh without revealing or exposing that underlying data so it is privacy preserving um and just to show you kind of like classic computation versus blind computation this is a really simple addition function it's just taking two inputs so int one and int two and it's returning the sum so there's two inputs and one output and if you console logged these inputs in the middle of the program program you could see these in plain text and something like that doesn't matter for an addition function but if you think of things that have more sensitive data maybe you don't want that data exposed so that's where blind computation could be really great and what a blind computation function looks like is something like this so there's two secret inputs you can see I've kind of uh put blindfolds over the two secret inputs to show that you can't actually see them and a sum that's returned and a big difference uh between blind computation and writing just like traditional programs is that you attach a who and a what to each of the secrets that you're passing into a computation so you can see that in one is attached to me I'm the party providing it in two is attached to my cooworker Charlie he's the co he's the party providing in two and each of these also needs a name so that we can reference what secret the integer uh corresponds to so that previous slide was just kind of um a simplification of what a program could look like but this is what it actually looks like we have a language called NADA um it's based on python so if you're familiar with python this should look very similar and I'll just go line by line and explain what's happening here so on line one we're just importing NADA DSL which is the library uh that helps um the compiler understand what's going on on line three we're creating that function and then on line line four and five we're defining the parties those are the who to who is providing the secret inputs so on line six you can see for INT one party Steph which is me is providing the secret input and then on line seven you can see party two Charlie is providing into two so when this uh computation happens it's completely blind and one of the different parties which happens to be me Steph will receive the output um but I'll I won't have any idea what Charlie's input was except for that I kind of know because I provided one of the secrets so this is not the best example because I could just subtract the output from my original input but you can imagine that as these get more complex the programs get more complex um you would have no idea what different secrets were passed in all you would know is the output so this is an example of just a simple addition program but we've also got two different libraries that help you really interesting things with AI so the first one is notada AI um and we have different models that are able to be exported so we've got linear regression neural networks and then some more complex ones like time series span detection um and forecasting and also classification so you can do all of these things within your NADA programs which makes them really powerful and also allows you to run blind inference which I'll talk about next we also have a library called not a numpy so this is really similar to just the numpy uh python library that you might already be used to and it makes it easier to just do Matrix operations and any of that more complicated math within NADA that way you don't have to write all these functions out yourself you can just use the helpers um and have a better developer experience so what I did uh for this example is I created linear an example of linear regression on housing data with blind inference so we're going to get into this code um but just to in case anyone's not um in the AI World inference is when you take a trained model to make predictions on new data so for this data set I used um some housing data from kaggle and what I did was put it into a model and I trained the model and then I put the model weights into a secret onlion so that anytime somebody adds new inputs they can be evaluated against those Secret model weights and it will come up with what it predicts the new price of a home that um adheres to the inputs is so let's check out this code you can scan the QR code here I'll give you a second for that but this is my repo so again it's just doing the linear linear regression um and I'll open up the actual code okay so this is the NADA program for linear regression um so I set it up by importing NADA numpy and also NADA Ai and then I need the linear model from linear regression I'm setting the Precision which is just 32 that's just uh what I figured was the right Precision for this model then I create the two different parties so party zero and party one those are just each of the parties that we'll use in the computation um and so the first party will be the one that's storing the secret weights of the model and the second party is the party that's providing that new input data to figure out the price of this new home so this data set happens to have 12 different features we can just look at the data set really quickly on kaggle um it's things like square footage of a house number of bag bathrooms number of bedrooms um and that all corresponds to the overall price and that's what we'll be guessing when we pass in new inputs uh to run blind inference so that was the data set with 12 different features that we're interested in then we take the linear regression model and tell it how many features which is 12 next we load the model State and then also the input data to compare against and then we get the result of the blind inference um so this is just telling us the expected price of the new house based on the data that we pass in so this program does a lot but it's actually pretty simple and the way that we interact with it is either through the JavaScript client for Nilan or the python client so I'll show you the python code first but we'll eventually plug this into the JavaScript side so that we can create a web app where we can actually run this program um against data that we're putting in on the fly so if I go to my main file this is where all of the different neon code is happening so that it can connect to the network store the relevant secrets in the programs and also pay for the different operations and in this file I also compared the result that I'm getting from the NADA program to something from the sklearn linear model so that we can make sure that what we're getting from the NADA program is uh about the same as what we would get from a different model so we're setting the prec the Precision of the model um and then we're referencing the program that we wrote around linear regression that I just showed you next we have to just establish the party names so party zero is the one that is passing in the secret weights and party one has the new input data and then we just do some setup uh so that each of the different parties has their own own user key ID pair which is just it's kind of like a private public key for a user then we configure payments so I'm just setting something up with a ledger client and that's reading from a private key that's been funded uh so you can just fund with our faucet and then your private key will have some nil tokens that it can use to pay for any of the operations that you're doing so next we store the program this just stores that linear R ression program in the network and then we store the two secrets so the first secret that we're storing is the model so this is all of the different model weights that uh we found when training the data set so the model weights are stored as a secret in nilon we give permissions to anyone that needs to run this program so we'll give permissions to the front end and a couple other users we do that my user id which is the user public key so I added a couple different user IDs so that we can do this from the front end as different users um and then last of all we store the secret so we store the model as a secret in Nan and this is just a test that I did uh with a house that has these inputs for area bedrooms all of these types of things so when we run this program me just zoom in here I can just do Python 3 Main and this will run through oops this will run through my script and evaluate the blind computation to figure out how much a house would cost that has these different criteria so as the script runs you'll see that we're getting quotes for operations that's just estimating how much it will cost um and then once we get the quote it will automatically pay with the private key so it submits a payment it stores the program and you follow that pattern for any operation you do on million so you create um a quote which is just saying what you're going to do on the network whether that's storing a secret retrieving a secret or performing a computation and then you pay for the operation and then you can pass the operation to the pet net so this got the expected result it looks like this home is about 7 .6 million which seems very expensive um but this is also what the other model got uh I think this data set was like fancy homes on the East Coast so that kind of makes sense but I probably would not be buying this home maybe if eth goes way up this cycle okay so this is how uh you create the program and you do all of that and the next thing I want to show you is how you make this interactive so how you turn this into a blind app on million so I've got a starter for you all to check out and you can find it by going to our docs so docs.
nan.com and then you can just go to developer quick start build a blind app this will take you through all of the steps to actually building a blind app I showed you creating a NADA project that's what the linear regression model was um but the actual blind app uses this C million so a create react app starter repo and you can use this as your base to build whatever type of project um it has all of the payments already it has the quoting so all you really have to do is add your business logic so this is what the CRA milon app looks like first I have an operations page so you can just generate a user key and connect with the user key and then you can perform any different types of operations this doesn't actually have to do with the housing example but it's just to show you that you can store Secrets retrieve Secrets store programs all of the different operations against the test net but if we want to run blind inference to figure out how uh how much the house would cost we could use this page so this is just another page I've spun up with react and it's connected to the specific program ID for linear regression and it also knows about the secret that's already been stored and that secret is the weighted model so I'm going I'm going to generate a user key and connect and now I'm going to set some different input features for a house and the model will tell me how much it is without actually having to see those weights so the weights stay completely private and hidden but we're able to run inference so let's give it a 2,000t area three bedrooms three bathrooms maybe two stories n two stories we'll say it's not on a main road there's no guest room we'll just say no to the rest of these Maybe one parking spot so I submitted the input feature set and now I can run blind computation on the program so let's get the quote this is just an estimation of how much uh this operation will cost on the network it looks like it'll cost 28 youo so then I can pay and compute and I should see the result of the blind computation come on Wi-Fi let's see okay so we'll just give this a minute to load oh here we go so it's saying that this house is like 4.6 million which is also a lot but again this was a pretty expensive data set so I think that's why uh but this is an example exle of how you can plug your programs into an app and a front end really easily with our JavaScript client so whether you're writing um code in python or JavaScript you'll be able to create web apps if you use the CRA nilon starter repo so that's the linear regression model example um and I just wanted to talk quickly about our prizes so we have 5,000 usdc in prizes so we have 3,000 for building a blind AI project on million we have 1,000 for building a blind app which doesn't need to use AI um and then we have 1,000 for the best tool or blockchain integration and we also came up with a nice big list of ideas for you all so this has ideas for each of those prize categories of the different types of things you can build um and this is linked in our prizes so just look for a million ideas uh inside of the prize links but there's tons of different things you can build with AI with the different models that we've exposed in NADA a so you could do something with housing data like what I did you could do something with health or medical imaging um you could predict temperature anything like that for blind app ideas um one thing that I've been thinking about a lot is creating like a meeting calculator like to calculate the cost of a meeting if you had each of your co-workers secretly put in their salary and then you calculated how much the meeting costs based on the number of meeting minutes I think that would be fun uh you could also do things with secure voting blind auctions and we have examples of both of those you can do a multi multiplayer game anything that requires secrets to be stored and computed on so anything where privacy and secret storage is important for computation as for developer tool ideas and blockchain and app integration ideas basically if you combine us with any other sponsor you'd be eligible for this prize um and it's especially good if you're deploying to a bunch of the l2s you could maybe store your store IDs on chain so that those stay on chain Forever Without exposing the secrets you could create a forecaster frame anything like that you could build a bridge we're looking for anything creative um and especially things that we haven't thought of on this list we're excited to see what you build I think that's everything for me and I saw that it's time but does anyone have any questions about prizes or anything otherwise we'll be at our million Booth so we're happy to help all all weekend long e okay so we're ready to go hi everyone thank you so much for being here I'm gisho I'm part of the developer relations at near and I'm here today to talk about near the one chain to abstract them all so today's goal basically is that I want all of you to know that we have two bounties which add up to $10,000 one is focus on chain abstraction and the other one is focus on AI and I want you to go out of the stock you know with a good idea of like what is the near Tech stack and also have a clear understanding on how to continue after you see everything I'm going to show where is our documentation how you can reach us to out how you can reach out to us for support and also to give you some ideas uh for the hackathon in case you you know like you want to build something but you don't know exactly what uh I will encourage you all to actually scan the QR codes that you're going to be seeing Ross the presentation or at least to to take pictures of them cuz this is going to be like a lot a lot a lot of information to take in you will not see me coding as much as you're going to be as much as you're going to be seeing me explaining Concepts uh that are like important to know in here so maybe we can start with like why even using like why why do we even care about it and there are a couple of reasons right like we're an L1 that is very fast and scalable uh we have 1 second block generation time and we're sharded by Design or transactions and in aage very very cheap we're talking about like less than a Cent and we are like a certified carbon neutral chain but besides that which you know like eventually I guess that we all going to reach that state um I think that an interesting thing about near is that is very user and DEP friendly because the it comes with name accounts it has a very unique account uh access key system uh it has built-in account obstruction and it also has the ability to control up to some extent uh accounts on other chains so let's start with the first uh one of uh the topic of our bounties which is chain obstruction and to talk about chain obstruction we're going to start with our account model in here we have two type of accounts implicit accounts and name accounts name accounts are implicit accounts are the ones that you might have been seen like absolutely everywhere which is like just a bunch of characters so your account is going to be FB 09 and which doesn't tell you much but we also have name accounts which are like as the name suggest accounts that you can just uh uh refer to them by their name like near gil. near app gil. near so the next thing about this is that they're very easy to remember and they're also very useful to organize your accounts for example if you have an application you can start reducing like the version one the version two the version three and also use some other of uh some other of the accounts to put for for example uh your Dow or your fund or you know like anything else that is related to your account so it's very simple to keep organized but also something that is very interesting is that all the accounts are already a smart contract like they all can have a smart contract contract and they all are at the end of the day a smart contract if you're more if you're interested to learn more about this I recommend you to uh scan the QR code which will take you to our documentation for this and the second important thing about like near accounts is that they have a very interesting um access key model in which you might be used to you know accounts having like one key but in near uh accounts can not only have multiple access keys but this also but we also have two type of access Keys which ones which are full access keys and the other one which are like limited access Keys now full access keys are like the ones that you are aware like or the ones that you are used to in absolutely every ecosystem which you know like they have full control over the account they're going to allow you to transfer all the funds call contracts create accounts add them remove keys because again you can have multiple keys and this is the classic you know keep them safe because if something bad happens to them like that you know it's it's really bad for you uh but something interesting is that you know since you can have multiple Keys you can also just SWAT them like if you think that one of your keys got compromised you can just delete it and another one and then comes the what is very interesting and the reason why I'm spending time to to talk about this is the limited access Keys which are a special type of key that can only sign transactions that are calling a specific smart contract they cannot spend funds they cannot create accounts they cannot add or remove keys they cannot delete your account nothing they just allow you to call specific methods on a specific smart contract and these type of keys are meant to be shared and what I mean with meant to be shared I don't know if you have seen this tweet some time ago I found it hilarious about like the future of web three gaming where like every time you shoot you have to sign a transaction and for me this was like very very fun because actually the whole idea of the limit access Keys is that you can share them with some application and then the application can sign a transaction for you so for example like if you want your game to you know just be shooting and you want to save each one of these shots into the chain I don't know why but you might want to do it uh then you know you can just give the application and limited access to your account and say like okay you can call the function save shot into this smart contract and that's it like that's the only thing that the application will be able to do for you and it will highly improve your user experience because then you will not have to people to sign of course this is an this is an exaggeration but it might happen that you know you just want to store like we have guestbook example right like you just want to S like a little message and you don't need to sign a transaction the guestbook can automatically do this for you and the important thing about like not only improving user experience is that limited access Keys allow to call methods on a contract but contracts can do everything that an account can so what if you you create a method in a smart contract that transfer an nft or a functionable token now I can give this access key to any of you and you can call that method and transfer an nft to your account and now suddenly you have a link drop what or what we call a link drop you can see more information about it in the in the QR code or for example what if I create a method that when you call it it creates a new account for you now I can give you access to my account so you can call that method and create an account for yourself and this is very very very interesting right because suddenly I giving you just by sharing a little piece of my account I I'm giving you the opportunity to ga uh to gather a assets to create accounts to you know call other methods in a specific place that I want you to and that's the and that's why like access keys are so important now the next part of obstruction is what uh we call Meta transactions I think that this is already like a term that has been taken by by everyone which is a buildin system to write transactions and delegate them so someone else cover your fees so imagine that Anna wants to create a transaction right like a they want to execute something but they have literally no funds so what do they do they create a transaction they wrap it into a delegate action message this is like you know something like this specific implementation you can go into the documentation and see what I'm talking about but the whole idea is that Anna will create a message that then Anna can sign and send it to a relayer which is just like a server that is of chain and now the relayer attaches some tokens to this transaction and send it to the network and what will happen is that the network will take it and execute it as if it was anas transaction so this is a built-in system would like the the there's nothing you know like weird that you have to to to invent we just have the relayer you create the transaction and you say okay please someone pay for it and the relayer will send it to the network and cover it but the important thing again is Anna like or the transaction will execute as Anna it's not that the relayer is going to be executing the transaction the relayer is just putting the money and then everything else is of Anna so this is very useful for uh for example like if your user has literally no funds well now you can enable them to use the transactions on near by just implementing a relayer and meta transactions now so far I have only spoken about things that are possible on near and the next thing that I want to talk about chain obstruction is the concept of chain signatures which you might have heard uh the the whole idea of chain signatur is to be able to reach into other chains uh this is an interum conference so like let's focus on evm but you can also use vcoin and and and other other chains so behind the chain signatures the main concept that you have to understand understand is the one of the NPC service like a multiparty computation service which what it does is just a r a decentralized network of computers that can translate an ear account into multiple foreign accounts like evm or so ethereum accounts vcoin Dodge Etc and this service is out there listening for signatur request and when it says it SE one it signs them and returns them on chain so here you can see like we have our our NPC service that is listening and basically we have Anna that now wants to sign a transaction on ethereum so Anna asks the NPC service which accounts do I uh do I own and then ask to sign a transaction by executing an onchain action which is just calling the NPC contract in near the NPC service which is outside is listening to it captures it and Returns the signature in between the NPC contract is just waiting there and and then returning the signature to Anna who can now relay it so I have a little video showing this uh you can find example now I will tell you where you can find the this example uh but basically you can see that there I'm just logging in with a near account now I'm changing which account I want to control I was controlling the test account now I'm controlling the etherium account I'm going to fund it using uh here a metamask so if you give it a a second then the money is going to arrive if I move here you will be able to see that we went from Ser Ser ethereum to 0.
05 and now what is going to happen is that uh I'm just going to be sending a request so like executing a transaction on near where I ask the MPC service to sign for me for it it will return it to me and then I just relay it to the network and that's it and this example you can find it if you go through this QR code for those of you that are going to be uh working on chain obstruction I recommend you strongly to look at that example because basically it's going to have most of the information and most of the code that you're going to be needing at the end so I'll just give you like 10 seconds more in in case anyone wants to take it I see you're reaching to your phone so I'm going to be just like mindful of that you still have time cuz so what what is going to happen is that you're going to be taken to our GitHub and in that GitHub you will see like the near M chain example and it will also like within the GitHub you will see the the the the the the a link to our documentation so yeah if you're going to be huging on chain abstraction very much recommended that you look at this now I'm just going to repeat how it works because this is going to be very useful for like when you're hacking so near accounts can control accounts on other chains by you first ask the MPC okay okay I am gil. near which accounts can I control and it will tell you and then you say okay perfect can you create a payload for example like by me make like that ethereum account making a transaction to another like sending me ethereum to another uh account then you're going to make a call on chain just this is just like a normal function call on a on a on a um near smart contract and then you're going to wait meanwhile what is going to be happening is that the contract is going to be as in the same time that you are waiting the smart contract is going to be waiting because smart contracts in here can wait and it's just going to be waiting until the NPC contract and the NPC service answers and once the the answer is there that's it like you will get your sign transaction which which you can relay now so you might tell me okay yeah that's interesting like you sign a transaction so so what's what's so amazing about that right like so the important thing is like two things here like the first one is that thanks to the NPC you don't need to care about like the ethereum keys because the NPC is going to be taking care of it it's not that that the NPC since it's like a distribut network of computers it's not going to be able to you know like take hold of your of your accounts it's just going to be there you know like helping you to sign transactions for them so you know that you know you don't have to remember the seats of all of that if you have like an ethereum account that's if you have an account that's it now you're going contr multiple eum accounts and the second one is that the request was made on chain so it's not only that any near account can make the request is that smart contracts can also make the request right like because smart contracts are also near accounts so suddenly smart contracts can request foreign payloads to be signed which means like now smart contract can sign can ask to get a transaction signed for Dodge ethereum Bitcoin and when you combine all of these things like the account model with the meta transactions and with the chain when the chain signatures what happens is that you have a world of possibilities that that that you can build right like you could have a down year where people just propose you know like different actions to be executed on ethereum and it's very cheap to vote and you know like to to to make proposals in vote and there and you can even you know like thanks to link drops you can drop accounts to the people that you want to be voting here uh you could have a smart contract that trigger transactions in Dodge like suddenly something happens on your account and now you are making a transaction in Dodge you could link foreign accounts to nfts on near and now you can sell those nfts and suddenly you are selling accounts in a foreign chain or you could create drops uh which drop assets on a foreign chain right like you just control an account that has an nft now you can drop that account on near and it has control of an nft outside of near so truly a world of possibilities now that was for the first Bounty the second Bounty is about near plus Ai and what I want to be understood based on like all the questions that I got so far is that when we talk about near plus AI we talk about near powered by AI or AI power Byer so you know think of like the combination of these two things think of autonomous agents that can now transact on a blockchain or think about smart contracts that can take decisions based on AI models in the same way that they were waiting for an NPC signature now maybe they're waiting for like a lln model to take a decision for them so this is not necessarily about like infrastructure or like running AI inside of near or like this is not about like necessarily about like GPU power computational power it's more about like we want you to think what good can you bring into near with AI or what good can you bring into AI with near and what all with what all that you saw about like link drops and uh and and the account model and and change signatures so for example like ideas are fun tokens as a way to pay for computational time on you know like on computational time of course of like an AI model right like or smart contracts can Shield competition and wait for external input so maybe you know like your smart contract makes a decision about like buying some asset or sending it or like you know just make a decision on chain based on what an external model is telling them or maybe you know it's about AI to help people navigate with three problems like you know create F funable tokens swap tokens using like natural language so I have added here two QR codes one is about like a small example that one of our Engineers created about uh using chat GPT through a smart contract is quite fun and you also can see an AI showcase that happened yesterday where different AI companies showcased what they are building on on on near so let's talk a little bit about logistics now uh you can find everything that I was I have talked about in nd. uh and you we have a telegram Channel where you can find support from us and uh this is the QR code that I put at the beginning which will take you to the bounties the documentation information where to find us and I will make sure to add uh the the the hackathon ID in there we also have a booth so please feel free to come and say hi we are both like marketing and Technical people there particularly I'm technical someone else is there for support if you have questions about like how this works or like how code works or like you're coding and something is not working just please come and and and and ask for help we are here for that thank you so much we we have one minute if anyone has a burning question e should we okay I'm going to yell out okay excellent so uh we'll start and then hi everyone I'm I'm one of the co-founders of dynamic uh what we'll do is two things oh I need to speak to the microphone right okay uh we'll do two things we will first see a quick demo of dynamic and how it works and then after that uh we will kind of run through how to build your own thing within uh with uh scaffolding e which is a really really cool thing with Dynamic together kind of run through that so those are kind of Zo steps I'll run through the demo very quickly and then I'll hand it over to Matt uh to actually run through the rest but the way to think about Dynamic is everything that happens after you click login on a website so dynamic as the name suggests is very Dynamic it can be kind of a more web three first type experience right it can actually be a multi-chain so if you're building on bitcoin or salana or evm it can actually work that way or it can be a very web to First experience so not talking about wallets at all just social login email login and everything around that with wallet Creation in the background now it's it's very customizable so you can make it feel exactly like the rest of the product you can kind of do it as an embedded thing you can do it as a popup it's as the name suggests it's very very very Dynamic right it can feel exactly like the rest of your product you don't have to change anything you can change colors themes copy everything uh you can change kind of order of things so you can say hey social login First let's merge these let's split them uh remove the continue button do this fully headless whatever your heart desires you can actually do now the cool thing is with Dynamic you really kind of if you don't have a wallet if the user doesn't have a wallet and you log in it's within the single click it generates a wallet so that's pretty much it that was the entire kind of experience and you got a non-custodial wallet uh the end user can export that wallet at any point but then where it gets really cool is you can start adding things to the profile that was created so in this case I added a couple uh embedded uh a couple third party wallets I can link additional wallets across chains I can kind of you know do things and Link uh kind of different metam mask wallet so I can uh kind of let's let's unlink this one as an example and add a different metam mask wallet so I can add a metam mask wallet pop it up and Link it to the same account so you can start building these really sophisticated experiences uh for user management you can also link additional social login methods right so this user for instance that has multiple login methods has this really cool kind of uh structure to the user information of a bunch of verified credentials for that user so all the wallets that we connected all the emails that were connected in a single spot now Dynamic takes it a step further and you have this full user dashboard where you can start doing fancy stuff so you can essentially for instance say look if someone logs in with a wallet let me ask them for an email address or let me ask them for additional custom Fields as part of their onboarding or create access lists so you can say uh only folks that log into my site with this specific email or this specific forecaster ID can actually access or kind of get scope access to that site so for instance um I can let's log out and kind of try to log in with the wallet and if that wallet has access then Dynamic kind of turns from just an authentication tool into kind of a full onboarding platform so in this case I can capture someone's email or social login or anything like that as part of the flow so it's not just authentication but it's onboarding onboarding and authorization as well now Dynamic is kind of really again as name suggests Dynamic so you can see an an action in different plac so on Magic Eden for instance magic Eden is fully powered by Dynamic so if you log into magic Eden that all uses Dynamic and what you can see they've done is they let you now link your salana wallet your Bitcoin wallet your evm wallet into a single spot you can kind of Link additional wallets very quickly and here this is as you can see this is it looks like Dynamic this is actually Dynamic and so you can mix and match between a headless version of the product or or kind of a a more detailed version uh a good example bracket game which is a social fi type game uh use it Dynamic but just with email or eurocaster uses Dynamic with kind of a foraster login right so you can actually build different experiences very quickly so if be chain is an example all core be chain apps use Dynamic so there different kind of versions of how you can implement this and it's all with toggles on the dashboard so it's very very easy to get started and with that I'll probably hand it over to Matt to actually go through uh how to build something very quickly go for a that all right can we see wait can we not see there we go there we go okay okay this talk was not titled this but I am going to try and give you some superpowers CU we were looking last week at what took people the longest to get going with their project and realize it's not actually integrating Dynamic it's not onboarding it's the glue to put everything together if you try to build in your account abstraction layer your chain abstraction layer connecting to all of the wallets to actually verify and sign for those transactions it's not so easy and we don't want you to have to spend time building the basics we want you just build the project so what we did on top is buil something called the hackathon starter kit version of scaffold eth this is a community project to help you get going we chose only partners of eth global because we're here for bound bounties let's be honest we're also here to build something super cool but it involves getting bounties along the way so all of these are partners of eth global all of them have bounties and it allows you to integrate them super super quickly so I'm just going to give you a brief overview of how to set it up you can then copy and paste the code Snippets that you need to to do certain things into your own project or you can use this one so to be honest I think quite lucky if you're here to see it in action because again the title of the talk is not there this I'm sure will be shared more broadly a bit later but let's give it a go the easiest thing you can do to get started is MPX create Dynamic app you can also clone the repository can give you a QR code but if you do this it's one line you can choose scaffold eth hacker Edition give it oh God I hope how many numbers do I need to go for let's try 15 how many times have I install this you can take a guess and it's done it cloned the repository it will remove the remote URL so you don't end up pushing to the original with with your hackathon project and that's it you can now follow all of the documentation from the readme which is exactly the same as scaffold eth which by the way he's staying very quiet but there is Austin in the back who helped build scaffold eth so if it's working well cool talk to me and if it's not he's there no worries so all you need to do is yarn we can do that here but I won't because we all know how long that'll take you can run yarn and then you can run two other commands yarn chain will start a local network and yarn start will start your front end and once you have it up and running you'll see something like this so I'm just going to give you a tour of what you get straight out of the box it's all of this stuff like I say it's the glue okay so the first thing is a dynamic is there by default it has a default environment ID so you can see this set up you you can also add your own environment ID and customize it so let's say we want to log in with metamask let's do it over here we are already logged in and connected to Bas sapoia now we all know there are a lot of evm networks here and they're all amazing so I tried to add one and then felt like crap they're all amazing so I added them all every single evm Network that's here which has a bounty indeed we all do is present all you have to do to start testing is Click connect and in the code you can now start signing messages signing transactions you can flip over and I'm going to introduce you to the code now here in packages in nextjs you'll see a bunch of things like components and lib so you'll see in Dynamic this is how you can send a transaction you'll see that this is how you can sign a message our docs also have this but it's good to know because it ties up with sign hello world and send some eat to yourself you noticed that we also had a local network running so if you're deploying contracts and testing you will be using that hard hat Network most likely so all you have to do is switch to it and it works out of the box you can also not just sign up with a wallet you could sign up with email and get an embedded wallet so people don't have to worry about web 3 exactly the same flow beyond that there are a few amazing Technologies out there like polygon arbitrum and they have things like orbit orbit means you can deploy your own L2 or an app chain or any kind of rollup you want which is incredible if you're going for something quite deep really cool it actually takes only about 15 minutes to set up one of these chains I tried it with orbit I'll show you over here this is it running you don't need to worry about what it's actually saying but we have a local app chain running it's a rollup why am i showing you this because should you want to enable your own network if you're running your own chain here in the networks tab you can see the format these are very easy to find things you can find them for any network on chain list I'm going to uncomment this one let's see if we don't need to reload we don't we're going to connect to our own local running chain and off we go let's sign a message let's send some eth to ourselves I put this warning in just to show you how you can do different ux patterns you can see it in the code we will sign and send just like that it's done if we go to the block Explorer which comes with this local chain this runs on block Scout again another provider of e Global if you go to the blockchain you go to transactions you can inspect your coin transfer so this is all the glue which ties it together all of the code is in here you see in the block Scout lib few lines copy it over you can start querying your own transactions even more interestingly if you go to the smart wallet tab this is new for this version of scaffold eth safe one of the amazing providers out there I'm huge fan allows you to deploy an AA layer so we'll do it on basoa all you need to do is click this button and you have a safe account if you want to add the same in your code it's over in I think app safe page not refresh not transfer we have copy to clip cord and up here there is deploying a safe wallet so you can grab that code check it out and not have to worry about any of the setup once you've done that you might want to do a cross-chain transfer chain link who's also out there and is amazing done I think what I'm trying to say is we're all amazing that's pretty much the point of this talk but no I'm just trying to be fair because it's hard to to leave out every every different kind of technology so let's see do we have any balance why don't we fund it from the circle faet this is something you can build into your app if you're building on something and you want to let people get stuff very quickly let's copy our usdc address put it in and what we need to do is move to base supp poia token sent let's give this a go you can now control this flow as you want we've just kept it plain and simple so there are multiple approvals on your safe you could batch up the transaction you could do it in any way you want you can have Pass Key MFA you can have onetime code MFA to your email or you can have no MFA at all and just it's probably unfair to call it silent sign right but you can just sign without any any process in the back end depends on what you're going for if it's a consumer app you might want to bundle and just allow the transactions through it's a big trust assumption so take that as you will pass keys are always there for you we now have a transaction in initiated successfully as far as I can see and here we can query it on block Scout so that's using the API calls in there amazing so was there anything else that we wanted to show I can leave a few minutes for questions at the end as far as Dynamic goes it's I showed you at active on a few sites but there are many different ways you could implement it you can do it like web 3 native completely web 2 I think Doodles is a reasonable example of that you can do it through through telegram you can do it through forecaster there's a full forecaster guide section so in any way you want you should just be able to pick up the SDK and embed it pretty much as we've done here there's also the react native SDK if you want to use that for mobile and you can always browse through the documentation to find anything else so with that said the idea behind it is there's I'm going to show you our prizes uh we have here we're not in London although that was was a really fun time here we go so we tried to tie it in and help you build creative interesting stuff the first is for cross chain the second is to abstract away crypto just improve life for people in general but without them knowing they're using crypto it's to get around the fact that there's a you know literal on-ramp in their minds to oh no this is crypto then social fi which can fall under quite a broad bracket but as long as you have a financial incentive to run a social experience or experiment you're in really cool and then the best integration so whatever you combine different Technologies into to do something novel will qualify this is because I really want to have fun thank you Ty for suggesting it but often like we get too far into the weeds like the technical stuff and this this this but often people just want to have fun ideally in web too right we we all know that we love using crypto for fun like forecaster and stuff but if we can use it to have fun for people who know nothing about it that would be absolutely incredible okay I think I'm on time in fact under time last thing we use pimo as the pay master all the transactions are sponsored with gas because it's on a test net you don't need to create a policy or anything just sign up for pimo get an API key plug it in and you're good to go it's all sponsored if you want to go to mainnet then you will need your own policy but you can do that on the pimo website if you want support Discord Dynamic Channel or ask any of the partners because most of them know about this what I'm going to try and do next is deploy a chain on polygon cdk and plug this in here but yeah if you have any questions we've got the booth over there and we'll be around all weekend easy thank you sorry hey question hello nice yesal datab yeah so it's stored on DWS essentially for custom Fields here I'll grab this for a second um essentially on custom fields for any custom field you can do it API based so in our docs just search custom information capture and uh there there's like a kit that shows you how you create kind of a custom field input type uh whether you want any regx type validation and you would link that to that wallet correct that's right to that user account yes that's exactly right you could put multiple you can have them show up during on boarding or on so you have that full here's the default fields which you can just turn on you can either skip them during on boarding or not and then with custom information capture you can enable whatever Fields you want it's up to you when you ask for them by the way you can ask up front or you can ask like gradually what you're giving value but that would basic used to their that's exactly right more than that there's so everything user management you can do the so there's a meta data field so if you want to store information and you don't want to surface it to the user you can also use that so if you want to store additional information on user object you can do that too not just for information in the last moment just just on that point as well as linking information you can obviously if you have an embedded wallet you can link an EA and if you're on a single EA you want to for example add your coinbase as well you can do that and because it's fully compatible with smart wallet you can just add that in as well using pass keys so yeah multiple information but also multiwallet linking as well which is quite cool and uh one more cool so two two other important things if you're building a consumer crypto uh and you want after you create your wallet uh there's a concept of transaction M you need an approval or pass key for transacting uh if you want to remove that requirement come to our booth and add you to a feature FL that so ESS as soon as the user l in just with no additional popups just come to our booth We'll add you to that feature flag and you'll be on your Merry way just create an account appxyz come with environment ID and we'll we'll add you that to that feature flag we're around all weekend so if you want to send stuff our way Come our way're [Applause] here e all right okay uh hi everyone my name is Blessing and I'm the developer relations manager for EMA region at C uh today we're going to be talking about building with c's developer platform so essentially what I'll be going over is I'll be going over what the circle developer platform is what you can use it to build and how that sort of ties into the Bounty and what we expect from Aras today uh sorry for the entire weekend what you can come up with and also how that ties into how you can win all the bounties that we've listed on the its Global BR uh page so starting off uh this is essentially what to think about when you see the when I talk about the circle developer platform and it sort of offers the cohesive uh technology stack that you need to build on cirle right so if you start from the base we've got the blockchain networks and you can see pretty much all the blockchain that usdc supported on and on top of that we've got the stable coin protocol which includes of course usdc and EC and then cross chain transfer protocol uh which is cctp I'm pretty sure everyone is familiar with cctp and cctp let you move usdc securely between blockchains and also we've got the bridge usdc standard and sitting on top of that is the web3 services and web three services uh allows you to use three product offerings that we've got at T we've got the programmable wallet we've got gas station and we've got smart contract platform programmable wallet let you embed secure uh wallet into your application be it mobile app or web application and you can also uh embed gas station sponsoring gas fees for your for your user so they don't have to go out of your application be it mobile or web application to sech for Native gas and they can just do that right into in the application and programmable wallet is really special and unique in the sense that you can interact with smart contract we've got an endpoint that lets you create transaction and super easy to use we just an API call you're ready to go on your way so uh on top of all these constructs should be your application or your business so if you're building something in this alaton just think through like how can I use my how can I build my application on top of everything that I've got here as a technology stack to solve the use cases I'm going to work through in a bit so so uh let me just go to the next slide we will just go to the price pool information and I'm going to walk through everything so uh on the E Global website you can easily see everything and categorize them easily on how you can win for each price category so I'll start with the first one the first one is crossb payment and you've got 2,000 usdc for this price pool and it's the first one so what we're looking out for from this price pool is is we're looking for an application that it could be a mobile or web application it could also be an integration or it could also be like a protocol integration that uses blockchain for cost effective International money transfers and you also save cost while you move funds from one country to another giving it that crossb payment flare and we've listed a ton of examples because we know that uh developers you've got like really short amount of like really short period of time during this aaton so want give you examples that you can easily get started with to help you think through what we're looking out for and help you understand how to win for this alaton so we've got payroll platforms and that essentially means like uh Global salary disbursement where you can use the blockchain to distribute salaries for workers in another country and they can easily get paid working uh for another country so we've got International remittances peer-to-peer payments and essentially uh one flare that were adding to to this aaton uh is we also looking out for Innovative application that add AI into the integration we all know that AI is uh kind of gaining traction now I we just want to explore how you can use AI in blockchain to build really really cool use cases and we saw that from the previous araton in eth London where a developer actually used large language model with the blockchain paying uh paying with usdc and it was so cool so we thought to add it this this year and want to help developers think through how they can build Innovative project uh embedding AI into the blockchain so that's for crossb payment uh We've added qualification requirements basically what we're looking out for is we don't want you to spend the entire weekend to build a fully fledged app uh it takes time to build something great want you to just spend time to build a reasonable MVP something that works something that you can demo to the team at the end of the aaton and something that really fit all these use cases that I'm working through and you can document your processes show us really nice GitHub commit we don't want to see kind of like a just one upload want to see steady commits like okay started on Friday Saturday Sunday that shows us progress it doesn't have to like really really it doesn't have to be fully fully functional at the end want to just see that progress right and also give us feedback so there's a survey link embedded into this uh qualification requirements page uh F the survey let let us know what what product that you love let us know uh what tutorial you want from us let us know what you want in general so you feel the survey answer all the questions so going moving quickly to the second uh uh price category is best application for dollar access it's really explanatory and we have people already coming and ping to us how they can even build for this price category uh essentially what you're going to do is use the blockchain to provide Global access to Dollars we all know that some regions are at disadvantage when it comes to accessing dollars you can use the blockchain usdc and use the CLE developer platform everything I talked about programmable World smart contract platform gas station embedded in your application to build something really really cool and again we've got examples we've got wallet consumer applications Marketplace applications payment applications and again you can incorporate Ai and we've added examples of how that's possible so the next one is crypto Capital Market crypto Capital market for a price of 2,000 usdc winning price in this case we've got examples of how you can use usdc as collateral for borrowing and lending digital asset providing loans with usdc and for trading use cases uh for crypto assets and also provided more examples in AI this is a really special category which is the last category uh this category really talks about how to build for emerging use cases we all know that uh some of these three use cases that we've talked about might be outside of what you're interested in working in working on so we've got you we've added emerging use cases and here we just want you to think wide Innovative right and we've added a ton of examples of how you can use usdc programmable wallet you can even combine that with AI you can combine that with social platform web through social platform that again supports Financial incentive how people can get paid and another cool task that you can also add is or another cool project that you can also work on is how you can use usdc to pay AI workers which are digital workers on the internet and we see blockchain are actually shining with this use case so that example that project will fit right into this category again so long as you you ensure that you're using the circle developer platform to build everything I'm sure you'll be really considered in one of these use case and we have examples with AI building retriever augmented generation chart boards with again Ai and then the ccle developer platform and then the blockchain so we just want you to think outside of the box so if you if you've got any defi protocol that you want to build that would fit right into this category and this category the total price here is 4,000 usdc and it's divided into two we've got the first place for 2,500 and we've got the second place for 1,500 so everything I've talked about where do you get help right resources so I don't want to I know this this time the time I have here is really short let me just point you to how you can get really good resources that our team has put together sample applications developer documentation so if you come right here and all these examples we've added them right here so you can go through and click on one of those link and be able to learn but let me just quickly talk through this so uh this sample app is actually a really cool sample app that we just launched is the circle user control wallet sample app and all the code that you need you can find them right here and this l points directly to the live demo and this demo uh sorry one second so this demo you can see this demo I'll just switch the wallet here to polygon yeah so this wallet uh this demo actually shows how you can deposit usdc send usdc from one address to another address and it shows your balance so this is an an example of how programmable wallet actually works and I'm sure if you need to go through the code you got everything right here all the codes all the examples you can read through see how we are integrating programmable wallet into a fully functional application and that would help you think through how you can do that for your own use case so don't worry if you are looking for the link is embedded in the uh in the price page that I just walked through right here one second in the price page that I just worked through be yes so you can it's it's right there in one of those sample applications uh I'll just double check it again and includ it so another cool thing is that we included winning project from the last uh from the last aaton crypto relief that was from London yield me is is a yield protocol that was built and won the price during the aaton so uh the developer documentation everything that you need here so this is actually one of our learning platform uh where that that categorizes how you can build with user control programmable wallet developer control programmable wallet and how you can embed CCT CP with programmable wallet so cctp is the cross chain transfer protocol and it let you move usdc securely from one wallet from one chain to another chain so you've got you can have usdc on say Avalanche you can move it securely to ethereum by natively burning and minting on another chain so this guide actually works through how you can use cctp and how you can use it with programmable wallet this works through how you can use developer control programmable wallet so if this is your first time coming across all these products we have all the learning materials that you need uh to really understand everything so and then we've got the developer documentation all the apis everything that you need ready to go is embedded right here so you can visit developers. circle.com so I'll go back to my slide and that's pretty much everything I want to work through and I thought to add this quod to motivate us CU I know it's a long weekend ahead of us that we are Builders and we should remember that at the out of every line of code lies the potential to change the world let's innovate with passion and build solutions that Inspire the future thank you everyone so uh questions I have one yes please I check part wallet right and basically examp with xode yeah in the end you reach the vi that you are able to and rece yeahp toble yeah that's a that's a good question so this is can you repeat question oh okay so yeah so what he's asking is that the sample I just showed actually shows how to transfer usdc from one wallet to another is that the is that expected is that something you can submit or we want more from you guys so uh to answer his question that's a foundational sample app that shows you how the product works right so that's a really good starting point you can build a use case that actually solve solves a problem and again ties to all those category that I listed either for crossborder payment uh either for dollar access or crypto Capital Market or any emerging use case so I would say build on top of the foundational sample apps you already have some something ready for you to go right so just think of a particular problem that it could be in where like it could be something that is particular to you right maybe in your region you're trying to solve a particular problem with blockchain so that's this is a good starting point just build on top of it following all the guys that I I talked about yeah uh any any other and also we've got sample apps in react native so if you're a mobile developer all you can easily use a react native sample apps as well uh have the the documentation also linked in the price page so you can get there quickly as well yeah uh any other question yeah yeah yeah for.
circle.com for. circle.com okay but I think there's amount yeah come to the boat we can yeah we can work something for you okay yeah you're welcome uh thank you everyone I wish you good [Applause] luck e e spe e you good hi guys welcome to blog Scout Workshop my name is k I'm head of resource and an engineer at blog Scout so if you haven't heard of block Scout before block Scout is an open- Source blockchain Explorer for evm networks rollups hundreds of them so the agenda for this Workshop is just a couple of slides why and what is block Scout and why it's important to have something like that and then we'll just go through different things you can use in this hackaton blocks Scout for different apis contract verification and most importantly how to win money in this hakon what's our bounty we believe it's the easiest Bounty throughout this Hon so thank you for coming just uh yeah should be pretty easy to get a part of it so couple of slides about why something like block Scout is very important uh to have in the industry in the space so in the past couple of months and years we have seen this rapid growth in a number of evm compatible networks rollups with the advancements in the rollups like op arbitrum Zig sync and stuff like that it's become super easy super cheap to launch your own rollup to launch your own evm and then there are just multiple rollup is a service provider who does that for you with just one click of a button you can get in a few minutes your own rollup for devet testnet or even minet purposes and to use it for whatever specific app requirements you have build your an up chain on top of it and so in this scheme where you can launch your own rollup within minutes it's really important to have also for each of those rollup you need to have some interface some block Explorer to explore what happening on this rollup to explore your transactions your addresses the token movements Etc and so it's really it's really evident that no proprietary or close Source solution will be able to catch up with this open source movement and so you won't be able to ever launch a Clos Source solution in couple of minutes but you can do so with blog Scout maybe not in minutes but in a couple of hours for sure if you're doing it for the first time you can launch the blog Explorer for your own newly launched rollups or there are also rollup as a service provider or ourselves we are providing the service as well for hosting the open source Explorer for you so what's the state of block Scout today block Scout is the number one most used open source not just open source but most used the Block explor in the number of networks it's really hard to keep on on updating these numbers because the networks are getting launched and turned off each day in t or even hundreds and so so what's just some bullet points about the block Scout success in this landscape so block Scout is fully open source on the backand side on the front hand side it's fully compatible with all of the pop rollup um families like op St arbitrum cync Etc it's fully compatible with the evm main net if mayet one specification we have a bunch of different modules like ens support or different other ens for support on different networks depending on what's important here and there we have some specific modules for supporting account abstraction for supporting data availability and plops um and a lot of different other modules you can turn on and off within the block Scout instances block Scout is user friendly it's simple to use it's very natural and especially when you see it on these hundreds of networks users are becoming very familiar with its interface so it's becoming easy to just use Blog scouton the new new networks as well because you have seen it on the past uh in other networks tens of times already so now about what we have for the hon so basically okay let's talk through the block outout apis that you can use for the hackaton which is um basically one of the way you can apply for our Bounty um we have I think I should have a separate slide weird Okay so yeah we have a bunch of different apis for the blog Scout you can use within your builds one of them is the rest and graphql compatible API so that that's the API itself that is powering the open source block Scout UI so whenever you see something happening in a block Scout UI like different transaction information block info talking transfers for account obstruction data that's the same data can be extracted through this uh UI specification we have all the docks of course in the swaggers so you can search through them and so if you want to get some specific part of the the block Scout data you can find in a UI you can also incorporate it easily within your builds as well just by finding the respective method in the rest API and uh use it right away and the same stuff applies for the graphql which is just slightly different format from the rest uh API standard if you're more familiar with it you can simply use it as well no problem at all then the second piece of the API we have at block Scout is an RPC compatible API which is designed to simplify the transition to blog Scout from other potentially close Source block explorers like eer scan or other so here we have this bunch of different modules basically it's the same API as the rest API but it's in a different format which is fully compatible with the eer scan other close Source block Explorer so if you have some library that you are using for the block Explorer interaction to fet some data to do something to find some information or if you already have some code interacting with a block Scout through for interacting with the block Explorer by using some sort of this API you can just replace the link with the specific RPC compatible API from blog Scout and it will be fully it should work as good as on any close Source block Explorer here as well and then the other solution we have at block Scout is then basically an Choice owner PC compatible API so if you're familiar with all the methods that is uh that are available on the low level of the Chon RPC of the particular evm node implementation then you pretty much get all of this method for getting the logs balances transaction data block data in the Jon RPC format and these apis are typically available through the dedicated Jon RPC providers like infura anchor Alchemy or something like that but we at blog Scout also are able to use our own infrastructure for hosting this data and to we are actually trying to expose the same data through the same compatible API as well and the best use case for it and also the way how we use it in our own UI is as a fullback option for the existing just owner PC provider for example here you can see the example for the popular vagmi uh UI Library basically to how to configure the fallback provider between multiple rpcs you can put your injected wallet then some public RPC provid and if something happened to both of those in the end you can also put the followback provider to the blog Scout so that your API and your uis are more robust more redundant or available regarding of what's happening on the on the network level then a bunch of other stuff we have at block Scout is related with the contract verification so just um contract verification is of course a really important topic for the developer and it's really important topic for the security perspective of the evm space so just to give you a few words how the contract verification Works in general is that whenever you are trying to match a certain deployed contract that is currently unverified you are submitting the source code that you used originally to deploy this contract and we recompile it on our own infrastructure with the specific compiler settings you choose like the version optim Optimizer settings specific Library addresses you used and then we basically match the bite codes together and if we get a 100% match then we just put this screen pick in the block Explorer and put the source code and then you're able to interact with the contract through the ABI and the stre and right contracts and U review the source code for your own contracts or the contracts verified by other um onchain users so in Block scow the way it works is that in many cases we can also automatically import the force code from different third party platforms if the contract is already verified for example if we are able to match that a duplicate contract with the same source code with the same B code already exist on the same block Scout instance there is a good change there is a good chance it will be automatically matched and verified without any user action needed then we are able to do the same with sourcify and uh they share block out by Cod DB database which is sharing this spy code and source code information across different block Scout instances so if you're able to find the already verified contract on some other block Scout instance on sourcify there is a good chance it would be automatically imported without any manual Source cost Mission requirement and then one of the other features we are currently working on is called verifier Alliance which is basically um Step Above on top of this block Scout bit code database and there the idea is to connect not only open source block Scout instances we are hosting somewhere but also to invite and connect other source code providers like tenderly other blog explorers for different analytical tools where you have here and there different forms for submission of contract source code here the idea is to combine them in a single database in the uniform format and so whenever contract is verified somewhere it's immediately getting available for interaction or for Analytics in all connected partners and their platforms so if you have if you want to know more about verifier Alliance feel free to join the telegram Community for further updates on that matter so if none of these automatic ways for the contract verification work then unfortunately you have to do something for the CLA or manually through the UI to verify your contract so here we have a bunch of different ways how you can verify and me your contract information to the block Scout basically they do the same thing but in a slightly different matter and they slightly better in certain use cases and so it's better to use some ways than the other for some particular use cases so thir the simplest way and is probably the best way to do the contract verification for small and very simple contracts potentially consistent of just one file with a few lines or the best for the Viper contracts which is a second popular nonsol solidity alternative for evm contracts is to submit the contracts through the block Scout UI just pick the settings you used for the contract compilation like the optimizer runs the compiler version copy paste the source code and click verify and after a few seconds the contract will go through then there is a way to verify it through the different Automation and custom verification logic if you have some custom deployment Pipelines customy scripts then you you can incorporate the block Scout API for the verification directly so the the API methods that you attach the source code exactly in the same way as you did in the UI put the all the compilation settings and just make an API call instead of clicking the buttons in the UI then one of my popular ways is to go through sourcify so you can verify the contract there if it's not verified and then automatically imported blog Scout so that's also a quick way to get Contract verified in multiple places at once then there is some third party tools that support the block Scout verification like catapulta which is basically I think the best way to proceed with the contract verification if you have some really complex deployments consisting of huge number of contracts across different chains and you just don't want to do it manually these tools make it easier and faster to just optimize this across different chains EXP explorers Etc and the last is probably the most generic way to approach the contract verification is to use the our Integrations with The Foundry or hardhead which I believe are currently two most popular developer Frameworks for solidity contracts and so there through just specifying a couple of CLI options and uh pointing the developer framework to the concrete block Scout instance urel it will be also relatively easy to automatically verify the block Scout contct whenever you're using those tools to write the deployment or deployment scripts basically and then one of the other features we have with blog Scout is support for different proxy patterns so proxy patterns is very popular way to write and deploy contracts within the Sol landscape so we haveo this huge number of different standards uh we support minimal proxies different proxies based on the specific storage slot parameter ABI method based proxy and Diamond proxy custom proxy implementation for example agnosis save so if you're using any of these proxy formats it also should be automatically verified within block Scout whenever you verify both the the proxy contract itself and the implementation and the blog Scout will link those contracts together and simplify how you can interact uh on the contract page with those kind of contracts so now the to the good stuff so basically what we have for the Bounty is our Bounty is very simple very straightforward we just have this pull price of $20,000 for all projects that successfully use the block Scout throughout the builds so basically if you just use the blog Scout as a way to link user to the blog Explorer for their transaction that they made through your D app to the contracts they interacted with to their address profiles or to something else then you qualify if you verify your contracts in the blog Scout and show it to us during the presentation that also make you qualify if you use any of the above mentioned apis like the rest RPC graphql or just put the Chas on RPC for back API for the block Scout you also qualify and also as an optional bonus you can also prepare and submit your DB um in the DB Scout Marketplace which is Marketplace in the block Scout so this would just allow your doob to be available to more users through the blog Scout Marketplace and then the most important stuff of all you just need to show how you use blog Scout and how you Incorporated it during the presentation to be 100% eligible sorry you need to meet all requirements or one of the requ it's important to meet one of the first three and then of course to show it to ask him to specifically clarify it in the project and Mission how Ed to show the screenshots or even better to show during the life demo then you can be 100% sure and these Bounty will be split among all of the qualifi project so we have like 20 of them then each one receives a thousand um yeah and as one more bonus for what happens with block Scout after the hackaton we're also starting up and booting up the ambassadorship program for blog Scout and recruiting different ambassadors for creating social media content for representing block Scout in your local communities or participate in different events as part of the blog Scout brand so if you are interested in something like that and you want to apply and potentially also earn some money for that please fill out the form and we'll get in touch very soon after the hackaton with the more details on on that matter so yeah that was pretty much it happy hacking and if you have any more questions please feel free to [Applause] ask you happy with using Elixir blout yeah so the question is are we happy with using Elixir yeah block Scout is open source and it's um currently consisting of two main parts the core backend which is written in Elixir and we also have a bunch of microservices written in Rust and then the the front end is written on next chair and react so are we happy with using Elixir I think uh yeah why not alexir is a kind of unusual language of course and you don't meet it a lot and uh maybe someone it makes it harder to contribute but at the same time also it's make it makes blog Scout unique makes it interesting for a lot of developers to look through its codebase to learn something new it's interesting to just nobody wants to contribute to another JavaScript project sometimes but when you see something Elixir that maybe makes it more interesting to you as to contribute something so yeah I guess we are still happy yes uh yeah the question was about the is AI export is the API display some information about the tags on the addresses uh the answer is yes we have the API and the micros service for tracking different Texs related to the different addresses we have an service responsible for linking addresses with the ens and alternative name service providers so we get those texts as well but uh yeah for stuff like binance addresses whenever something is labeled somewhere and we imported it yeah there is a API for that service of scout only possible and uh is self hting having some requirements on the system no um there is no requirement to set up your own block CL or whatever we have like these hundreds of hosted instances of Block C that are hosted some of them are hosted by us around like 50 of them some of them are hosted by rollup as a service providers for the teams as well so unless you're planning to launch your own rollup throughout this uh hackaton then of course you can spend some time to launch the blog Scout and we can help you with that but if you're using the existing chains then there is no need to do that okay CH you can just use yes yes for most of the popular chains and rollups optimism main net test net base polygon every every one of them has the block code instance thanks okay I guess we are done thank you very much Happy haing e e all right hey everyone um thank you for coming to the talk I am uh SAU I go by SAU I work at the unisoft foundation as a Dev protocol engineer on V4 um today I'm going to be kind of doing a Code walkthrough on Dynamic fees it's one of like the many features of V4 um if you're looking for a more beginner intro into hooks um you can come find me at the booth in the main Auditorium afterwards but um so today we have like this demo use case of changing the pool fee as a function of gas price um and so today we'll be just learning like what are Dynamic fees in V4 like what are some of the use cases that people are using them for um how does V4 sort of handle these under the hood and then we'll kind of do like a nice little code walk through on on Dynamic fees um so in V4 or I guess in V3 the the fee tiers are fixed to like four values in V4 um we also support Dynamic fees and this what what what it really means is it lets you arbitrarily adjust the fee value up and down without requiring users to like migrate liquidity or change up like their their positions and this is arbitrarily uh calculated inside of a hook I know there's some amm out there that do Dynamic fees but they sort of ensine some sort of hardcoded logic but in V4 it's up to the developer to implement and how they want to set the fee um these are setable at the transaction level so on every swap you could change the fee if you wanted to you could do it at the block or some arbitrary infrequent interview like once a week once a month so on and so forth um and so in terms of like the use cases that we're seeing with developers voting on V4 a lot of them seem to be interested around creating more efficient amm um you can sort of change the incentive Dynamics so in our case as gas price goes up as it's more expensive to swap uh we can make it for the cheaper for the users um to incen incentivize volume um I've seen some examples of people using Dynamic fees for like token issuance where like if a token is new and as it matures you can kind of like uh Decay its its fee value um so those are some of the ideas with with Dynamic fees and V4 um so how to do it in V4 there's two ways the first way is what we call like cash Dynamic fees and there's a function in the core contracts that say like hey for this pool for this trading pair uh the fee value is now this right um this is a right into contract storage so that whenever users swap we read this value from from contract storage um this is really good for infrequent updates uh so if you're changing at the Block Level slash like May maybe like once a week you can have somebody come in and say like hey the fees changed um after working with a lot of developers they have been increasingly more interested in changing the swap fee on like every transaction and so we came up with this new implementation called like the override fee or the non-cached fee and what this does is it's in your before swap function you're returning a value that is used for that transaction itself um this value is not written to contract storage and it's handled in memory so it's a lot cheaper for cases where you want to change the fee on every swap um and I'll be going into like uh examples on how both of them work um so in V4 whenever you define a pool right a pool is made up of which two currencies are being traded which tokens are being traded the fee value and the hook contract and so to initialize a dynamic fee pool you just need to uh set the fee value to like some special flag this communicates to the core contract saying like hey the fee can go up and can go down um this setup is the same for both ways of doing Dynamic fees so um just something to be aware of and so how cache Dynamic fees work in V4 is there's um the value is saved in slot zero so whenever you uh call this function on the core contract it says like hey this key has a new fee of this value um there's some checks that happen so like one uh the the call to this has to originate from your hook so nobody can come in and say like hey my enemy's pool should be 100% fee so it has to come from your own hook it has to be within zero to 100% and those are really the only two uh conditions for uh updating the storage value which happens in the last line um the override piece so this is what it looks like inside of a a hook contract so you define this function called before Swap and what you can do before swap is run some sort of fee calculation um it's kind of just hidden under gipt and what you do in the return is you you need to append a special flag on it so that whenever you return it to the core contract the core contract also runs the same checks like is it between zero and 100% and does it have this like special flag and if so that fee value is used for that swap um and the value is not safe to storage so it's it's a lot cheaper to use um cool so I'm just going to go over our example today um so if we want to set a fee based on gas price we can create something where you know if the gas price is going up uh we'll make it cheaper for swapper so decreasing the fee You could argue um that it should be the other way where if gas price is going up it's more like the Market's more volatile LPS are at higher risk the feed should be going higher but uh in our case we're going to try and incentivize swappers here um some more information around it is we're going to set like a a base amount and then dependent on if uh gas is trending up we'll cut that fee in half and if gas is trending down we'll we'll double it um and like I said there's obviously more complex designs and more uh production style uh implementations that you could do so I guess I will did not prepare this um so the people that are new in the room this is what a hook contract looks like um it's a contract that like inherits a specific interface from base hook you kind of Define uh which functions you're going to be implementing and in our case we're doing before Swap and after swap but there's a ton of other sort of customizations that you can do in in V4 um and so and before initialize so you wanted to create a pool like you launched a new token I'm pairing it with eth and I'm going to take this off the shelf hook um I can create a pool using it um I but because this is a dynamic fee hook I check to make sure that I've set it up correctly so before the pool gets created we check to see that the dynamic fee value was set correctly otherwise it will revert and kind of prevent you from shooting yourself in the foot um the before soft here is super simple it's literally from my slides um but we can kind of go into some of uh the logic so to read the fee um you can go into assembly and read the gas price and then if gas price is you know 10% above the moving average then we'll return a fee that's cheaper if gas price has 10% less than the moving average then we'll uh double the fee and so this value like I said gets returned to uh the pool manager contract which then is used to apply to the swappers um there's some logic here that I can glaze over but this is kind of how we update the moving average and it's like super flexible in the sense that like you know if you wanted to make a dynamic fee from a chain link price you totally could um you can do a lot of cool arbitrary things anything that you do in solidity you could do to set your fee um I will I will touch in after swap here so this is a function that gets called after the swap happens and in our case we're just going to update uh the moving average such that on every swap it's like the calculation is is live um I'll go into testing here very briefly I think testing is super important for at least our bounties um our bounties are less uh concerned about like front ends and and presentation and they're more uh we we like to consider like working code and so I'll kind of just quickly go into what testing a hook looks like uh so there's like some setup code here where you kind of deploy V4 um this is where you're like deploying your hook here um to a specific address we have cheat codes to set the gas price because you know we're trying to test that the fee was applied so we based on uh gas price we're creating the pool we add liquidity here um and so in our tests here we're testing the base case where you know the current gas price is 10 and then you can see that we're executing a swap here and like sort of uh checking checking the balances um then we decrease the price PR we run a swap and essentially if we uh run this it might be hard to see um it's a little hard to see but you can see like the base fee output is an output and then whenever uh gas goes up or no whenever gas goes down you're seeing a higher fee being charged so the output amount is less um and so this is kind of like the stuff that we like to like to see for submissions and go back to here you can find our docs they're they're new but it's available at not ready yet. unisoft foundation.
org and uh I'm on telegram on Twitter you guys can reach me at SAU point and I can open up the floor to any questions the CH are these custom um yeah this was hardx code U but I think I think the cheat codes in Foundry let you adjust gas price they can change you can change a lot with the cheat codes like block number too like so if you wanted to do a decaying fee right you can update your block number um or maybe even block Tim stamp too um oh it is I it should be um yeah uh let's see it was under I think it was gas price hook yeah if you wanted to do um yeah it's under gas price hook did he take this from template let's see he didn't um I have a starter repo called V4 template under unisa Foundation this is also a great resource for creating a hook it sets up all your dependencies gives you uh a base contract to a base hook to work with um also sets up tests for you to also just get quickly started yeah so yeah yeah yeah hooks are invoked or invoked atomically so what happens is it's like the user is it uh sending a swap so it touches a swap router swap router then calls p manager and then pool manager will then call your hook and it all happens within one transaction of a swap yeah there are multiple tools contct guarantee that get so what if I have AOL inside hook but nobody uses myol and they swap what um in that case like your hook yeah um if the order or if the swap doesn't go through your pool then your hook doesn't get called um essentially uh yeah it's kind of like a routing problem right and in the sense that like if you're a hook developer and you deploy a pool it's like you're not guaranteed to have volume go through it um it kind of is a function of liquidity and how like accurate or like how good you're quoting the assets so who decides the UI uh it'll be the the UI deciding um um you can run a Unis swap X filler in production to point to your pool and we're going to be doing work around that so that hook developers can uh receive order flow yes yeah I won't I'll try not to go into it but yeah yeah um I think it only works on exact input swap because you need to take the input amount yeah no so have a question a hook like for example could you have like a hook that it checks really yeah yeah there's yeah um essentially this is like the the dumbest hook in the world it it counts how many times this function got called um but instead of this you could do like any sort of solidity here and there's uh there's gter functions which would let you read the liquidity of a pool um you could read like the fee volume of a pool um what else I mean I guess that's like kind of like the two two major things of of a pool is it's liquidity and its fees one more question if if I go the pool want to do a swap and then I want to withdraw liquidity from the same pool will that allow me um you can yeah so like in before swap you could be a bad actor and you could like front run run somebody um after like the way limit order Works in V4 is you are a one tick wide position and if the swap crosses your position your assets flip from token zero to token one and then inside after swap it's closing that position it's like withdrawing it um you could do things like in before swap where if you see a large Swap come in you could like concentrate a crap ton of liquidity around the spot price it makes quoting and stuff like very difficult um and we're still doing a lot of research on like what that looks like in production but it's possible to do yeah from yeah yeah um can you make it like a Time base where you add liquidity and you remove the liquidity meaning that in the modifier that you call before Swap and after swap has a time between those or you need to call a keeper uh you could do it before Swap and after swap um so before every swap like let's say this hook contract owned tokens or whatever before every swap you could add like a tiny tiny little bit of liquidity every swap you can kind of yeah treat before Swap and after swap as like you you could plug in like a keeper job like there's one thing that you could do where like after swap if the price moved substantially and you're like deposited in compound or something like that like you're a lender on compound and you're like oh shoot like the price is moving like super fast and I'm scared of like compound AC creu bad debt you could have a hook like withdraw your deposit from compound like it's entirely arbitrary so there's a bunch of cool things that you could do yeah I think you had a question yeah yeah um so approvals You' approve on the swap router like in V2 and V3 yeah uh yeah yeah yeah you could Flash up um and sort of borrow money and you know move the prices and stuff so yeah yeah yeah the Delta stuff is hard to explain super quickly but essentially it's part of this thing called like custom accounting and what it does is it lets the hook essentially take a portion of the liquidity so like after you remove liquidity um the hook could take some of the principal Capital um it could also take some of the fees and like some of the things that we're thinking about is like uh if you have a just in time position you can sort of punish these jit people by taking their fees and so you could do that in after remove liquidity using that like Delta flag essentially where the hook said like I took x amount of tokens and what that means is the hook needs to return this value to signal to the pool manager saying like hey I I took this amount cont corre correct uh the hook the hook doesn't have to take the the balance it could take it to a treasury it could take it to an EA um the bookkeeping is held by the pool manager saying like hey this hook did something it it took money and the pool manager doesn't care where it took the money to right this Delta is uh yes that's a good way of yeah yeah were there any other questions you guys are got some good questions I was like the the slides were a little too basic huh um can I ask M sorry yeah it's okay it's okay yeah what's the difference between this and [Laughter] pancakes it's about science right yeah I'm not too familiar with pancake swaps implementation I know it's I will say that it's slightly different um the hook interfaces are suspiciously similar uh but that's that's all I could really say about it I think well cool I think thank you guys for coming to my talk um I'm in the main Auditorium [Applause] so e e yeah awesome cool awesome uh we'll get people another minute just to roll on in and then get started awesome cool well thank you guys all for coming I know you most of you have traveled a pretty long way to be here so super excited to see what gets built in the next couple days uh at a high level this Workshop we'll be going through what is layer zero how can you get started building on it what is the full stack of things that you can create using the tech and uh going through a little bit more in detail some code to get you guys started so without further Ado my name is Matt I'm a developer ecosystem lead on our devell team at layer zero Labs you can follow me at crackable on Twitter uh feel free to ping me at any point during the weekend if you guys have any issues that you run into or need support I'll be online for most of it um I always start off these presentations with the physical world representation of a bridge because I think it's important um most of us have seen a bridge but we probably don't think that deeply about you know what is a bridge doing at a high level um obviously it's connecting groups of people on different places right but more than just the people that's being connected it's the information that they hold um having a bridge at least in historical times was incredibly valuable because it meant that you could then coordinate the transfer of goods and services and with the transfer of goods and services came the financialization of those services so bridges in general are very very useful for moving information and value uh with cross chain it's no different uh if we look at the blockchain industry today developers and users are constantly facing trade-offs depending on what chain you want to go to whether it's an L1 or an L2 depending about the finality on that chain and the time time it takes for a transaction to be included in a block the cost of the block space itself each of these things make you as a developer face uh different realities about what you can and cannot build on each blockchain uh at a high level if we talk about maybe the most common use case for blockchains today the movement of value right this is a simple erc20 contract on Linea uh at a high level when we think about moving assets right from point A to point B we like to think of it as an actual movement but really all we're doing is updating The Ledger State we're saying I want to deduct a amount of balance from one user and then credit that balance to a destination but as soon as you move to a cross chain environment that immediately becomes a lot more complicated each of these chains are isolated they don't have any context about the other network and so as a developer we need to think about a way for us to call some sort of transfer function know that the assets in question have been debited for sure and then somehow relay that message over to the destination Network and instruct it to call some function that receives those tokens for the intended user so this is the domain space that we're working with especially when it comes to Value transfer uh but if you're just working on that kind of value transfer level you need to also ensure that this cannot be abused right if we just allow anyone to make that receive call without good confirmation that this is a valid function call from a source blockchain you can easily wreck the network and wreck the protocol uh in general the way that we solve this over time was with a concept of Monolithic Bridge security you can think about this in the center here as some centralized provider that's listening to events on a source chain and writing them directly on the destination you could think about this as a collection of different verifiers you could think about this as a middle chain where the central verification schema is just a middle Chain Bridge uh but in general there would be some entity in the middle that you relied on and you uh basically put all of your trust in toensure that they were going to be able to verify and deliver the messages on your behalf but again we have this problem here where if that is such an easy solution to the Cross chain space why are sofu people building on more than one chain right now this is from the Electric Capital developer report and these numbers have been going up more and more people are becoming familiar with cross chain development but the major problem I think right now is that we don't often think about what happens when these security guarantees fail or backfire as soon as your security goes down not only are you the single application at risk but every application on that network is simultaneously at risk that uses the protocol in the middle this could be due to a number of things whether it's just a Flatout centralized service moving messages between chains this could be due to the client software used to secure each of the validators that sign off on a message if that client software has a back door or it could just be due flat out to a lack of node diversity which is how the axi infinity Bridge hack happened so in general the main problem is that once a messaging protocol fails for Bridges every application that touches that messaging protocol fails as well and this has been a stark reality that we've seen in the last probably decade for blockchain development where uh the majority of hacks and exploits we see that have the largest value attack are due to this centralized or monolithic Bridge security so in the way I like to frame it is if you think of ethereum as a dark Forest cross chain is a dark ocean you have each of these islands that don't know about each other and the only way for you to get Knowledge from one chain to another is to rely on some actor to control that message and pass it through to the destination and if a malicious actor controls the port of entry for that Island the island itself faces an existential threat simultaneously if a centralized entity accidentally destroys the port via some upgrade to the contract or the interface itself uh the island also faces an existential threat from not being able to get reliable information to the chain so the way that we see layer zero is addressing these two issues the one of if the protocol fails every application fails and two the destruction of the actual interface that developers use because of the upgradeability of the contract interface layer zero is a permissionless protocol meaning that layer zero the uh entity that owns the endpoint contracts cannot block or whitelist or Blacklist anyone from using the contracts thems the endpoint interface is fully immutable and permissionless for anyone to use and furthermore it's censorship resistant in that once a message is emitted from a source blockchain a arbitrary user or arbitrary actor can't strike that message down uh without uh invalidating the protocol guarantees and finally as I mentioned before it's immutable this people go over quite a bit but I think it's more beneficial to probably see it in code um from the protocol stack for just majority of message passing on Bridges uh the way that message passing works is that there is at a low level an omni chain messaging layer the way that this layer works is that it is focused mainly on the verification of messages from point A to point B this is that collection of different signers the testers the middle Chain Bridge whatever May layer zero allows the application to select the block confirmations you have to wait on a source chain the required verifiers in the stack the optional verifiers as part of that stack and the threshold needed for a message to be considered verified we'll dive in a little bit more into what that actually looks like um on top of this low-level layer for verification we need a way to actually route function calls so this Omni chain function call layer operates on top of the message verifications and allows the app owner to control the amount of gas limit message value order of execution and the executor to use for each call uh we have two different call methods that you can use the LZ receive execution which is just part of the I layer zero receiver interface this is for receiving any message packets on a destination chain and I layer zero composer we'll dive in a little bit deeper too into that as well um and finally the most important bit for the application developer what you guys will be hacking on uh this app standard layer so applications on top of these two other parts of the stack will essentially use these different functions to enable different use cases within different evm environments uh we have an oap contract standard that lets you move arbitrary btes between point a and point B we have an of omni chain fungible token standard for moving erc20 token balances and an on nft standard which lets you move nft transfers between chains uh at a high level this is the send workflow an application whenever they want to use layer zero will create a call on the layer zero endpoint called endpoint do send this call allows you to specify a message in bytes that you want to deliver to the destination chain you will specify the destination chain identifier as an endpoint ID and you will provide a send configuration of what offchain stack you want to use to deliver that message on your behalf for you uh as part of that configuration you can decide the amount of block confirmations that must be waited on the source chain before this offchain stack gets started and you can assign the job to specific verifiers and an executor of your choice uh today layer zero has 30 plus different verifiers to choose from and as part of the security guarantee you're able to choose the required number of verifiers so in this case let's say we ping four different decentralized verifier networks about this message in particular three out of four of them have to sign off on the message's integrity and this is enforced by the application from what they set on the destination chain again it matches your send config so in the send workflow we say wait this many confirmations the receive config enforces it it also enforces the expected dvns that are meant to sign off on the message and that threshold for security once the message has been verified you can simply have an Executor whether that's a user calling the Point directly or a automated executor that layer zero runs uh automatically deliver the message on their behalf with uh an automated gas abstraction for them so this is a high level at the workflow you initiate a send transaction it emits to some offchain entities based on your configuration your receiving app enforces that it matches the configuration you expect and then finally you execute that message through to the destination chain so this kind of builds into us what we think of as this om the chain application the idea that any smart contract on any chain just has to interact with a single layer zero endpoint that is already deployed on that Network and can be routed to any other blockchain network within the stack furthermore we are able to configure things a little bit more deeply each application has a concept of this bytes message right so in general if you're used to ABI encoding byes on solidity the way that it works you just ABI encode any data type that you want to deliver to the destination chain from there when you have the receiving call being made to the destination app you will decode that message and extract the bytes inputs with Abid code um for the of standard there's a message codec Library called message codec do soul that I recommend you guys look into uh it'll give you a bit more advanced usage for how to splice bites out if you're interested uh and finally within the app there's a final little piece of application layer security each application sets a peer address for that pathway so you can see here on the send side we select this destination endpoint that we want to deliver to and what this security this peer is doing is I'm saying within my application from this endpoint ID I want to ensure that this is the address that's sending the message so it enforces once again that you have the verifiers that are checking the Integrity of the actual message itself and you know that the origin is coming from the place you expect to prevent any invariance um again same thing works on the send side we check the pier and we just say get Pier or revert for that destination to ensure that you have configured a correct Pier on both chains uh going a little bit deeper into the Tex stack the way that the layer zero endpoint actually works is that it's an immutable smart contract interface and what I mean is layer zero once this endpoint is deployed cannot arbitrarily change configurations to rug your application the way that your application interacts with the endpoint is that you will use it for both the send and receiving function calls but you'll also use it to set your configuration once an app has set a selection of decentralized verifier networks by an array of their addresses and set the executor by its address there's nothing layer zero can do from R end to change it so entirely permissionless and entirely owned by the application uh underneath the endpoint we have a secondary contract called a message Library you might be wondering why is layer Z V2 if I haven't heard of layer Z V1 uh layer Z V1 without getting too into it was a separate collection of smart contracts that enabled you to instead choose an Oracle and a relayer when we decided to create endpoint V2 we thought well we want to bring some of the benefits of this configurable security stack and separate execution logic to the existing apps that were already built and so we added these appendable smart contracts these message libraries what this allowed you to do is is as a application you could call this function and change which Library I was using for my application and abled you to upgrade from this Oracle relayer setup to a slection of security from these different dvn providers and executor and so it was a guarantee for developers that they still had an upgrade path to the latest and grest security without using upgradeable contracts just appendable configurations that the application owner set nothing forces a user to use this configuration once it's set it is purely optional and something that they are able to configure uh at their choice uh going a little bit deeper we have this idea of dvns right what are dvns well in general when we talk about dvns it can technically be anything uh most bridges have some method for essentially listening to The Source chain learning about the state and writing that state to the destination and so as an application this provides you a way to not only future prooof your app by if a latest and greatest verification schema comes out that moves messages cheaper faster and more securely you can add it to your security stack but it means that you as the app owner aren't forced to accept a one-size fits-all model for security for cross-chain messaging you're able to easily configure any number and type of verification within your app and be able to ensure that if something better comes out that beats all of them on price your application isn't stuck and forced to redeploy content contracts or completely change the infrastructure underneath uh so with all that in mind taking a more kind of Ste back approach to token transfers the way that layer zero does it is pretty straightforward you'll deploy an of contract on each chain you want to connect in this case Linea and ethereum and when a user interacts with that of contract all it's doing is calling a debit method which interacts with the underlying erc20 token interface to burn those tokens on a source chain route that message from the layer zero endpoint given the oft's unique security stock that they've configured and then once it's executed credit those tokens to a destination address for the amount listed um and what that means is going back to our previous example if one of these verifier networks outright fails your application at worst is simply paused until you reconfigure a new security network and your threshold or at best is completely uninterrupted right if this is a two out of three security setup your application has not been halted all and it gives you a future proof path to avoid any issues at the verification layer which is ultimately the most important um outside of that layer zero lets you configure a lot of other settings that we talked about for example the block confirmations the message execution for whether it's automatic where a user only pays in a Source Gas token and it will automatically be swapped for the destination native gas that you need or if a user wants to make that call manually they can do that as well uh keeper on those execution gas settings we have specifically the amount of gas limit and message value for the receive call uh a composable call which I'll dive into in the code example and strict non ordering if you want to enforce that messages have to be delivered in a specific order um I recommend checking out the docs or coming to the booth afterward if you want a deeper dive into kind of what these configure options mean uh but finally I think the thing we care about mainly is what this all builds up to the Omni chain text stack for us is a way for any application use case whether it's defi social fi gaming Oracle feeds identity to be built in a way where they can control the not only type of security that they're using the type of execution logic that they hold and ensure that they're interacting with a common interface across every single chain you don't have to learn a completely new uh chain interface or application interface to unlock new security instead you can have a simple a mutable interface that you've always used for your application and easily configure new types of security within your existing apps so uh I'm going to jump past these really quick so I'm short on time if you want to scan this QR code it'll be the repo that I start going through in the next like one to two minutes the last 10 minutes of this talk we'll just be going through an example design pattern repo to kind of show you what is the design space that layer zero has and uh hopefully the demo code doesn't break but we should be good to go awesome so uh switching over here let's just take a look at this repo um before I dive in let me show you how you guys will actually get started building on layer zero if you want to use our CLI tool which I highly recommend the way you'll start is you'll run npx create lzo app at latest this will ask you a couple questions first what do you want to call your project um I'm going to call this new LZ O app and it'll have you choose a section between an of template or an O template uh in this case I will choose of it'll also ask for what package manager I'm going to use yarn because I like yarn and then install some dependencies um for me it's going to complain about node because I forgot to switch it so make sure you're using node version 18 and if you run into any issues like that all you need to do is CD into the application run yarn and it will pull down all the dependencies that you need um fortunately though I have another package that I've already set up so we don't have to realize uh that and one of the things that I think is most helpful about this you know repo setup is that inside it's a hybrid repo that contains both hard hat and Foundry so you can use common hard hat tasks that you're familiar with you can do common Foundry testing and I'm going to go through three contracts um first at a high level how do I deploy my of this is a strictly vanilla of the only change I've made is I've added this mint function to Mint 100 tokens of the message sender um within this repo what's really cool is we kind of expected you guys to start doing a lot of these deployments out of the box so you can run it's still going to complain about node which I'm going to cancel I'm just going to switch here to make sure we're set um perfect so I'll run LZ deploy what it'll do is it will automatically compile uh your hard hat artifacts pull them in and it's going to read from your hard ha hat config in this case I've already set it up to include uh my sapoia endpoint my arbitrum sapoia endpoint this is just a handy package that comes standard with the repo to let you pull down what the endpoint identifiers are uh from here I'll hit oh don't want to hit enter there I want to hit enter in the terminal uh It'll ask what deploy scripts I want to use in this case I'm just going to use my my deploy scripts hit continue public rpcs will do their thing great I've just deployed two contract addresses on arbitrum seoa and one on seoa now once this is set I ideally want to be able to actually configure them to work together so um I'm going to use another handy configuration called npx hard hat LZ O app config init um with this I'm going to pass in the location that I want my configuration to be uh in this case I'll do it as example layer Z config.sys I'm working with and this will again ask me to select what networks I want to populate it for and it will generate this file in my working directory um it will pop out here in just a moment awesome so what does this actually give us um if we format this document we can see it sets up for us first an instance of the contract on each chain uh as an object itself arbitrum spolia spolia contract tells us the endpoint we're working with uh and then it will a automatically bring in the default configurations for this pathway um default configurations you can be thought of as like placeholders that layer zero has set for you to just to get tested and quickly started um these can be changed though with all of the addresses available in our docs if you go and look at the deployed contracts page um in this case the ones that we care about are how do we make sure we can send a message from arbitrum sapoia and then receive it on sapoia I'm actually going to comment this part out just so you can see so we have a send config and we have a receive config the way you can think about it is that in this top part of the repo for arbitrum sapoia tooa I'm just specifying a send configuration that Will Call some functions on arbitrum sapoia as the from contract uh it'll set what my required dvn is the block confirmations I need to wait and then similarly for the sapoia contract it will provide its receive configuration the important thing is that this receive configuration matches this send configuration right so from arbitrum toia we're sending from spolia to arbit spolia we're receiving awesome from there I can run npx LZ app wire pass in the OA config that I have provided uh example. layer z. config.sys and from there we can just see it go through and it'll provide me with a little preview of the transactions about to sign uh oh it's already wired because I've done this deployment once great um if you haven't done this deployment it will basically output and check what that looks like from your end but we are good to go uh in that case I'm just going to do a simple send transfer so I've included a simple task in this repo to send tokens you can see how this task works it just takes in an amount I want to s in this case one token to my destinia to this wallet address from this network arbitrum ofoia uh from here I can hit send uh public rpcs will do their thing we'll send one token to the network and then we'll get this send transaction initiated with a layer zero scan link so I'm going to open this up we can see here that once it's indexed on The Source chain it'll immediately populate in layer zero scan you can see the message is in Flight the cargo is one mock of from this address and you can see it went to the burn address here uh you can see which applications are in it what gas is being used on the destination chain and we can wait for this message to be delivered um I don't want to waste any time so while that's being delivered um let's see if we can jump back over here perfect um I have three other example contracts in this repo that aren't based FS these are some more advanced design patterns that you guys can Implement uh the first one is an ABA type call so this is for you to send a transaction that returns an acknowledgement back to the original sender um the way this contract works at a high level is that we basically will take in a couple parameters uh when we do this send function we'll take in the destination that we're sending to in this case a string message uh and some gas settings that I've specified I have the ability to add on top of some required gas settings some optional ones that I'm having the developer use so uh I would play around with this in the repo when you get a chance uh from there we initialize a send call it will emit message sent and then on the receive side decode that message check if the message type is this return acknowledgement and return a secondary send call back to the original sender which you can see here we're using this origin struct provided as part of the receive call here so returning back to the sender uh a message in this case a predefined one that I've said chain B says goodbye so I don't have this one deployed instead what I'm going to do is actually take advantage of The Foundry test helper that we've built uh we have a special test helper contract that you can use in your Foundry unit tests to kind of mock layer zero implementations Within Forge um in this case we want to do test ABA and we're going to crank the verbosity on this one it's going to compile hopefully pretty quick hello awesome oh yeah we on time okay isn't it 30 minutes five minutes oh five minutes gotcha awesome I'm going to try and speedrun this um but yeah you can see here if run the same command in this repo uh we can see for the ABA contract on chain B when we call this data field and let's just pull up that test so we can make sure that I'm not lying we can see here in test ABA that the assertion is basically checking for the chain B data that it says chain a says hello and we can see it's asserting for chain a sender that it says chain B says goodbye so we know that their messages were received on destination and acknowledged um I don't think I have time to go through the other two unfortunately but if you want please come by the booth I will show you myself one of them is batch sending so being able to in one send call uh essentially do a for Loop that sends to multiple different destination chains if you wanted to mass update data on other chains for one call and the other call or other contract that we have is a simple composed example that shows you basically how after I receive some tokens from my of transfer I could have a external function call here which executes after the receive logic but I think for now I'm just going to pause and open up the questions threw a lot at you guys thank you guys for the [Applause] patience cool any questions Let's uh speedrun them yeah is it propagated already the first test you did yes uh this which test this one the first message oh yeah let's take a look um yep delivered so we can go on destination check here uh and the way to check and make sure it's delivered you can check the decoded input data see that this is the source endpoint ID it came from what nons it is the message and then in the logs here we care about the actual value being transferred you can see a of received event emitted here with amount received uh yes so there's a way to transer native tokens you can see in this gas setting here uh within this call this L receive gas this is 65,000 way of the Native gas token on spolia so eth on sapoia uh we allow you for the executor to specify message value in gas in the native gas token up to a native gas cap so if you want to do large transfers of native gas you're going to need something else but this is how you would do it in the calls yeah any other questions or yep the difference so the O that's a good question um exactly yeah so if we look at the of contract if you go in the stack here and go into of core of core is an OA OA is just a standard contract interface that brings in all of the basic configuration logic and things you might need in your interface trying do cross yep exactly you could do it for erc20 tokens or if you had a different token standard you would just modify on top of a app yeah cool yes uh for oh to on destination chain there is a Max gas uh Max gas limit yes it's it varies per pathway but you can read it on chain yeah we can yes yeah cool can yes you can yeah um yeah and if you need more gas than what's provided by layer zero you can use Stargate which is a native bridge and just use their interface to get even more native gas assets via the bridge itself there's a there's a cap set by layer zero for the execution options I can explain it a little bit more too and then Stargate has no cap it's whatever you pay for you get yeah yeah cool yeah thanks guys e careful oops e e yeah anytime should we go okay here we go thanks for showing up I'm Austin Griffith uh I am supported by the EF I run a guild called build Guild and we're focused on developer education and onboarding um particularly the thing I'm going to be talking about today is how to build an app quickly we're add a hackathon this is the place where you want to sit down and and write an app quickly and not have to spend a lot of time so I'm going to show you how to do that uh here in uh an hour or so do we have one one hour is that what the do we have one hour okay here we go okay so uh scaffold e has a lot of the stuff out of the box and it's kind of the quickest time it's like a hello world for ethereum but then you can ship it to production it's like a hackathon stack that you can ship to production has all these components in it it's good for tinkering it's easier if I just get in and show you though so I'm going to go to scaffold eth Io if you just search for scaffold eth you'll find it and I'm just going to follow these commands let's see let's go bruss I'm going into bruss all right here we go we're GNA going to hopefully have decent internet oh man maybe I shouldn't oh I think we can do it I think we're going to do this live I have like a backup folder just in case but let's go for it all right and then we're going to do a yarn install and all of these commands are in the GitHub I'm kind of going the long route here really there's a really important moment and we're not there yet and I usually try to show that first but I want to start from zero just to show you like how this how this works from from scratch so all we've done so far is clone down the repo and then I'll CD into it and yarn install we just did there okay so it's probably really hard to see here but this will be a yarn chain and this is going to bring up a local blockchain uh it either uses hard hat or Foundry depending on which one you you select if you want that Choose Your Own Adventure you can use this command we have a whole extension system like a graph uh extension where you just do you know Dash e for the extension and then graph and then all of a sudden you have all the graph stuff uh but we're just going to use the vanilla scaffold leth here I've got my chain up then I'm going to yarn deploy and that's going to show that's going to throw a an example contract to our local chain and then all yarn start and that's going to create our front end so this is what it looks like when it spins up you'll see um probably around the venue uh a handful of scaffold eth variants which is really cool people have basically for this and made scaffold op scaffold AA scaffold nilon I saw scaffold graph there's just a lot of these out there so keep an eye out for these but the the basic starter kit is this sort of like you've got your wallet up here you can go to the faucet uh you can write a front end here and we'll do that in a second but the core piece is this right here you've got this contract debugger so this is like an automatic front end for your smart contract and this is like the most the most powerful first piece definitely like once you get out here and it's time to hack there's going to be this moment where you like need to Tinker with your contracts and get the solidity right and kind of figure out how you want it to work and that that's what we'll do here in this first little session so let's see uh in the code you'll have two packages kind of your back end either hard hat or Foundry and I say backhand pretty Loosely right that's your your blockchain and orchestration and the nextjs is your front end uh your app let's get into the example contract so scaffold e starts with this uh example contract that has a bunch of stuff in it but it tries to just like the scaffolding around a building right if you if you need to work on a building you're going to build a bunch of scaffolding around it do the work you need and then kind of tear down the scaffolding you'll probably tear most of this stuff out but it's just good to have in your contract because it kind of shows you an example of how each one of these things work for instance primitive data types events uh the Constructor a modifier it looks like we have a function here to set the greeting and there's some interesting logic in this smart contract that we'll dink around with and it looks like if there's money that gets sent into it there's like a withdraw function that maybe only an owner could call to pull the money out uh but this this what I want to show here is this interface where you have this contract debugger on the right and then you have uh your smart contract over here that you Tinker around with right and if I didn't have such a tiny screen you can imagine that you can have these two things like side by side and that's a way better experience I'm going to be like flipping back and forth between the two things but let's say we create uh an address public Alice and we just leave it blank and I just hit save right hey it wanted to do Bob okay let's do that too yeah let's bring Bob into this mix is it gonna what's it going to do I kind of like maybe the AI could just write my smart contract for me and we could no okay it's just going to do those two that's pretty cool though all right here we go let's deploy this now what we're going to see is we're going to see Alice and Bob pop up over here there we go so we have these new addresses now that we can see in the front end and let's even maybe like set up uh like a function that uh yeah set Alice that's what I want to do let's go and normally I would probably add like an only owner modifier on here or something but we're just kind of like doing out this code real quick just to show you as an example once you get out there and you're writing your smart contract you'll be taking this much more seriously scaffold be uh does all the cool stuff around it but this this moment is a little silly for me because I'm just like making a fake smart contract but you'll be able to focus on the logic of your app right at this moment so don't take it too seriously but don't take it too silly too it's very powerful so we have this Alice and Bob and we have this new function now called set Alice and if we we wanted to set Alice to vitalic doe for some reason I don't know why we would do that look how nice that is though right you get that ens preview you get the uh ens Avatar you get the blocky and then when I hit send here I've I've already used my wallet I've created a burner wallet and I funded it so watch this when I hit send I just made a transaction on my Smart contract without a metamask pop up without it asking me to switch chain IDs and all that stuff this is really nice and we can see that Alice is updated to vitalic right so we're able to Tinker around with our smart contract right let's say let's say we wanted to count uh every time someone Whoa We want to count every time someone updates uh let's just call it the Alice counter man this thing is good it is like maybe it's like hearing me this it like knows what I want to do here this is and like I've never written this contract before either okay so here we go so now there's an ALICE counter for some reason and if I set to at.
eth and hit send uh we see that Alis counter increment right and if I click it a few more times we see that counter increment so this this is the important moment where you're sitting down and you're writing your smart contract and this is probably the hardest part of everything it's like how does this solidity work how do I make the contract do what I want it to do what things do I store in the contract what things do I store offchain what network am I even going to use and all of that stuff you'll spend a lot of time here where you're just kind of like trying things and by the way solidity by example is really good I like to tell people to have solidity by example when we were talking about having those two tabs I like to have even solidity by by example at a third tab where I can be like okay so maybe I want to like bring in a mapping or I want to learn what mappings are right I can read this and I should but I can also like Drop That mapping in here and and just go see what it does so we just created something called my map and it Maps some address to some number it looks like and let's just go Tinker with that and see what it does so sure enough we have this new read function called my map and if I ask for any particular person's value it's zero right so let's take my address actually and let's give myself let's give that character some and let's let's not call it my map that's kind of lame let's call it balances it's balances right it's a balance it's a for an address it's a number right it could be a counter or something and then on the deploy let's set balances whoa balances of that address to a th right and maybe we should do ether right let's do 100 ether instead of doing a 100 because that would be 100 way right and you guys all know that already because you're solidity developers and you're about to crush a hackathon you don't need to me to tell you the difference between between eth and we okay but let's see what we have here so uh wait what did I just add okay he should have deployed he should have value right let's check the balance of atg e and hopefully it is a th e right okay and then let's maybe even make like so we're dinking around with a mapping we realize we're saving balances we're like oh wow we've almost made ourselves our own token let's let's like finish it off let's make a token so let's have like a send function or a transfer function right and that transfer function is going to do what it's going to take in a two address and some amount it's going to require that you have that amount it's going to subtract it from you and add it to the other guy uh if if you're deep into solidity you know that we don't even actually need that because at eight you don't uh you have overflow protection basically and it this won't work but this require statement while it costs a lot of money it's nice to have that extra little feedback that says in insufficient balance probably not something you would put on mainnet ethereum but maybe if you were on an L2 it might be worth that that extra error okay so uh We've set it up so I have a balance of 100 eth at the start and then I can transfer if I want so let's try that so now I'm going to connect my metamask address this is going to be a little weirder because we'll get the popups and all of that stuff uh okay but let's do that okay so now I'm connected and it'll force me over to switch the network so anytime you're building an app your users are going to come in with a wallet that's not on the right Network right and so this is really nice because scaffold e just forces your users to the right Network it it C it forces this network switch and it has all of this stuff built in it's got a fosset so I can click here and and get uh some money and then let's go ahead and transfer right let's send vitalic some so to vitalic we're sending 69 of these things now if I hit send right now it's going to send 69 way you have to hit this little button over here and this is like a developer interface this is ugly and clunky and I get that but it's doing that on purpose it's forcing you to have to hit this button to take it to away before you hit that button and as a developer you need to know that but once we get in and start writing the front end we'll do it automatically in the front end so we won't have to do that math every time you're just doing that as a developer so you learn okay so let's see let's check vitalex balance now there we go so he's got 69 eth of this magic token that we made up that's actually just a mapping of balances and a transfer function right okay so let's see what kind of a smart contract are we really going to write I want I probably want to do something where looks like there's already an owner here what do I want to do I want to do something where maybe someone has to like input an address and save it let's see there's an is owner here I think I want to do like a set owner or like a force owner or something like that yeah let's just make this contract ruggable that sounds fun all right ruggable contract here we go so you can definitely send money into this contract because it has this receive function okay so I'm going to build a like a trapo function here trapdoor and what it's going to do is it's going to set the and it's we're going to let anybody call it address to oh self-destruct to I haven't seen that in a long time all right damn okay what we don't want to self-destruct what we want to do is like send the whole balance right and if you uh I always do this for sending ether I always just go to solidity by example and search for sending ether because it the line is really yeah right here because you'll know that if you use dot transfer or dot send those don't work very well with smart contract wallets so what we need to do is this dog right here let's copy this all right so someone hits the trapo function no I don't want to send out all the money we already have a withdraw function see this is the point you're kind of tinkering you're trying things you're thinking through exactly what your want smart contract should be what I want to do is set the owner to this guy yeah something like that let's just say rug and it sets the the owner to that it's not letting me do that because ah the owner is immutable okay we got to make it mutable let's do that are we happy all right let's deploy it see if it works and then we're ready to go to the next phase so let's say that you've spent the whole night tonight out here at the hackathon and you've been tinkering for a long time with your smart contract and you've got this part down like basically using the debug you can make sure that if you wanted to you could rug the contract to vitalic or something like that let's make sure that works and then we hit rug and we confirm and vitalic the owner of the contract and could now take the money out okay so our rug function works I guess if you want to call that working it it does the the silly thing we want it to do basically taking over the contract with anyone we send it to definitely don't want to put this thing on any like main net Network because it just is a bad idea you don't want any of this stuff here okay and then like oh beginning owner we want to figure that out too let me delete the rest of this stuff though let's clean this contract up just so if I do put it on a network yeah no greeting there's a withdraw function so like yeah so people can send money to the contract the owner is set at start and then anyone can change the owner I kind of don't like that it's a little weird what if like only I can rug it or something how about we do that just just so I could put this out on a public network because I kind of want to do that so let's require at least that the message. sender is is me and we'll say not Austin for the for the error okay so I'm making a very very ruggable weird contract uh but again Pretend This is you coming up with the logic for your hackathon project not making some weird ruggable thing uh withdraw is oh oh yeah okay I'm not going to use even that modifier I'm just going to require the message. sender equals owner all right are we happy can we please just move move on yes no oh oh oh uh in our deploy script it's sending in a deployer for that address is that oh oh oh no it's this thing sorry get rid of this stuff so in our deploy script it's like going to check that greeting that we had we had a greeting there let's see if that fixes it okay finally okay so let's pretend like we have our smart contract it's ready to go we basically uh have this contract contract that you can send money to right let's send one eth into it okay so now the contract is holding you know $3,000 and then we want to rug for some reason to vitalic e and we hit send there and that should make see that's metamask takes forever to come up that's why I like those burner wallets but we're in metamask land for now and and then we make vitalic the owner for some reason and then met alic could get in here and hit this withdraw button uh but I can't because I'm not the owner okay you will make a more intricate and cool smart contract but my contract is silly it just is an example contract let's say you've gotten this far you could technically just like put this out right we could deploy this and someone could get in here and kind of use this interface but probably what you're going to want to do is build your own front end so let's spend a little time there and build a little front end that let's uh someone come in here and rug the contract okay so our front end now if we move over into front end land uh we'll use nextjs and if I get into the app page here it is this is uh this is this page right and it kind of shows welcome to scaffold e 2 and it shows who the connected user is and then I think I want to delete everything else and we'll put some nice uh UI in here here in a little bit but let me just kind of clean stuff up here let's see are we happy oh that looks nice okay and I'm gonna say welcome to the rug store yeah yeah all right cool cool cool cool and then maybe let's see what do we want to do I I kind of want to well I don't want to spend a ton of time making UI what I want to do is just show so first of all this connected address is kind of interesting uh if I go here right now it's using an address component let's let's get rid of that for a second and just show what this would look like without that component okay so we're using wagi to get the connected address and we're displaying it here and let me save that so here's what it looks like right very ugly giant string of uh hex what you what you want to do is pass that into an address component and that address component comes out of the box with scaffold eth along with a handful of other components that are like Bare Essentials and then if there's like a weird component you want like a swap component or an nft Marketplace you'll have to look to like the extension system because not everybody wants that in their base code so we have a very clean base here and then you can grab uh other components from the extension system uh but the key ones you're always going to use addresses and you you'll notice if I click this this is going to take me to whatever block Explorer I'm on right so this is just a local block Explorer but as soon as we deploy this thing to a public network and then I then all of my address addresses throughout my whole app will now link to that public networks's block Explorer and we'll get to that in a second but let's make a little UI let's make a rug UI so let's see we want to know we want to know the owner let's display the owner and then let's set up an input form that lets anyone change the owner right so that's going to have us we're going to read from the smart contract we're going to keep track of some State and then we're going to write to this some smart contract to the smart contract it's funny because sometimes you'll spend more time here than you do over in the solidity and that's tough because the solidity is obviously the hard part but react ises still a lot of work so uh let's let's just make uh a read function first so I'm going to do use scaffold contract you use scaffold read contract and that takes in I think your contract like this maybe it doesn't it's been a while since I built on this you scaffold read contract what does it take oh oh it takes okay okay okay so I think maybe I do this and I do contract name yeah here we go the rug store is that really my contract I don't think it is it should autoc complete let's see let me get this set up there we go now this should there we go contract name equals and I don't want to use I want there we go that's the important part so right there it's saying I've already looked at your contracts I know the name of your contract I'm going to help you autofill it in there so you know you've got it right right and then I'm going to hit control space again and I'm going to get function name and then there we go that's the only function name on the smart contract but if we had a bunch of function names it they would show up here and this is really nice because you're like in here in the react right in your front end but it already knows about everything about your smart contract and it's helping you kind of guide you how to put these things in okay and then yeah what's up do you have the contracts under the contract directory in the uh the contracts uh from the it's coming from the hard hat and every time you compile from hard hat it injects them into the nextjs in this folder called contracts but if you have external contracts you can plug them in too so like if you wanted to Fork main net and then talk to die you could do something like that does that make sense so it's it's both your local contracts and whatever contracts you want to Define in this uh external contracts together cool cool okay so uh then I got some data and we're going to call that the owner okay that was a lot of work just to read the owner from our smart contract but now we have it and let's kind of copy this code here and put this in here and put owner all right let's see how are we looking yeah there we go okay so we know that I'm connected as me and the owner is vitalic and we're able to read that from the smart contract so then we want to give them uh some more UI to update the owner so we'll say update owner here and then I'm going to have an address input component okay and then let's see if I go down here and hit control space there we go so we want um do I want a placeholder do I want a name do I want a value what do I want I definitely let's see we have a value and it will be some local state variable right we'll say new address or something like that and then we'll have an on change that maybe sets the new address I think this is just V and V let's see what happens there anything else okay so those elements aren't tracked in my state yet but hopefully chat GPT figures that out and just gives me this line it did thank you chat GPT oh and we don't have used state so we need need to import that all right now we should actually have there we go so we have an input field and if I type something into it it gives me all that nice stuff that we saw before so this is another one of those components that comes out of the box with scaffold eth that helps you build your app quickly and have it look look pretty good so we're tracking it we we have this new address now in our state so now what we need is like a button right and we want to be able to hit the button and save it right we want to send it wow even gave me a little icon gez okay let's see why is it not happy with that oh oh oh slash button at the end right we need one of these okay so now we've got let's see yeah we've got a button that lets us update the owner and has a bug okay cool I don't know why we have a little bug icon next to it okay maybe we should actually say rug owner I kind of like that more okay and then what happens when we push this button right so we've done this we've used this hook to read from our smart contract let's set up another hook to write to our smart contract and it's going to be very similar uh naming scheme something will come back from use scaffold I want to make sure I get this right use scaffold write contract and in this case you just put in the contract name that's that's why I was confused earlier and then what comes back is this like async function I think yeah write contract async and we'll call that write your contract okay then we bring that down to our button and right here we do write your contract do something I think uh oh maybe it's a function [Music] o o maybe it's a function that takes an object yep that's it so we'll do function name equals uh let's see does it know oh it knows look there's a function called rug that's great and it knows that from our smart contract so we will call the rug function with the r of new address uh is that looking good let's see if this works I give it like a 40% chance of working let's see what happens here so we would want to set this let's just set it to us right so vitalic is the current owner I want to hit update owner holy cow I think it's going to work dope okay so we made our rug store contract we've made a UI so that our users can yeah yes please can open open the which thing code so there's external contract thing yeah so how we can read this from read contract function how can read this yeah if you just put an external contract in here you'll have to Define what chain you want the contract on and then the Avi of the contract then it's going to show up oh man it's going to show up right here there's like a there'll be a tab system for all your different contracts as soon as you have multiple contracts and it'll show up like right here and you'll click it and then you'll get this thing for that is that what you mean from theom from the say that again from the oh oh okay so not external contract let's go from the button right here write or read the contct that function okay yeah yeah so you would uh you would do a yeah you would do a use scaffold you do do the same thing use scaffold contract read and your contract name would be whatever the name of the contract is in that external contracts folder and and by the way like all this stuff you can go to scaffold eth and docs or there's like a telegram Channel with like all the guys who create and maintain scaffold e are just like in that telegram Channel all the time so you drop in the telegram Channel ask that question and you'll get some good answers from some folks too yeah and I bet we could find like external contracts in here somewhere where's the search man we should definitely have a search there okay what whatever I'm gonna skip that for now we can come back to it but yeah as you want to talk to external contracts you would put them in that external contracts folder and then they would show up in that tab for debugging but also the Ed contract read and use contract rights okay here we go uh let's see so uh where is our app how far along are we uh we have this we have the front end built we have the smart contract built so now it's probably time to deploy right like uh it's really awesome when you can send the judges or give the judges like a live app like hey we've deployed our app live here so if we can get that far today that would be good we only have like 20 or 30 minutes left but we're almost done anyway so it'll be pretty easy uh again you spend a lot of time here you spend a lot of time writing your solidity and getting your smart contract solid and tinkering with it here and making sure it works and obviously you probably should write like some more sophisticated tests against your smart contract like I tested like two things and the contract literally is called rug so we know that it's like shitty and not like a very safe contract but your contract when you put it live needs to be very safe spend a lot of time testing it make sure it's good I'm glazing over that just to show the functionality here but I don't want to minimize the the idea of testing you want to test a lot but I'm not doing any here so we're going to now deploy this thing basically we're happy with the way the contract Works uh we're happy with the way the let's see what what happens if we redeploy this real quick who starts who's the deployer at start oh there's a little thing notice it didn't redeploy there sometimes you need to do a reset if you don't change anything about the contract you need to do a dash Das reset to force a redeploy Okay cool so the cont the connect oh that connected it so the contract deploys to a new address and there's an owner and anyone should be able to set the owner let's try setting it to the talic this time let's just make sure this works one last time and if we're happy we'll go to production with it okay yeah I think I think I'm happy here so obviously this would be way more complex you would do something really cool with your smart contract I'm leaving that up to you you guys are the the big brains here uh I'm just showing you how to work through this let's pretend like we have a dope ass smart contract and a beautiful front end now what are the next steps right we're still we're still on hard hat and we're still deploying to our local network what do we do to take this thing Pro or take this thing live so first we probably need to pick a network uh we kind of need to decide where we want to deploy this I will probably just deploy it to base this it's very irresponsible to be deploying a contract called the rug store that lets anyone rug it to a live Network don't do that in practice please but I'm going to do it here to pretend to show you how you could actually do this on on a live Network so uh I can't just Deploy on base with my so we've been deploying with this like faucet address basically this is the zero address on the hard hat chain so it's loaded up with a bunch of money and it's great for deploying locally but when we kill this chain and we don't use hard hat anymore uh we're going to need to create a deployer uh address right so I'm going to yarn generate and this is you just do this one time for each project you have an isolated burner wallet that's meant to deploy your smart contracts and then if I do a yarn uh account I should be able to get there we go okay now I'm going to fund that with just enough base to deploy one contract right I'm not copy pasting my private Keys into this folder and I'm not copying pasting those around right there's an isolated address here that I'm going to have just enough money in and I would have to work very hard to accidentally Commit This thing to GitHub and there's there's actually like better practices coming out Foundry lets you encrypt your deployer keys and we're getting to that soon uh this is this is kind of an old way of doing this but this is like the safest way to do it the old way uh as we as we transition to the new way so yeah let's just send some real money to this account and see what happens uh let me grab so I'm going to use a punk wallet built with scaffold e one uh I've got some money on base here let me scan this QR code I'm gonna send a dollar what do you guys think $5 just in case I don't want to have to send money more than once sometimes I've deployed contracts on base that cost like 10 sometimes I've deployed contracts on base that cost like $10 it kind of depends on what's going on with the blob space fee mechanism for l2s uh but we should be ready let's do a yarn deploy just like we were doing the normal deployment but now I'm going to do Dash Das Network base and if everything works right it should put our shitty rug contract out on base at a live address that anyone could go rug it okay there we go so our contract is on base but our front end is still pointed at hard hat so we need to go to our scaffold config and point it at base and hit save okay and that one change remember when I was talking about how addresses link to whatever Network we're on now when I click this it's going to take me to the base Explorer so all I had to do is change that one line right there and your app will work on any evm compatible network so yarn deploy D- Network any network you want and you deploy it and then you change it right in that scaffold config to whatever Network you want and your app is now pointed to it and let's see uh let's see how this looks I mean pretty good it looks like it's working so there's some owner that has deployed this contract that's probably my deployer account isn't it let me see that real quick quick what's my deployer account dbe yeah yeah okay so this is like that the the New Monic that's there in my deployer account they're the current owner and let's like send some money to this it's so dumb I'm gonna put a dollar in this ruggable contract and I don't know if it's going to get rugged or if we'll have the time to rug it ourselves but I want to load it up and have it there just in case let's see so copy this dude's address copying from MacBook yeah what a cool feature paste oh dog pasting from MacBook it's like waiting okay okay there we go all right I'm gonna send in five dollar five ruggable dollars any of you any of you can go get on Bas scan right now and rug this thing please don't uh I mean if someone's watching the network they should be able to see it but there we go so there is $5 in this contract and anyone in the world can put in any any of their addresses and then come back over here and hit withdraw and pull that money out it's kind of surprising that it's not already gone right okay so uh now let's put what the last little piece here is we need to put this app live so then you can give the judges your for sale or you can give this to your friends right so we've put the smart contract live but our app is still on Local Host so we have to do yarn this is my favorite command yarn versell uh basically deploys your app but we want to yarn vsel YOLO d-r I think is what what it is let's see if that works uh yeah I think it's working oh no oh no versel login I haven't done that on this machine yet this could be like very doxy let's see what happens oh oh maybe I need to yarn rousell login I have no idea yeah let's do it this was not part of the demo not not supposed to be part of the demo oh did it just work okay yes sure yes I don't know what's oh okay I think it's deploying okay so when that gets done you we will should have a live versel URL that points to our smart contract that's deployed to base and you could show that to the judges and I did that in like 40 minutes probably right so obviously you'll spend a lot more time writing your solidity you'll spend a lot more time writing that react and getting it look good but What You Won't Do Is spend a bunch of time getting the wallet stuff to work getting the network stuff to work getting your addresses to look nice like the there's all this stuff that comes out of the box I've done so many different hackathons for like the last five years and this is the kind of thing you need so you can focus on the logic of your app rather than all of the headache of setting up your stack and getting it running so let's go rug this contract probably right I mean that's probably I'd like to do it from the live URL but this might take a little bit longer and yeah go ahead yes please the the Y YOLO command what about it uh okay so yes yes so this stuff basically says don't look at any of the type safety stuff don't do type checks you what us should do at home is just yarn for sell I added because I don't want to I don't want it to complain about type safety and I don't want it to give me any errors I just want to like force it out so it works but it's safer if you just do yarn for sale yeah I should say that too all these like guard rails I'm putting on this like I'm doing all these dumb things with this really powerful tool I should really make sure to say those those guard rails as we go yeah any other questions I think we have time to talk through stuff if anybody has any yeah go ahead could you maybe talk a about the extension yes yes yes so let's see the scaffold e extension stuff is still like super lowkey but let's see um scaffold graph extension I think Kevin Jones is doing a uh demo of this soon uh also shoot okay there's another one I want to show off too uh where is it it's it's not like we're we're purposefully because we're still like changing some things we haven't put the docs live yet I don't think so we're it's it's still not quite ready for me to probably show it off uh but the way it works is you do MPX create eth let me see if I can just Google it it's that and you do Dash e and I think graph or something like that let's see if anything comes up no it it's coming very soon and there will be documentation right here you'll you'll land on seap E 2 and you'll type in what kind of an extension you want and it'll be like okay here's how you dash e and basically it's something like let me just try it just I don't think it'll work but let's find out I think it's Dash e graph yeah that would bring in the graph I don't know if this is going to work though so soon like within the next couple weeks so we're we're launching it internally right now and we're getting some people to build things it looks like that did something now I failed yep yeah okay so so it's invalid extension so I'll have to figure out what that is and we'll have to do better Discovery but seriously like two weeks come back to scaffold eat.io in two weeks and there will be something here about extensions and then that extension system hopefully will blossom into a shitload of things like so many little things like uh 712 smart contract or you know there there's a scaffold AA now but say you wanted to do some kind of account abstraction or something like that you don't want to build that into every single scaffold e but maybe you want it so that'll be why the extension system is so powerful so there scaffold AA there's one called scaffold op would which what would you use for this hackathon you could use the graph one yeah Kevin Kevin can show you that yeah I just don't don't know the actual do you know who Kevin Jones is here let me show him uh shutter block I think is his name crypto Mastery this guy he's here he he will be uh having a beer with me in like 10 minutes right out here if you want to find him uh wait he I bet he even shows this off somewhere hold on hold on let me see if I can find it I feel like we this is it's enough of a thing that I just want to answer this question but I don't know what the dang it he did the what do you needand yeah yeah yeah is it D it's Dash e something subg subgraph okay let's try it again so where was I uh I was whoa was that no that's something else d e sub all right let's do it let's do it so you'll go to scaffold eth you'll grab that oops I like how we're delaying the rugging of that $5 and it's just sitting in there in their contract okay okay you've already you tried to get to it nice you've already would have rugged it okay here we go scaffold e Dash e subgraph there we go that's G to do it cool and we'll have a lot more extensions soon yeah yeah for sure well so as we build this extension system we're also going to show people how to build their extensions too so we'll like there's like an old way of doing it and a new way of doing it and we're right in the middle and I only know about the old way so it's better for me to like not explain it like I no not I would say what you want to do is just wait for this extension system okay so for this haathon you should just carve things out and just like like just throw them in there for the next haathon keep an eye on our extension system and and that'll be the way to go has has anybody actually rugged me yet I feel like there's enough people in here that let's see what happens okay so uh yeah so I'm still the owner my deployer is still the owner here uh let's see so if you go to this address now and I think actually I need to like you said there's like a gate on it right now like only I'm allowed to go to it and I think what I need to do is like go to the settings and give everyone access let me see if I can find that I don't see it though right you can get to it okay okay so yeah you can get to this NE I I you guys can get to this are you sure yeah let me let me go on my phone real quick have you already rugged it I mean like no one has rugged it you put in like last oh did I put in a thing that says only I can do it oh never mind okay that makes it way less cool okay so right here yes okay well that's lame okay well here we go I'm going to go rug the thing that only I can rug that's way less cool but this is really neat like the judges could just go to this URL something that I've worked on for 40 minutes it's a live smart contract app that uses all the state-of-the-art technology they can connect their wallet and they can update their owner to atg doe and they could set that owner let's see if this works I'm going to actually pay money for this right but like a fraction of a scent and then once that transaction goes through like all my things are buzzing because transactions are happening and then I should be able to hit this withdraw button all right are you ready I have 4868 and if I hit withdraw hopefully I get my money back which only me can get the money back at like nation state level security well it's on base so a little bit less hard than mainnet ethereum but yeah that's kind of lame that I kind of set it to something didn't work though oh no it's gone it worked there we go the money's there okay so I was able to make a smart contract that only I could rug and then I can rug it way less cool what you want to do is make a massive multiplayer smart contract right your smart contract for should be massive multiplayer uh out of the box it should be more secure you probably want to write some tests for it you might want to spend some more time here making this look prettier you definitely don't want a function called rug you definitely don't want a function that says you have to be this person yeah all of that but hopefully this gives you an idea of how you can quickly get started building apps and you can just kind of fork this thing and start start building quickly and it all starts at that uh scaffold E2 page any last questions awesome thank you all for coming yeah [Applause]
Automatic transcript — names and jargon may be misspelled.