EigenLayer introduces restaking, a mechanism where Ethereum validators can reroute their staking rewards to secure additional modules (AVS) such as bridges, oracles, or off-chain computation services. This creates an additional security layer where operators receive extra rewards for securing these modules but face additional slashing penalties if they act maliciously. The system works through a workflow where AVS consumers submit tasks, operators pick up these tasks, generate signed responses, and submit them back to the consumer contract for verification.
EigenLayer AVS Setup Tutorial: A Comprehensive Guide for Developers
Added:what's up welcome to the poy SE Channel I'm recording today from the car and if you want to know how igen layer ABS works well continue watching so what is igen layer so IG layer introduces a concept called ethereum reaking and what let's look into what that really means so first off we have to understand what how staking actually looks like so we have a operator well let's call him validator for now that stakes ethereum in basically their ether for validating for ch to validate ethereum Network and in exchange for that they get some rewards directly back right that's quite simple enough so with what we do with IG layer raking we take those if rewards we reroute them to a different contract and basically in this contract we are securing an additional module this module can be for example uh bridging uh it can be any offchain computation oracles something like that something that requires some offchain computation right and this this additional security layer is basically getting all of its um security from the main ethereum Network so when we are doing when we are basically rerouting those rewards we are not securing only with the pool of our own money but with the pool of the St ethereum's uh money that we have Stak inside so in addition to this we then say okay for you because you were acting as a validator in in the ethereum network and as an operator in securing our additional modules you'll get some extra rewards and also extra ethereum uh basically rewards that you already get before however if you'll be a bad actor well you will be having also extra slashing penalties if you are a bad actor right so you w't get only penalties on securing your ethereum but also if you will have some if you'll be a bad actor here you'll get penalty on the ethereum that you secured so this is one setup that you can do with uh setting up your abs an additional a second option is basically you're a normal validator you stake some if in the ethereum network and if you go through um let's say liquid staking platform like Lio you get some liquid ethereum back well what you can do is either you or some different operator can take that liquid ethereum and use that to secure an additional module this option two is a bit less secure but it's still quite a good alternative right and from that from securing this additional module you can get some extra rewards so if we go to setting up our first ABS we you can basically clone this uh GitHub repository and let's set up our hello world ABS so what are we going to do here so as you can see here we have uh welcome to hello world abs and there's a like nice uh nice illustration here what's going on um when I first seen this I didn't quite understand what's going on so I made a different kind of different um representation of it so let's see what's going on hopefully you can understand my writing so here we are an ABS consumer so this is the little guy who basically I don't know he wants to transfer its tokens uh from one chain to another chain uh for this simple example he just wants the operator to generate and sign a hello world message or maybe he wants to do some verification on the Oracle side or something like that this ABS consumer can be a uh like secondary contract or anything like that right in this in this very simple example we just are a Navy as consumer and we want some basically um our operator to generate hello world so we what we do is our contract that is living on our ethereum Network we call this contract and say generate hello world so this contract submits an event um hello generate world and this operator picks it up picks this event up so it when it picks it up it generates a message hello world and it signs it with its own signature so you have a message plus a signature and this contract when it picks this up it accepts or rejects it and if it everything was fine it uh accept it and emits an event that actually this has been done on the network and we can verify that it actually an operator actually generated hello world message so in this uh this example it's very also you have abs consumer hello world was generated by a contract so operator is here bit maybe these arrrow are a bit confusing an event is signed here you say hello world operator so message is generated hello world it's signed and sent and if an operator finds out that the operator stake stake so the staking pool as we mentioned here before if this is enough so if taking word are enough if they meet the needs of the operator um then uh the requirements are Set uh the event is accepted and emitted yeah great so as we establish the basics let's check our GitHub repository so this is the hello world ABS as we are all familiar with you do basically git clone this command and of course it clones the GitHub repo and you CD into it now what you have to do is open up Docker so basically um install Docker and open it up so here basically the we need it so it can construct images and containers so what's next okay let's have a quick look at our repo what does it do so here we have a simple readme with the concepts that we already been talking about and there's some quick startup guide on what we have to do so if we go and move into our repo and we do yarn install and we have already installed it so so next command is basically make start chain with contracts deployed and this will build basically the contract start an un chain deploy the contracts to it and leave the chain running in the current terminal so it says that the requesting image platform uh Linux does not manage to detect this host uh however this shouldn't be the problem for our simple example so it's advancing the chain and it says the current block number is 100 so this is currently running so let's open up a new terminal now and we will start our operator so this will compile the ABS software and St start monitoring new tasks so if we do make start operator and let's basically check our code what does it do so how you can quickly check the code and understand what's going on so you have the environmental VOR variables these are already partially populated um and if you check in the docker file Docker file very simple um the most important now because we were all running the commands make make file so here you can check so as before we were running make start chain with contract deployed so if you check where is this command where is this command has started so makes start chain with contract deployed okay this is this so what does it do it runs the shell script Dosh is shell script in the U utils envil start envil chain with L and AVS deployed okay so if we check the script here we can basically see it uh it runs bunch of commands uh it starts a parent path and if we check here it also starts source. yous. sh let's check what this does so as we can here quickly quickly see it starts basically something that's got to do with the docker and if we check into the documentation this will build a contract start an alen deploy the contracts do it and leave the chain running in the current current terminal so that's what it does so here you can see all the associated uh utils are here with the Anil and here we have the state that is basically uh has been generated next the C the key things are contract and operator let's look into the cont contracts how they look like the main contracts this is uh basically done with the forge Forge has Forge build Forge test and so on when you will want to do any sort of compilation use the command for build so if we go to the source directory and here is basically a mock ERC uh uh contracts so if you remember this kind of uh diagram I was showing you before we have basically an operator and these are the ERC funds that we mock that are being currently secured so these are this mock erc20 um tokens that are being secured and if we go to the hello world service manager so it creates a new task it responds to a task and that's it so if we go to our contract over here it responds to a task and creates a new task so that's fairly simple stuff that you can do and if you want to build something on top of that you can expand of on these functions here um next if we check on the operator what exactly does it do I we have a bunch of abis in the start some environmental variables that are imported like contract address delegation manager address stake registry address and so on so abis are here all stored already for us um and then we have a few functions sign and respond to task register operator and monitor new tasks so if you check the main function that runs when we start the operator we await and register the operator so this is basically this uh function right here so this just basically uh gets the wallet address uh registers an operator and so on on the network and then we then um are constantly monitoring for new task for new tasks so we are looking at the contracts create new tasks and when a new task is created then we do sign in wait uh sorry sign and respond to task we call this function and what does this function do it creates a message hello task name in our case this was hello world and generates a message hash and signs it with a signature from with its wallet and basically calls the contract respond to task um if you remember our contract looked like this so this was our respond to task function and yeah that's basically it that's how it works oh and also we have another another um another function called create new task. TS so what this does you can open up a new terminal and run make span tasks and this will span the ABS with random names every 15 seconds so we are basically acting as where is my ah okay here yeah sorry um so yeah basically we are acting as an ABS consumer and generating bunch of tasks well thanks guys for watching this concludes our tutorial and hopefully you will have fun with I ler
Up Next

Strong Cryptoeconomic Security for Arbitrary Validation Tasks
@ic3research
111 views•2024-08-17

Torrent File Format & Bencoding: A Technical Deep Dive
@AsliEngineering
12.5K views•2022-08-08

Operational Security Essentials: A Guide for Hacktivists (OPSEC)
@hitbsecconf
157.4K views•2012-11-26

Understanding Ethereum: A Comprehensive Beginner's Overview
@99Bitcoins
3.1M views•2018-06-26
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Blockchain & Crypto







































