EigenLayer Hackathon: Self-deploy an AVS Using Othentic Stack

EigenLayer Hackathon 2024 · May 2024 · 37:58

Yotam, who leads engineering at Othentic, explains how proof-of-stake networks work and how an actively validated service, or AVS, taps EigenLayer's shared security. The workshop covers why stake and slashing matter, the split between consensus and execution clients, and the onchain contracts an AVS needs. It then introduces the Othentic Stack, an open toolkit with a CLI, BLS-aggregated attestations and an attestation center contract, and demonstrates deploying a simple price oracle AVS, followed by audience questions.

Topics

From EigenLayer Hackathon 2024, hosted by Encode.

Transcript

yeah really excited to have authentic back um to deliver a workshop on our hackathon we have yotam joining us here today um to deliver his presentation and some run throughs so really looking forward to covering everything as always it will all be recorded so um if you don't get it first time following along live do not worry it'll be recorded and you can watch back in your own time to make sure you've got everything nailed but um otherwise that's everything from me great to see you all filtering in again good to see you joining in the chat so uh yeah Yan thank you for joining us and I'll leave you to uh take it away thank you Ro thank you for having

us um so hello everybody my name is yam I lead the engineering team at authentic and today I'm going to talk a bit about authentic the authentic stack what it is H I'm going to talk a bit about a couple of other things related to avss and what avss are and how they work excuse me um so yeah let's get started um the agenda is pretty uh concise so I'm going to go over what is the authentic stack I'm going to go I'm going to talk a bit about proof of stake networks and how they operate then I'm going to talk a bit about avss and how they operate uh and how they they connect to how are

they related or connected to proof of stake networks then I'm going to do a really quick uh quick overview of the authentic stack components and at the end of the after the after the uh presentation uh I'm going to show a couple of demos of the authentic CLI how you can use it to deploy your own AVS and I will be following the uh basically I will be following the workshop document that was shared in chat so let's get started so authentic the authentic St basically lets you leverage 's protocol to build your own networks okay so the authentic stack is a framework that lets you build offchain

computation networks and it comes in the form of a set of building blocks okay that you can build and extend as you choose so basically the authentic stack lets you bridge the gap between igen layers on chain protocol and your own decentralized service and so let's start with proof of stake networks and ask ourself why do we need proof of stake so the two common uh reasons you would want to use proof of stake is for Cil resistance meaning I want to prevent people from just joining the network without putting any assets or without putting any stake beforehand and that's meant to prevent spam and all sorts of other

issues and the other thing is the slashing conditions so the slashing conditions are the situations where I want to punish or penalize malicious actors okay so if I identified some malicious behavior I want to be able to punish these participants but proof of stake networks they present multiple challenges and some of the main challenges are if you build your own proof of stake Network you need to provide on ramps for users to be able to actually buy your token right so unlike proof of work where users can generate their own tokens theoretically in proof of stake they have to be able to buy these tokens somehow this also means that you need to create some utility for your token so

that it will have demand okay and the last thing is that you need operators that have enough conviction in your token so that they not only buy it but also hold it and stake it right so shared security protocols such as igen they solve these challenges because basically what they do is they let these operators and these users excuse me basically use their ethereum stake and that actually makes it a lot easier for us to build networks that are based on that stake that already existing stake but it doesn't mean that the work is done so we have a couple of things that

are left if we want to build our own network so there's a couple of things that we still need to take care of one is the execution layer so the execution logic basically like we need to determine how our network is going to operate and what are the rules and what is the logic of how this network operates we also need to come up with some consensus mechanism so how do these nodes in our Network how do they come to consensus on what is the correct state or what is whether a task or like a block or any sort of um data is valid or invalid so how do they come to the consensus on whether it's valid or invalid and we also need to build some sort of P2P layer where these nodes can actually

communicate with each other and come to the consensus so this is a very simplified view of what a uh a typical proof of stake Network might look like so we have all of these nodes and if we zoom in on a single node we find out that actually each node is running two different clients okay so it's not running a single client it's running two different clients it's it's running a consent client and it's running an execution client and whenever a block proposer is chosen and they propose a block okay that block arrives to the consensus client of every node and the consensus client takes the block data sends it to the execution client the execution

client runs whatever calculations it needs to run in order to verify that the block is valid and then it gives the consensus client an answer whether this block is valid or invalid the consensus client takes this uh this result and attests to it and sends that attestation to the rest of the network so a bit about avss so avss H try to utilize the shared security of igen and in order to do that they have to interact with the igen contracts on chain so that means that every ABS requires some onchain components to exist so that they can

communicate with the igen layer protocol and the most basic things that you would usually want to uh the the the um the reasons why you would usually want to uh have this oing compon component that communicates with igl is first of all you want to make sure that all your operators are actually uh uh Stak with igen so they actually have some stake and they are and that stake is slash H you want to be able to distribute rewards to your operators so that has to happen on chain you also want to be able to slash malicious actors also happens on chain and you want to verify the task validity uh for every task or block or however you

define it in your network you want to verify that the task is valid on chain okay so you want to have some sort of contract that is able to verify the task validity and sometimes optionally you would also want your abs to be able to communicate with other contracts on the network so this is how uh uh like this is a very high level overview or like a very simple view of what an ABS onchain component might look like and basically it's a single contract an AVS entry point and that AVS entry point is a contract that knows uh that can communicate with the igen layer slasher the delegation manager etc etc there's a couple of other contracts uh um as part of the IG layer protocol and

you might also have a couple of external contracts that your abs entry point communicates with but this is again this is optional now I will say the AVS entry point it can be either a single contract that does all of those different uh all of those different um roles or it could be a suite of contracts and that we will talk a bit in a second we will talk a bit more about it but it could also be a sweet of contract and that's what uh the authentic stack uses so instead of a single AVS entry point there's a suite of contracts that each are each have their own responsibilities so if we look at an entire AVS okay um if we look at an entire AVS system so basically what we

have here is we have the let's call it the offchain part which is the consensus and execution uh part of the of the network and then we have all this onchain components all these onchain components that their Prim primary primary uh purpose is to communicate or interact with the igen layer protocol and the authentic stack basically gives you some parts of the necessary components okay so what we have here is that the basically the two main uh parts that the authentic St gives you is are the authentic CLI which

can be used to build your own consensus client and the what we call the attestation Center which is which is this the entry point contract for all the different contracts that interact with ire okay so the authentic stack gives you part of the solution okay but it's important to understand that in order for you to build a fully uh featured AVS there are still things that you need to implement on your own and that's mainly the execution logic part okay so the authentic CLI client so the authentic client it can it has a an API that lets you communicate with an execution client

okay for those familiar with how ethereum validators work you might compare this to What's called the engine API that's the API that is running between the consensus client and the execution client so we expose a similar API and it means that you can build your execution client in whatever language you want okay so the authentic CLI the authentic client basically comes with all the consensus P2P uh BLS aggregation all these features it comes with those out of the box but you still need to implement your abs logic okay so the actual logic of how how your abs will operate and that logic you can Implement in whatever Lang you want as long as you

expose as long as you uh expose the um necessary end points API endpoints on your execution client so that the uh authentic client can communicate with it so the authentic com stack components just again as a high level overview um are split into two so the smart contracts as I mentioned and the consensus client and I will say about the smart contracts one one unique thing about the authentic stack is that we let you it's optional but the authentic stack lets you split your contracts between an L1 and an L2 you could deploy everything on the same

layer but we highly recommend usually to deploy the deploy the um verification contracts the the contract that can verify the attestations we recommend deploying it on some Layer Two some rollup uh mostly to mostly to save on guas costs and the authentic consensus client basically gives you the gossip sub based P2P layer it gives you the BLS aggregations of the attestations and it's um an extensible it has the extensible API okay that lets you uh basically write your execution client however you

want so one last thing I want to go over before I go over the demos um it's important for me to emphasize it so what authentic is not okay so I will say authentic is an open stack that means that it's not its own network okay so authentic is not a network authentic is not an operator and it's not an owner of any contract okay so every any every contract that you deploy using the authentic CLI is your own contract okay it's not an authentic contract it's not under the control of authentic contract of the um of authentic it's under your full control

okay H so basically you can think of authentic as a suite of tools for building your own ABS Network so I'm going to show a couple of videos a couple of demos uh for the CLI itself I'm going to show how it works I might skip a bit some parts cuz uh some of it we might not want to uh wait for the entire thing to to go H there's a link uh I think we put it Rory put it in the chat you can follow the instructions in that link and you can also you can try to follow as I show the demos or you can do it later on in your spare time but uh ER it should be fair straightforward what we're going to do

is we're going to deploy one of our sample avss so basically it's an AVS the AVS itself is going to be a very very simple price Oracle and um and you are able to uh deploy it through our uh through our sample ABS repository and basically run it and see it running within an hour I mean we usually do workshops uh like Hands-On workshops uh where we deploy an ABS within an hour and uh you can also do it on your own just follow the document so I'm going to start by showing these demos or I'm going to start showing these demos and I'm going to explain what's happening so

basically every I will we usually start by installing the authentic CLI itself okay so it's an npm package we just install it I'm going to skip all the dependencies stuff here it's just installing the npm package excuse me H then what we do is we H we clone the AVS samples repository and we create a end file with a private key inside of it okay so that private key this private key that you put in the N file that's your deployer account okay so that's the private key

that you're going to use for deploying your avss so once you uh installed the authentic CLI and once you you've cloned the AVS samples repository you can create the end file inside of your AVS samples repository and uh that will be the private key that is used for deploying the for deploying the contracts so deploying the contracts is also an authentic CLI command so we do everything through the authentic CLI so the authentic CLI has a network deploy command and the parameters you uh uh put in there like

the parameters that you pass the command are explained in the workshop document so you can go over it there H it's nothing too fancy basically we want to tell the we are deploying a suite of uh contracts we're deploying it using Forge as you can see here for those Fami familiar with Forge and Foundry so we utilize Foundry a lot we love the tool chain and we highly recommend it and and what's happening basically is that uh um we we're deploying first we're deploying uh the set of contracts on the L2 in this case it's a Moy okay so aoy is the polygon test net so we're deploying the suite of contracts on the L2 on aoy and

then we deploy we're deploying Suite of contracts on the L1 in this case it's Holi so Holi is where igen contracts are deployed and we deploy in the same network as you can see the script here basically takes care of everything I believe it takes something like 3 minutes if I'm not mistaken yeah two and a half minutes um so I'm going to skip a bit ahead just so that we don't have to watch the entire deployment process but it takes like two and a half minutes ER at the end of it what you get you get an output of all the contracts that uh have been deployed and then I'm going to pause the video so

I can go over all of them okay great um oh no ER went back to the start okay so great so at the end of the deployment script you you get this list this list of contracts and these are all the contracts that the authentic stack deploys for you okay or or some of them it deploys for you I'm going to go over these contracts really quickly or at least the important ones so the ec20 here this is the contract this is a contract that you provide actually so we don't deploy an erc20 or the the authentic CI doesn't deploy an erc20 for you it's like this is the rewards token that you're going to use for your AVS so you you plan on rewarding H operators

with some re uh with some tokens so this is the token that you're going to use for as rewards H for the demo purposes it doesn't really matter you can put any address that you want here it doesn't really matter for if you're if you're just doing the if you're just running the sample ABS okay so ABS governance this is the contract that actually uh communicates with anything with igen protocol with any of the components that deal with operators okay so ABS governance is like its main role is to track the operators that are registered for your abs so when you run your abs every operator that participates has to sign up to your abs

and we're going to see it in a second how they do that but an operator has to sign up to your as and they do that through the ABS governance contract The Vault contract holds your rewards token and is used to distribute rewards and the L1 message Handler this is a contract that communicates with with a bridging protocol with a cross chain messaging protocol and that's the contract that communicates with the L2 contracts okay so I'm not going to get into the details of exactly what this this communication involves but there is a couple of messages that are passed around between the L1 and the L2 here and the message Handler contracts there

there are two of them so we have the L1 message Handler and we have the L2 message Handler so they communicate with each other again not going to go over all the details but that's their purpose on the L2 the main contract that we care about is the attestation Center okay so the attestation Center this is the contract that verifies all of the attestations that your abs produces okay so when your abs when all of your operators they each see a task so someone perform the task they sent it on the P2P layer all of your nodes they see this task now they decide they communicate with your if you recall you implement your execution logic so all of the uh all of the nodes they run the authentic client and the execution

client so the ex the excuse me the authentic client receives this task it passes it to the execution or the ABS uh ABS logic EXC the ABS implementation and the ABS implementation uh uh service decides whether this task is valid or invalid the authentic client signs the attestation whether it's valid or invalid whether the task is valid or invalid and it submits it to an aggregator node that then Aggregates it using a BLS scheme and submits that BLS signature to the attestation Center okay so the attestation Center can validate can verify the BLS signature of all the

operators that signed a spe or that attested to a specific task okay and this is used in a couple of different areas it's used to calculate the rewards they deserve in different situation it's used to calculate the slashing the punishment that a malicious actor deserves um and it's also used the attestation Center is also a extensible in the sense that it can also uh communicate with callbacks with other like to invoke callbacks on other contracts that you can Implement that you can like extend the ABS Logic on chain using these contracts so this is the deployment part once we deployed our AVS

um once we deployed our AVS we can uh register our operators and and if you look in the workshop document so we register three different operators it doesn't really matter how many operators you uh register for your demos but for the sample AVS we register three of them and by the way for those of you who see here a private key and think to themselves that they can steal something then you're welcome to steal the 0.01 H key e that is there and so this is the process of uh registering an operator basically you enter your private key you enter the ABS governance address um and there's a couple of questions here that you need

to answer when you register as an operator to igler you need to do a couple of steps so first of all you need to actually stake some eth so if you don't have steth for that operator account then this uh this command the CLI command will will stake eth for you to get Ste and then it will also delegate that Ste to through the igen strategy manager um and uh sorry it will uh um deposit it to the strategy using the delegation manager as we can see here and eventually it will also sign you up to the ABS now one thing that you can that

you might have noticed here is that there's a couple of questions operator name description all of that stuff uh these are the details that will appear in the UI um or uh technically will appear in the UI should appear in the UI um basically the details of your operator I'm just going to skip to that again so you can see it so so basically you need to provide an operator name a description for your operator some website and you can optionally give some logo URL and a Twitter profile I've omitted these here but you can either fill them in or leave them empty H for the testing uh for for testing purpos say it doesn't really matter but what's

uh important to notice here is that eventually we uh we create a Json file and we upload it to ipfs and that's the metadata that is used for your operators and is presented in the I UI um and at the end of the at the end of the process you can see the confirmation that the operator is registered on this network if you recall this is the address of the attestation Center okay so this is excuse me of the ABS governance so basically this means that this operator registered on this network and this is the address of the operator I registered with and I have a

transaction hash here that I can go and verify on ether scan and um and see that it uh uh see that it actually went uh successfully so as part of the workshop we register three of these operators three different ones there's also in the workshop document um in the workshop document there is a small bash script just to help you create these operators if you want to just quickly create some operator with a small amount of eth in it then you can use that script should be fairly simple and then you can use these operators to register and again

for the ABS for the ABS samples demo you need to register three operators um and then use them in a second we will see the um basically the uh how we run the network um okay so yeah so in the docu in the workshop document you will see all the environment file all the environment vs variables that you need to set in order to run the network itself so there's a a full list there um the the document explains all the different vars that you need to to input and what their values should

be um and yeah you can just follow that but once you've set up your environment variables then you can run the actual AVS and in the demo for the demo purposes how the AVS is running it's running inside of a Docker compose er uh system and and basically it's running a couple of different container ERS each container has excuse me each container is responsible for a different part so we have basically what we have in the container is we have an aggregator node we have three tester nodes and we have a the execution uh logic implemented as its own service and all of the tester nodes they communicate with that

execution logic okay so all the different nodes they communicate with that service and every time they see a task they go to that service and they ask it whether that task is valid and we're going to see it in the demo here I'm just explaining it a bit before because the logs here run really fast so I'm just explaining what we're about to see but I will also pause it as it's going and I will show you the different uh uh steps in the process so basically I run the docker compose it starts uh um it starts up all the nodes connect to each other and then once I execute a task we can see that the messages are being received by all the

different uh nodes and eventually um a task will be submitted on chain and all of that happens um happens automatically and uh the nodes they come to their own consensus about the about the test I would just go over it a bit excuse me go over it a bit uh just so I can show different stages here of the process so okay so here we can see basically that um all the nodes are connected to each other and once a tasks a task arrives so we can see here we have executing task

we have the proof of task here not going to go into the details of what the proof of task mean but means but basically What's Happening Here is that there is some service that uh takes a price uh of usdt uh eth I believe and basically it publishes that price to all the nodes in the network all the nodes check that price they check whether they check they uh contact their own API their own price uh price feed and they check whether the price that the Tas performer ER is actually close enough to the price that they see and if it is then they approve it and they attest uh that the task is valid and if not then they reject it

they reject the task so what we see here is that we see the task is created and then it's submitted okay so it's submitted through uh an Json RPC API and then all the different nodes they receive that new task okay so we have the new message received we have the proof of task here and they all start to validate the task so I'm just going to skip a bit ahead okay so we can see here H with the ABS web API container here that it's validating all these tasks or it validates this tasks it it's validating this task three times because it has three different testers here so each tester contacts the ABS web API and

asks it to validate whether the task is correct or not H the Voting is approved okay so we can see here that they all vote approve um and then they start signing these this task each node signs it separately and eventually the aggregator starts aggregating them and we will start seeing here all these messages from the aggregator service like adding a testation for test with label and eventually once the aggregator finishes ER aggregating all of these attestations uh it submits it ah it's very difficult to see cuz it's right at

the last second but I hope maybe no um so basically at the last second here it's a bit difficult to see the submission itself but basically at the last second here the um the task is submitted on chain it's really difficult to see but trust me that it's there and again if you follow along with the with the workshop document you will see live yourself these demos by the way I mean you can also I mean I recorded them uh um I recorded them uh basically

uh excuse me so I recorded them uh basically one after the other so they should they should represent the the oops they should represent how an actual actual uh actual deployment process looks like so let me just pause this video just a second okay oops um yeah so uh so I hope uh hope this was interesting to you all uh hope it gave

you a good idea what the authentic stack gives you um I think I think that uh as you can see what we try to do is we try to build something that is easy to use that is extensible that lets you build whatever AVS that you want and we have lots of examples or like you know we have lots of teams lots of projects working with us different completely different abss completely different uh logic uh execution logic and um and the the point of the authentic stack is that it gives you a blank canvas to create whatever AVS you want so thank you very much and if there are any questions we

can take them now yesan thank you so much um really enjoyed the videos it worked very well it was a nice way to to run for everything and as we say we have the docs as well which I've periodically been dropping in the chat I'll do so again now um just to make sure everybody has those and for anyone watching the recording of this rather than live um we'll make sure that they're sent over to you as well so you don't miss out but uh as yam said everything we've gone through today I believe is captured in those docs right so um everyone should be able to to follow over there um yam where where can people kind of keep in

touch with what you're working on at authentic um I know you've shared some links there but is is there a place in particular particular that you would direct people if they want to reach out and and get in touch with your team yeah so I will share again in the chat I will share the docu the docs website that we have and so that would be the best place to start you can also contact us through our website that's also an option and and we do plan we do plan on um we're working on creating better spaces for uh the community to uh contact us and talk to us um we have as I said before we have many teams working already using the automatic stack so we do have a sort of

a small community already of people working together and talking and sharing their experience but we do plan on setting up a um we we are still working on it but we do plan on setting up other spaces to uh for the community such as Discord telegram Etc not live yet so don't have any link to share but you can follow the uh the website you can also follow the uh I will also put actually the Twitter um handle so you can also follow us follow us at zerx authentic at Twitter on Twitter on X and I'm going to drop a link in the chat right now perfect and so that's also a great way

to to follow what's going on um yeah and amazing thank you very much well uh actually hopefully that answers your question no Discord yet but um a great time to get involved nice and early follow the the team over on Twitter and then as they go live um you can make sure to to get yourself involved but um yeah once again y time just want to say thank you um I think we've got everything covered with the docs so I'm sure if there are any questions after this as people are reviewing the content and and things like that then of course you can refer to the docs and refer back to the recording to um help out if you

come across any issues but otherwise you um any final remarks any any exciting kind of news you wish to say to share then please feel free to do so yeah I mean I will just I will just answer answer I think I see a question Akai asks how do you deploy sler and event manager contract so I would just say these are contracts that are already deployed by igen layer okay so these are part of the igen layer protocol and the contracts that you deploy using the authentic stack are contracts that know how to communicate so basically you can think about it kind of like the authentic stack lets you deploy an abstraction layer so a suite of contracts that make it a lot easier to talk to igen lir okay so the igen lir apis they are very complicated they

involve all sorts of like all sorts of stuff like a BLS public key and all sorts of stuff that usually people don't want to deal with so the auen stack contracts they just make it a lot easier they simplify a lot of stuff H for you and they save you the trouble of actually implementing that yourself um and I think that was the only other question that I saw here so other than that other than that just want to say really thank you Rory thank you for hosting us uh it was really fun sharing with you what we're working on as I said before the best place is to uh check out the docks and follow us on Twitter or X and uh we will uh keep updating there about uh uh the stack

itself and different projects and teams that are working with us and yeah that's it thank you very much awesome thank you very much thank you for answering that final question which I missed um but yeah great to to clarify that final point and as I said do get involved everybody it's is a great time to get involved um so hopefully today is is the start of your journey with authentic so thank you one final time to yotam and thank you everybody for joining us once again we will see you all tomorrow for the next Workshop thank you and enjoy your evenings byebye [Music]

Related talks