New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Build a Rollup powered by Avail DA

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Robin Roy from Avail, for a workshop titled, “Build a Rollup powered by Avail DA.” Learn how to interact with Avail, and maybe even spin up a rollup that is secure and cost-efficient. This workshop took place during ETHGlobal Brussels, a 3-day hackathon held in Brussels, Belgium from July 12 to 14, 2024. ETHGlobal Brussels brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ---------------- Follow us: x.com/ethglobal Website: https://ethglobal.com Email us at: hello@ethglobal.com Learn how to interact with Avail, and maybe even spin up a rollup that is secure and cost-efficient powered by Avail DA.

Transcript

[Music] okay uh hi everyone um I'm Robin um de at a veil um today I'm going to be talking to you about um how to build a rollup with a veil U but before that I'm just going to go quickly um to you know let you know about what a veil exactly is so that we get some context about what we actually doing here um essentially right what are the challenges uh we facing today in the rollup space um there's you know multiple rollups out there rollups are essentially trying to scale execution but um at a point after execution da or data availability becomes the major bottl neck for web 3 rollups and l2s um and because you need block space which is not which is quite expensive on ethereum even with blobs right now post 4844 um we need excess block space in order to cater to this rollup Centric road map that ethereum has so um rollups need da to scale um there's a ux fragmentation with the number of rollups that's popping out every day and we need a framework for unifying all of these uh different rollups right so um so like I said ethereum rollups have like taking the uh Center Stage right how many rollups are you using every single day uh on a monthly basis or maybe on a weekly basis or on a yearly basis right it's at least I could say at least more than three maybe or maybe four or five and this is going to keep on growing um I mean in the next couple of years in the next couple of months and aail da is uh this ZK or validity proof uh driven da layer that is um verifiable and secure and allows you to spin up cheap reliable and secure rups um for your use case um and with you know the number of rups that being uh coming up there's going to be fragmentation and that's why we have ail Nexus that's trying to unify these rollups through Prof agregation um and asynchronous composability among these different rollups and uh by bringing together ecosystems of of different chains together we want to also uh you know be be sure to bootstrap enough cryptoeconomic security not only cryptographic Security on our Network um because obviously if we are uh we are connecting through Nexus uh cryptographically all the easy ecosystems together but the problem is there is also a cryptographic thing that we need to be uh thinking about and that means uh Avail Fusion kind of allows you uh to provide that additive cryptoeconomic security which I'll go into soon right so essentially like the permissionless unification layer for web 3 aail da aail Nexus and Avail fusion um so what is Avil da exactly it is the you know validity proof based da layer for the Next Generation trust minimized uh applications so you can Bic basically spin up a rollup on aail using aail da right and um I don't know how many of you know what da exactly means but to just give you a quick brief on that right uh on a monolithic chain for example right for example ethereum if you just take ethereum as it is it does the execution it does the consensus and ordering and data availability um uh of of that chain itself right so you get a bunch of transactions right and you execute it right uh and how do you execute this right you execute this with this data that is there so um if anyone wants to verify if the execution was done correctly you need that data and this is what data availability means so on a monolithic chain this is a given because every full node who is executing these transactions and every validator who's verifying these transactions will have to anyway run a full node and hence data availability was not much of a conversation before but as we move to this rollup Centric road map as we start moving into this modular uh ecosystem that we have uh where we're decoupling execution right basically rollups are basically decoupling execution from the main chain because you have different kind of VMS like ZK VM ZK evm you can have an uh evm or a Solana VM or a move based VM whatever you want right and you when you're offloading uh your decoupling execution here you can also in the same way decouple um data availability from the main ethereum chain so that uh you can one uh make it more verifiable and secure you can use uh light uh light client based sampling as well as easy verifiability and also it's cheap right um so a is this modular based layer provides raw block space for chains uh it has a robust validator slay Set uh uh and basically the main thing that you want to uh understand is here that just imagine aail da or aail as a a place for you to publish transactions without interpreting it so aail does not interpret the transactions that you or the data that you put into a veil you can put any raw data it does not matter what it is uh a veil does not uh you know interpret it in any way you can your application can interpret it however it wants to based on your application's logic and that is the magic of it right um so that that means a veale is compatible with all different all of the uh you know uh VMS out there like it it is uh agnostic it is chain agnostic it's ecosystem agnostic it is neutral it's credibly neutral um and yeah so aail da clian is it's another superpow that we have uh basically it leverages the kcg polinomial commitments in the block headers to do um data availability sampling which basically means like clients uh on a like for example in ethereum or in the general context like clients just pull headers block headers from the full node but it is not able to verify if the transactions itself or the block itself is valid right it trusts the full node there right and the difference here in Avail is the like clients don't have to trust the full node because they themselves can verify using this uh technique called as datab resampling which I'm not going to go deeper into at this point but uh definitely if you want to you can reach out to me later and I can uh let like go a bit more deeper into that but essentially it does this thing called as data availability sampling which uh allows you to trustless like your live client can uh trustless verify that this block is valid and verif uh and without you know even downloading the entire block and making it light um so it's based on the substrate architecture um and yeah we have a P2P light line Network that means uh each light line communicates with each other and we are also we are also able to reconstruct the state of the block uh because of the p2b light c network um I'm not going to go more into this um then we have aail Nexus so aail Nexus is this unification uh uh or coordination Hub that we have for different rers so like imagine we have thousands of rups that's coming up like like just look at this image that you see here on my right and uh you see that for all of these chains that are in this ecosystem if you want to connect or communicate with each of them you still you need to have a bridge like each line over here is basically a bridge right uh and this is just for like what seven chains imagine there's like hundreds of chains you need to have a 1 is to end connection to from your chain to another chain to be able to communicate with them and that is a problem problem so what does Nexus allow you to do it basically gives you this uh one unifying coordination layer uh using proof aggregation to kind of coordinate among these different layers and uh verify the execution or the state transition function proofs of these uh different layers uh of these different chains um which you can use for basically uh enabling asynchronous composability and uh stuff like that um yeah so mostly for the hackathon perspective uh um for you like aail da would be uh what you would be uh using a veil Nexus is still uh in product like it's still being uh developed and would we're targeting like maybe 2024 or late or 2025 as well um yeah so aail Fusion is essentially a unifying layer needs unified security and um because we now like I said we are unifying all of these ecosystems together we need to have cryptoeconomic security guarantees as well which is what Fusion allows by allowing you to like stake Bitcoin ether and any other rollup token that you want onto the Avail consensus layer so that you can uh you know contribute to the security of the chain itself right um yeah so that's pretty much uh I'm what I'm going to go into today uh in terms of like explaining about a veil so what I want to also go into is um just uh try to show you around the our Explorer just give me a second all right yeah so this is one of this is a developer focused explorer that we have so in this uh basically you are able to check out the you know the transactions events that's happening in the network uh you'll be able to see like you know when a balance transfer has happened uh when a data availability uh um when someone has sent data to the aail network and basically you see the data hash over here um you can see who has sent it and if you want you can even go into the block here and uh you're able to uh see what all uh you know exens have been uh you executed here right so uh this is at explorer. avail. so um which you can also try out one thing that is really cool here is that when you go to the developer section here you can actually try out the different extrinsics extrinsics are basically functions uh that that you have to uh that you can use to kind of interact with the Avail node right um You can you can consider this as like you know um interactions that they're doing with the veil node or uh to basically do some particular functions um for example if I go here if I go to data availability extrinsic I can now create an application key so what an application key is is basically like avails block space uh like when you're sending a data you can create your own app ID for your address right and what what that does is essentially you can send data to that particular appid app ID just saying that okay for this particular app ID I'm sending XYZ data so what it helps you to do is later on when you want to filter data or or like you want to retrieve data back from the Block you don't have to download the entire block you can just filter based on the app ID of your application so if your app application ID is is three all you have to do is uh you know query based on app ID 3 and just that data from the entire Veil block so uh this is also possible with a light client so when you're running the light client you can uh if you like in the config file there's a option where you can put in the app ID number and if you do that your light client will only sample or like fetch data of your particular application so now you can uh just run a light Cent you don't even have to run a full lo you can just run a light client fetch that data and then maybe you want to store it somewhere or you want to do something with that data you can do that so it's a pretty cool um now for example I can also uh submit data right so this is uh so you can do this programmatically like with a I'll show you how to do that so but this is just from the UI perspective so if I want to send the data ABCD um I can send that like uh submit transaction now right now this is at app ID Z as you can see so app ID Z is like the default app ID so in this all all the extrs are possible but for any other app ID greater than zero uh you can only do data data submissions right so if you want to do a balance transfer for example you have to do it on zero app ID Zer because that is where uh all of the exchange X are enabled but for anything greater than uh zero you can only do data submissions so right now I'm doing a data submission at zero which you can also do um because I haven't created an app ID but if you if you want I can show that also um and let me just so yeah so you'll need a wallet like sub wallet or Talisman or poker. JS uh to use uh this Explorer because this is based on substrate and you can see something going on over here and there like a 20 second block uh block time here me check okay I think it should have been submitted what is my 5gw okay it should be somewhere here yeah so this is this is the data I submitted here and uh you can kind of check it against [Music] here yeah so the data I've submitted is this right and you can find it over here and you can basically decode it if you go it over here right so you can basically use this Explorer to kind of do your developer operations here but if you want a more user friendly one which is much more friendly like just so that you can maybe just put in a transaction hash and see what's happening we can use a Subs scan uh Explorer um which is probably here so this is at aail touring. subsc scan.

so this is our secondary block Explorer it's taking some time to load um but yeah basically this is the more user friendly version but it's not very developer friendly like you can't like put in the extens 6 and you know test stuff out that is for the other explorer that I just showed you but over here like you can just put in the uh transaction hash you can look at the extrinsics here uh you can look at all of this data here like you know all of that is cool um but now what I wanted to show is um apart from all of this there's uh the how do you program this right how do you interact with the a network directly with like JavaScript example so we have support for JavaScript rust and go so um for example the the one which I did now submit data I submitted some data right now um how does that look like in code would be uh here so like if you go to our GitHub at Avail project / aail uh you will go to Avail JS examples node examples source and you see data submission so what does this even look like um yeah so essentially what you're doing here is you're initializing the jss DK uh you are dep picking some stuff from the config but essentially what you're doing here is you're initializing the API um and you are getting the Account Details so you're getting the keying um and the app ID right so like I spoke about the app ID right here so you can program it to way like whatever app ID you want it to be um but essentially over here it's asking if the in the config the app ID if it's zero just keep it at zero or else uh you know use whatever app ID you configured right so basically you need to have an app ID the no all of that set up the what is the data that you're going to send and what what you're going to do here is now you're going to use the API you're going to call the transaction uh uh and then you're going to call the data availability extens so in the UI how it looked was uh let me pull up that UI I don't really know where it is wait um yeah so in this UI when I went to exens X I called uh data availability here and submit do submit data so this is datability submit data and on code like in JS how it would look like is data api. tx. dat availability. submit data and then you're inputting the data in then you're signing and sending it with the Account Details the options which would be like the app ID the nons all of that and then you're getting the result back and you do whatever you want to do with the result there's some EX sample for uh transaction handling and all of that but essentially this is what you're doing right and then this is how you can also uh get back whatever data that you have sent basically you go to the block uh you uh check you go through the extrinsics that's there and uh you find the transaction and get retrieve the data so yeah uh so this is how it would work on a Java Script perspective uh for you and there's multiple different uh examples like if you want to do a just a balance transfer for example uh there's an example for that right so you can just go through this uh repo and uh you know let me know if you have any doubts and now for the hackathon like right so what do you need to do so we have got a multiple bounties here um let me check yeah I think we've got multiple bounties yeah all right yeah so in terms of bounties what we have is one best use of polygon cdk arbit aate or stacker SDK with a wda so um this is these are basically just Frameworks where you can spit up a rollup so you don't have to basically interact with a whe directly you just have to spin up a rollup already so polygon and arbitrum already have their own tracks for cdk and orbit now we already have an integration with them and you just have to spin up our version of it um and you'll still been you'll be eligible for their prices and our prices as well which is pretty cool um and you can build any use case that you want um stacker SDK if you want to build like custom application specific chains that is like maybe like shortterm micro rollups maybe like if it is like for example game right if it is a game maybe you want the game to maybe live only for the duration of the game maybe that rup should only live for the duration of the game and then after the game ends maybe the rollup can be discarded away if that is the case that you want to do Stacker could be something that you can look into because it is easy to spin up and easy to discard it is like an eal uh epimeral rollup basically um so maybe look into that if you want I can help you get connected with the team there are some team stacker members here who are also like they're good partners with aail and uh they also use Avail da underneath so all of these things use Avil da underneath um as well and then also now if you have any use case that has uh maybe not spinning up a roll up but you want to publish some data to Avail like I just showed you like submit data to a veil and you want to retrieve it and do something with that uh you can you can be eligible for the build with a veil uh track um and yeah you can do what uh you know specific application you want to build with it also if you are more of a smart contract developer right you don't really want to spin up a rollup or you want you don't want to interact with a veil much but you want to build some solidity smart contract for example we've already deployed an OP stack test net rollup for you where you can just deploy your solty smart contract and and so you can just deploy your dap on that and be eligible for some prices there um and then another one is like best score tooling project so like if you if you have any ideas on how to improve the veils toolings uh for example like you know a DA cost calculator like what would it cost like just a front end Dash that would be like um sending 1 MB of data to aail would cost this much 1 MB of data to ethereum would cost this much maybe to maybe igen or Celestia would cost you know XY Z amount right um so something like that would also be pretty cool to see um even validator operations that you can see here right uh in substrate essentially like the uh when when a validator takes their tokens the rewards are not you'll need to manually claim it so maybe you can create um a script maybe uh or a dashboard for people to like claim it on a weekly or a daily bases something like that some tools that can maybe just help the ecosystem as a whole so these are some tools that you can do um how much time do we have I think we have time but so I'll just quickly move on to like um how to like spin up an orbit orbit chain just to give you a quick uh overview of that so basically it's pretty simple actually we've actually documented all in the docks here um basically you'll need a Docker and with the docker you just uh just pull uh pull the node and the uh you know the the requirement prerequisites from here you kind of change the ENB so what you'll need to do is once you've downloaded uh the requirements here and build um you can you have to modify the EnV file so what that would look like is um so on the EnV file you need to basically uh yeah so on the EnV file okay this is not zooming yeah okay so on the uh EnV file you need to mention the rollup Creator address which is already mentioned on the dock here so this address you need to paste over here which I've already done and then you need to put in your devet private key uh which is a spare one which I've put in so it doesn't really matter what you do with it at this point um but yeah um so you have to put that in then all you have to do is go into the script folder and modify the config file so what that would look like is um if you go to config.sys do does this and if it is an armm architecture machine you have to put this and just put in this config essentially and it would look basically as this and pretty much you just run deploy your smart contracts are deployed with hot hat uh you'll get an output similar to this right um this probably will take some time which is why I'm not running it uh live with you right now it will probably take maybe 5 minutes uh 10 minutes sometimes to just compile and run because it's being deployed on arolia and depends on the network conditions over there so I don't want to you know risk Wasing time on it um but essentially this is what it's doing it's deploying these contract rollups over there and um you'll get some information so as you see here in this image here right um you'll need to uh keep these contract addresses safe right over here once the contracts are deployed you need to keep the contract uh addresses safe you need to keep keep the block number safe because eventually in The Next Step uh when when you're doing the orbit setup script here so you get cloning the setup script uh get into that folder uh just change the node config so how that node config will look like is it would be looking like this so basically in this line uh let me if I see if I can drop it okay yeah so basically in uh this part what you need to change is you need change your chain ID based on the config that you had initially put in so like uh when you had initially put [Music] in yeah somewhere over here you you must have put in your chain ID right so you need to configure it based on that you need to change that you need to also add in some of the other important information that is defined uh it should be defined somewhere here let me check oh no this okay anyway so I think there was a change in the docs but anyway uh if you actually go through ah yes sorry my bad so yeah in that config file you need to change these things based on the contract addresses and all of the information that you have BAS Bas on your deployed smart contracts and B like you know basically you need to change the chain ID the name the initial chain owner so these are uh this would be an address um again this would be this would also be uh the private key and the address uh the seed phrase of your Avail wallet you need to put in your app ID so you need to create your own app ID for this you you can create it programmatically if you want which is again an example that is already provided or uh you can also uh yeah or you can also go to a website like this that we have created so all you have to do is uh sign in with your wallet uh and you can just uh click any wallet give some name for your uh yeah so you can give a name so like I can give a name like testing 1 2 3 um so I'm going to create an app ID for my uh particular um wallet here so I'm just going to create a ipid oh okay my bad I I hated two transactions at once that's why it's happening but it should work and then uh what would happen is you'll get an app ID here which you would replace in your uh config in this right so the app ID would be coming down somewhere yeah somewhere around here um which you'll need to configure so all of the details that you need to configure is um on this documentation itself so it has already listed the parameters you need to uh change and then you just Docker compose up and uh it runs so like this is basically the chain running at this point on Docker um you'll have the uh you know the URL that you need the the end points that you need to interact with the network network will also be uh there uh which you can use so that's pretty much it uh I know short on time so that's why I didn't want to like get into the actual impation and just went through the Docks but we have a booth here if you want to you know if you have any problems in executing this just let me know and um I'll be here to help um also yeah we have um a polygon cdk docs also it is not officially on the docs but you can use this document as well um I've added it uh on the resources page of our prizes thing so there's a hackathon Dev on boarding cheat sheet sheet uh where you can like find all of these documentations already listed out so that you know it's easy for you to do it if there's any questions I can take it St okay yeah there's any questions um this kind of like configuration let me kind of build my own like Fork Avail and support other like rollups or any nwork if I want to use a v to support any other rollups which is not currently supported is it possible and if yes how thank you um so okay yeah so you can build So So currently a veil supports um op stack orbit cdk I think we support Madara and uh I think we're working on an adapter with ZK syn as well so if there is any other rollup stack that you want to integrate with uh you'll have to build an adap for that particular stack right um you could build that uh for the hackathon maybe but I don't know how complex it would be to build for just maybe one day or two days of a hackathon it takes it takes pretty much some time so it's more complex um but yeah I mean if you want to attempt at it you can uh you just have to build an adapter you can look at the reference of our already existing adapters and see what's possible yeah thank you [Music]

Automatic transcript — names and jargon may be misspelled.