Scroll Workshop | Raza | Deploy in 5 Different Ways on Scroll | ETHDam 2023
CryptoCanal·Sat, Oct 7, 2023, 12:00 AM
Raza is in charge of Developer Relations at Scroll. https://twitter.com/razacodes Scroll https://scroll.io ETHDam is a Hackathon & Conference that gathered over 500 DeFi and Privacy builders on the 20th and 21st of May 2023 in Amsterdam. Privacy is normal. Following the arrest of Alex Pertsev, a Tornado Cash developer in the Netherlands, ETHDam 2023 is determined to counter the chilling effects of the lawsuit and bridge worlds to discuss the future of privacy and encourage to build on the shoulders of cypherpunk giants. ETHDam is powered by CryptoCanal, - a blockchain education and events platform growing in Amsterdam, spreading its roots to Rotterdam and Zurich. ETHDam 2024 is on the map already! Keep up with us to see updates: CryptoCanal https://www.cryptocanal.org/ CryptoCanal Twitter https://twitter.com/CryptoCanal Join CryptoCanal Community https://t.me/CryptoCanalCommunity We would like to thank our partners and sponsors that made this event possible. 🌷 Our BFF 1inch https://1inch.io/ Our Frens: Sismo https://www.sismo.io/ Aleph Zero https://alephzero.org/ Scroll https://scroll.io/ RAILGUN https://railgun.org/#/ And our Sisters: oasis.app https://oasis.app/#earn Maven11 https://www.maven11.com/ bitvavo https://bitvavo.com/en Lido https://lido.fi/ Spankchain https://spankchain.com/ API3 https://api3.org/ Gelato https://www.gelato.network/ VanEck https://www.vaneck.com/nl/en/crypto-etn Marlin Protocol https://www.marlin.org/ Silent Protocol https://www.silentprotocol.org/ Cyber Capital https://cyber.capital/ … and Proto https://twitter.com/protolambda 🍍
Transcript
foreign [Music] loves it except there's an issue with you know deploying on ethereum we know about gas prices and the scalability well you know with the rise of l2s in the past uh well I would say two years it's been evident that you know ethereum has there needs to be scaling solutions for ethereum um we all know about the blockchain does anyone here is not familiar with the blockchain trailer no Okay cool so you know pick two out of three uh is basically uh what the issue is and ethereum focuses on the first two so enter ZK Roll-Ups is every like who's who's not familiar with ZK Roll-Ups at all okay so raise your hand if you're familiar with type one two three four if I say type one two three four so you don't know you what is type one no you don't know you do or you do not okay cool though it's cool that's the whole point um so roll-up Solutions like optimistic rollups you know became big uh I think one and a half year ago because basically what it allowed is is to offer off-chain computation and to verify what the transactions were later on however who knows how long you know it's called fraud proofs how long does it take for an optic scroll to you know verify the transactions anyone know here Pedro yeah so theoretically they they basically said you know up to two weeks but practically Pedro's right you know in one week basically if no one challenges the transactions we can assume that it's okay zika Roll-Ups work different it's a roll up you aggregate many transactions into a single roller block generating an off-chain small cryptographic fluidity proof a lot of words basically means you know you take on an L2 the batch of transactions you commit the data on an L1 simultaneously what happens is another component will create generator proof and tell ethereum these transactions are valid and we'll show it in a picture in a bit um the whole idea is off-chain computation avoiding costly transactions and no re-execution uh gas fees are reduced and data is compressed so this is what I meant with the type one two three four vitalik wrote an article because ZK summer was there like a lot of uh parties started to deploy ZK Roll-Ups has anyone heard of a polygon ckvm yes no so they are a ZK roll-up solution um has anyone heard of Linea for consensus yeah there are also a row of solution ZK sync era another one but they're not all the same so even though they'll use zero knowledge they're actually a little bit different from each other and the difference is all in how they how their virtual machine works so if I so everyone's familiar with ethereum virtual machine basically the piece or the layer on ethereum that takes your code you know and executed executes it very simply put um and the challenge is that you want an L2 that is that that basically for a developer doesn't change the developer experience so right now you're code in solidity right what if I told you yeah now you have to code in another language but you get all these major benefits you know most people started learning solidity and it's not really they're not really looking for another language to again adopt which poses another set of uh challenges so Along Came these four types of ZK VMS and I should actually say three because the type one is actually out of scope at type one can you CLA you can classify is that the virtual machine acts and operates exactly like ethereum so it's one two one however to generate the proof so on an L2 to post on L1 takes a long time so again why do you need to prove is so ethereum knows because the transactions don't happen on ethereum the transactions happen on the L2 so ethereum needs to know hey are these transactions valid or not and the proof does that so the question the discussion is really from type 2 to type four where Type 4 is ZK sync error is an example where you write your code in solidity it recompiles it to the language of their VM I actually don't know what Alexa is rust or or another language um and this is called like a high language level of compatibility why would you do that because basically the proofs generated are much faster now as you move up to the types the generation of the proof takes longer and longer because the the ethereum rich machine is actually I would say relatively slow or inefficient by Design so that the nodes would need low resources to run so you and you and you everyone can can run a node so it's by design that that they create like this however to generate the proof uh um it takes a longer time as you move up in the types so very simply put you know scroll a ZK VMware where are we tied to so and what does that actually mean for the developer especially like if you're not into all this stuff it basically means that your developer experience is exactly the same as ethereum that's what we're aiming for so we want to have to give you all the benefits of a ZK roll up without telling you you know you have to go through compiler need to either or need to learn a new language or that your proof takes a lot of time so uh basically you know in in simple uh that's not simple but in simple words we try to make the dev experience as boring as possible so you can focus on getting the benefits and deploying a ZK uh ZK evm so another word for ZK VM is a bytecode level uh by code levels who does not know what bytecode is in this context raise your hand I'm going to call you out of here okay cool you know like oh it's good so solidity when it's processed by evm what it does is translates the code into opcode so you know push uh you know what you call and then that is actually translated into byte code so if you go into a transaction um you see a long string of numbers actually if you go into the raw output and that's actually what the evm processes and that's what a type 2 aims to do it takes that it takes the code translates it to opcode translates to by code um you know again the benefits here on this uh I have to do a super fast track so the benefits here are very simply put the tldr is your Dev experience Remains the Same you can you reuse the same wallet you can use the same Dev tools a high level of interoperability because everything quote-unquote just integrates is the same so our goal is to make devec the dev experience boring but in a good way so you get again all the benefits um but you don't have to do it another language so this is generally speaking how that roll up would work so you have here ethereum where you have two contracts a bridge contract and a roll-up contract the bridge contract has basically is basically used to get your eth from let's say girly on a test net or a mainnet ethereum to your L2 so it's it's a it's a it's not a side chain it's a pure L2 um then the relayer takes that and then the seek so you might notice that there's no validator here because that's on this Alto the architecture is different the sequencer takes the secret it takes all the data all the transactions sends them to the coordinator and sends them back to the relayer and then on the roll up contract is where we basically not inside the contract but we call it we call the transaction and then the data is posted I'll show you in a bit very briefly what that exactly looks like it looks like but simply put the relayer calls a transaction or a function on the rollup contract and inside the metadata you'll see all the transactions that happen in the sequencer why do we do this data availability tomorrow scroll doesn't exist we rely on the security and decentralization of uh of ethereum and that's how we are quote unquote secure a safeguard the coordinators uh after the sequencer goes relayer goes to the roller so these are approver nodes and what they do is they start to generate the proof that these transactions are valid and they pose and once they generate it go back via the relayer okay yeah so uh if I'd really get posted on the rollup contract inside this contract it has the ability to verify the proof so now in simple terms ethereum knows hey I got a badge of transactions one two um I also have to prove that these transactions have been processed correctly I.E you know I didn't maliciously increase your bank account or wallet address account and and or decreased yours so in other words malicious State manipulation okay so where's the validator well that's not there um I'm just going to go through this quickly because I want to spend the last uh a couple of minutes on how to deploy on scroll um the sequencer takes the role of take you know as the validator takes the broadcasters transaction generates the block that's what the sequencer does our prover notes are decentralized um in simple terms uh it's uh we we kinda because we still run our own network but the Proverbs once we go to mainnet everything will be completely decentralized and can you run your improver um and the full flow will scrumpty like this so the sequencer you know a user transacts on L2 the data is committed on the roll-up contract that simultaneously the coordinator uh sends it to the roller Network so the prover Network proof generated however you see here that the proved is in terms of blocks is posted later it's because it takes time remembering the optimistic example up to a week the reason why ZK is a is an alternative for the community this is just generally speaking you don't have to wait a week but at the most proving times where like three hours and they are decreasing now steadily to some claiming to do it in a couple of minutes most do it around 20 minutes or or less so and so instead of waiting for a week you know after 20 minutes hey these transactions they are valid uh and uh ethereum knows these are valid and a user can transact no need to wait for your assets or any rollback or anything like that um yeah so transaction details or if I go to this link I can actually see you so this is the Smart contract address uh swag contract on Gurley in this case the test net and this is what it would look like um the metadata if uh once what the sequencer posts so I'll just make it as you can see just long it's just data uncompressed it's just a transaction it's all there um it's not sexy at all but this is basically you know uh how the sequencer interacts with L1 and our data availability um is safeguarded does anyone have any questions so far wow very clear all right so uh honestly speaking I was gonna do a walkthrough of um of the how do you deploy but it's actually super super simple so instead of uh doing it I will actually show the the the the code in truffle hard hat uh remix and Foundry and I'll just show it and then there's only one adjustment that you need to make a Foundry does anyone here use Foundry raise your hand you you okay that's a specific Legacy flag that you need to use it's not just for Scrolls because of uh uh some updates that uh happen in solidity so I will uh uh who uses hard hat raise your hand all right how you okay who uses truffle no one are you do you know you can deploy a smart contract without passing your private keys with truffle so no.ev file all right let me show you that let me show you that first I mean this to me was uh was like wow um so if I just go to um I think it was yeah okay so here's a simple uh uh truffle uh um a project it's just an ether wallet that I created uh no no specific configuration over here if I go to config um this comes by the way with the with the new truffle so if you have the latest truffle installed this is all pre um what's it called pre uh filled in for you you don't actually need to do anything uh if you go to the terminal and I think I have already running uh yeah or everyone so if you if you just type truffle dashboard and click and I think I have it already running what happens is this pops up so this is the their dashboard by the way you can plug this into hard hat I'm not sure if I'll have time to show you if you use hard hat and you don't want to pass your private Keys come find me at the booth I will show you how to do it it's really it's two lines in the config so maybe I'll just like sneak in extra time and show you but this is what the dashboard looks like so you know it will prompt you to connect uh you connect while I already connected um what you then can do is was I here yeah you can do truffle uh well I actually don't know exactly the so I'll go over here and does anyone use brownie here no you you rock brownies Brown I need to know where my python devs are so it's basically this command over here okay I'll just try it run it it compiles it and then it sends it to the to the dashboard and as you say it says here it says waiting for approval so over here you can see it sends it for a transaction I say say confirm metamask pops up confirm here and then it deploys no private Keys have been passed so I think that the cool thing as well is the Truffle plugs into hard hat which I can show you now as well um if I uh so over here I have a hard hat project if you look if you've got hard uh hard hat config dislike how you add any other network to it you can add with two lines truffle dashboard and then if you run the command uh MPX hard hat deploy I've got it over here as well I'll just show it real quick so uh here so you can do the directly on fire on the on the network so to say or you could do over here and say truffle truffle dashboard all right that makes a ton sense so it says you deploying contract and over here you can see this again is this is what hard hat so instead of calling the network where you want to deploy it will just use the the dashboard and it checks which network you connected to on metamask and so this is done with Hardware head confirm and then again you deploy without passing any private Keys uh I hadn't I couldn't get this to work with Foundry checked with The Foundry uh sorry with the Truffle team uh it's not compatible yet with The Foundry but if you find a cool hack to make this work with uh with Foundry definitely let me know um and if you're using brownie find me because adding the network can be a real so uh I'll help you I'll help you with that as well any questions so far on using scroll it's really just bridging your eat from girly to to L2 and then replacing the RPC URL we've got postcards don't have them here I have them at the booth where it just shows you everything you can also uh jump into our telegram uh and then you know if you need any if we can send it directly to you if you don't want to bridge sometimes it takes a bit of time but uh honestly if you just uh this is this is the data if you just pass the uh the RPC URL the chain ID that's really all you need to do this is what it looks like and uh yeah so for Foundry by the way final thing I'll show um so profoundly at the very end so I have to probably you know asking a private key Etc et cetera at the very end you need to add the dash dash Legacy flag so if you add the that's just Legacy flag you're good it'll deploy all right well thank you very much foreign [Applause]
Automatic transcript — names and jargon may be misspelled.