EigenLayer Hackathon: Building Your First AVS: Hello, EigenWorld

EigenLayer Hackathon 2024 · May 2024 · 20:54

Gajesh Nail of Eigen Labs introduces the building blocks of EigenLayer and walks newcomers through the HelloWorld AVS. Using a story of a staker, an operator and a developer, the workshop explains how restaked ETH provides cryptoeconomic security to an actively validated service, then demonstrates a local setup with a service manager contract, operator registration and signed tasks. Audience questions cover operators, deployed contracts, slashing and use cases such as bridges and coprocessors.

Speakers

Topics

From EigenLayer Hackathon 2024, hosted by Encode.

Transcript

I think uh we are probably good to get going and seeing lots of people joining room now so let's kick things off um welcome back to everybody thank you for joining us once again um we're really excited to have the igen labs team back once again to deliver another session and to have gajes back too um I know he delivered an AMA at the start of lakon what seems like a while ago now but uh it's really great to have you back as I just mentioned as we were opening the room we're now moving into the building phase of hackathon so a really exciting time for everyone to get involved um great time for you to come along to this Workshop as well as I'm sure it's going

to be very important for all of your project builds um I've just distributed an email so for those of you who signed make sure to check that out it has all of the information you might need to find some team members access technical support and general information about the bounties too so um we've done a big announcement I definitely encourage you to all go and check that out but otherwise that's all of the announcements from my end so um I'm looking forward to handing back over to gajes to kick things off and deliver his incredible Workshop once again awesome yeah thanks RoR thanks for the intro um cool yeah let's let's get

started um so this this topic is hello I world so this is this is our version of hello world so this is going to be super simple let me just start with like how let's get started so um this is all the things like uh these are all the stakeholders in the IG ecosystem so there's I governance there are there's AVS consumers takers operators AVS developers and then there is ethereum Network um so let me just start with okay there are three characters right now there are three people uh Jake Joe and James Jake has a lot of money he's taking on ethereum he's making 3.3% he's uh he's kind of happy with it like he he wants to do he he now wants

to like get more money uh more yield out of that 3.3 person so and he doesn't want to risk it into like D5 Pon inomics so now what he does is um okay okay before before knowing what he does um then there's Joe who has a lot of computational power this guy has a lot of compute to to rent out uh to like different things um and then there is James James is a smart guy he wants to build cool things and uh he has multiple ideas but the problem is he has to get two things cryptoeconomic security and compute power so here's where I Lea comes in so there is

um like we we get all the people together so um Joe now gives his money sorry Jake now gives his money to Joe and uh Joe runs compute for uh for for James so James is like running Oracle and um like Joe is submitting the actor prises to the Oracle and uh and Jake is uh Jake is like giving the crypto Economic Security to uh to Joe so like in case Joe does anything wrong then Jake is going to come in and say hey my operator did something wrong I'm going

to pay now uh for any losses so so Jake indirectly ensures that uh Joe sorry Jake directly ensures that uh Joe doesn't do anything wrong and in exchange uh uh Jake earns yield which comes from from running these operations uh so we are going to get into like how hello world ABS works so there's AVS consumer EVS consumer is the person so like in this case like EVS consumer is a person who's going to use the apps which with James bels uh so now there's AVS consumer who requests the hello world so like AVS consumer wants the a one of the operators to say hello and the name so name can be hello world

hello I World anything so if AVS consumer requests uh something to uh sorry AVS consumer requests like the name to hello contract and now there's the operator who's listening to each uh each new requests so uh operator listens to the name then he signs hello and the name and submits it back to the AVS contract and AVS contract verifies that in like is like did the operator act like does the operator have enough money uh like enough cryptoeconomic security to say hello to the a operator uh and submit Thea submit signature and it also verifies the signature if it's

uh correct so this is how it works um doesn't even have any questions I will continue to monitor chat gajes and if any do come I sh see Ash is typing so if you're quick maybe we can ask that but um otherwise KES feel free to carry on let here we go posted is the just a solidity contract that ABS needs to create uh yes and the ABS consumer okay ABS consumer can uh it it it depends so like for an oracle the ABS consumer is like a

lending market for example like in that case a consumer will be a uh will be a contract oh his question was is sorry not consumer I meant service okay yeah service is yeah EV contract is going to be a Sol contract yes cool um awesome let me get a okay so now let's get our hand story so I'll share my terminal whilst you're loading La up we've also had a question from Saia who asks are op codes compatible between L1 and yeah I can are the op codes compatible uh what do you

mean other C like in other no uh can you elaborate on that uh actually we can we can take like um the questions after the workshop that would be better uh like if anyone has any questions related to um the the flow of hello world then feel free to ask it awesome I think there's no question so okay let me just give a demo of how it works so first we start the chain so one so wait let me turn on [Music] Docker yeah okay okay once you turn on Docker it will start and like and enter

this command it will start annual chain and this this anual chain already has like I layer contracts like everything deployed possible sorry to interrupt to zoom in just a little bit oh yeah there we go that's perfect thank you now we'll start the operator software so it will first register the operator to ig layer contract and then it will send another transaction to register the operator to the EVS contract and now it will start monitoring new transactions so the first um task which is sent is hello I world so it signs the signs hello ion world

and submits the task and it's accepted right now so next uh there's another component to it called spam tasks so spam task will just like send um a random task every 15 seconds to uh to bother the uh hello world AVS this is not a main component of a ideal AVS this is just something uh for for the example um let me now share the code and walk through it yeah just a [Music] minute and awesome uh so let's start with the the operator software so we have um

so the First Command you run is um make uh start the AVS so like in this case first it goes and registers the operator uh so here like it will it will go to the delegation manager and register um the operator into I layer and then it will it will will fetch uh fetch a digest and then you have to sign this digest and then enroll into the EVs and then you have the monitor new task where it will see like every new task which is generated and it we sign it and respond to it uh we'll get to this contract again but uh let's just move

to uh sorry we'll get to this code again yeah first year there's like a service manager base so service manager is the main uh uh like contract which is the entry point for for like any new operator or APS consumer to get in um yeah so let's go down and okay this is um so we have create new task uh create new task function where the user requests a name and then it creates a task uh and uh creates a task and like encodes it like um stores it on chain and later

it emits the emits the new task so once the new task is emitted uh it will sign it and and respond to it so now the respond to askk uh here we have like here it for it does uh three checks first like it will check if your you have enough um enough stake uh then it will check if you have uh if the task exists and then it will check if the operator has already responded to the task uh after that like it will start uh to verify if the you the signer is the operator

and later it will it will uh like it will update it will store the signature and emask is responded to uh this is one part of it oh yeah this is the main contract this is all you have to know uh like after get started with the hello world contract next the The create new task this is where like it will create like uh it will Generate random names and then it will create a new task and like every every 15 seconds it will just hit it with a new random name yes this is this is like a quick walk through to the whole code uh so now

we can take questions amazing thank you uh first one is from Archie and he just ask whether you could elaborate a bit more on Who The Operators would be and what is their role yeah so operators are people who run the offchain software um and upgrate like some value or like just does it does the op computation so like in the example of Oracle uh it will it will like fetch the price and then submit it every like certain amount or certain uh seconds yeah amazing thank you and operators on the feeds which is

generator from Service uh is this example oh yeah yeah yeah sorry yes so this example is clonable me just share the link for this real quick yeah so this is the repo where you can like go and clone this uh file yeah J perhaps might like to link to that repo in the chat as well possible yeah can you see my screen uh yes just Lo now there are a few more questions in the chat I don't

know if you'd rather tackle them first or again at the end it's it's completely up to you gajes yeah sure thing uh okay so if you have the questions um this example okay all uh I C is just on yes so all the I contracts are on uh ethereum L1 yes that's right um how does it check for right tokens uh I didn't understand the tokens part uh what contracts do AVS need to deploy and what already okay so the ABS only needs to deploy the service manager and the additional uh additional like software your

additional smart contracts like your uh service needs so yeah what else uh I SL is okay IA slashing is uh currently still in Works uh it will be coming out somewhere this year and uh can you give exact steps that a builder needs to do yes so okay next like after this uh presentation you can go to Dr .xyz to learn more you can also go to B y/ learn slel and if you have have idea which you'd like to discuss with me you can message me on telegram Twitter or also email me um now the next steps uh first of all go and follow build on ION

and tweet your abs idea to us and like we l to chat um the EOG bound is over but we have an online hackthon going on and also um en code is doing the hackthon so if you are building an AVS on um abs and submitting submitting it on and code you can also submit it on uh ABS micro haacks um yes uh the whole uh goal of ABS micro haacks is like reference architectures and uh developer tooling and there's also education so like you can create videos and stuff and yeah what else uh you can go and read a white paper about it subjective work

token uh and yes now back to the Q&A perfect for managing both perhaps I'll um ask her questions out loud just for for the purpose of anyone watching the recording back so um we've had one from Ash who asks whether you could talk through the verification logic in the hello world service manager contract yeah sure um verify hello name oh uh so the verifi the the verification works like it will it is hello Dash uh plus name not Hello name Plus World so

yeah I think that answers the question catcher ask so manager contract represents ABS or is ABS more than contract yeah it it represents the AVS U uh that's the main entry point for the AVS so that's where like all the all the registration and uh yeah registration happens you can also create another uh like different smart contracts like as for your need but service manager is the entry point in ABS is uh the hack ABS also by uh hack ABS is not by I layer but we do support uh support acon what else is there um uh can you

walk steps by okay I think I answered this uh could you give us more uh use cases um you can uh like couple of use Cas there are actually many use cases like you can build um Bridges sequencing sorry D sequencing or you can build Co processors um you can you can do multiple things um I would actually highly recommend watching our Q&A which we did like really at the beginning because it answers like most of most of these questions uh and like we we have like dived more deep into it for like hour so I would definitely recommend that

yes I see Ash's typing perhaps we'll give her couple more minutes unless um we can wrap things up there yes do you have anything else to share from your end or any final remarks that you would like to share with the hackers before we wrap up uh not really I think like go build AVS we we we love the avss we uh yeah awesome um have one from Ash is it possible to verify historical onchain actions for example can operators verify that a specific action was taken on chain like proof that they transferred

funds for a bridge interesting uh it depends on like how you want it to be done so in case like two separate uh chains then you you have to use offchain compute for that uh yes uh like if you are doing a transaction on optimism and you want to verify it on arbitrum then it's not directly Pro possible because it's like they don't talk to each other awesome hopefully that answers that for you Ash um and as KES said we would definitely recommend that you will go and check out the previous Workshop to um of course that kind of answers many of the questions there and then with this run through hopefully you're you're

well placed and you have everything you need um to build your first AVS and start tackling your project so um I see lots of you asking for a link for the dots after this session GES will be kind enough to share that with us and I will then amend it to the hacka pack so you can all take a look properly later on um final thing for me of course the session will be recorded too so with the link that GES is sharing right now and the recording hopefully you're well placed to go and your projects and and start building so um that's everything from me uh GES any final remarks from

you before we wrap up awesome cool as kaj says then go and get building um reach out if you need any help we're all here to support you and can answer any followup questions you might have so um a nice short sharp one today um but hopefully it gives you everything you need and we'll be in touch ourselves through the Discord server or you can reach out to us via telegram or any of the other medium so um last thing to say from me is obviously thank you all for being here and attending live but equally a massive thank you to gajes for joining us live once again and delivering this Workshop um thank you all and we're looking forward to seeing you all again

tomorrow awesome thanks see you soon byebye [Music]

Related talks