EigenLayer for Developers

ProtoLayers Talks · June 2024 · 27:06

Nader Dabit of EigenLayer explains how the protocol lets developers build arbitrary distributed systems, called AVSs, on top of the Ethereum trust network. He covers how AVSs work and how to start building one, and the talk ends with a small hands-on workshop on getting a first AVS running with restaking.

Speakers

Topics

From ProtoLayers Talks, hosted by ProtoLayers.

Transcript

so uh this is going to be broken up into two parts first I'm going to do a quick introduction or maybe not that quick of an introduction to igen layer specifically for developers and then I'm going to walk through building a very basic abs and this doesn't talk much about the reaking part because that doesn't really have to do I think with this audience instead we're going to just talk about why igen layer exists so if you want to check out any of the resources that I'm about to share you can check this out I think that for the purposes of people here that are interested in building there is a repo called awesome abs that is essentially an aggregation of all of the best learning material so if you want to

build anything that's what I would recommend checking out but there's also some resources here so when I first heard about IG layer it wasn't that interesting to me because everything was talking about reaking and I'm typically uh just not too interested in what I at that point thought was like the financial part of of the whole system it was only once I understood kind of like why the staking existed that it became interesting to me and the the basic value proposition is this it's that if a developer wants to build out a new network a new protocol or any type of system that requires some

type of verifiability they have to bootstop their own e Economic Security which is not a trivial thing to do if you want to write a smart contract that's a pretty trivial thing to do and you can inherit half a billion dollars or half a trillion dollars like of Economic Security from ethereum by just writing a smart contract but what if you want to build other uh proof of stake networks what if you want to build another chain all those sorts of things you have to basically kind of start from scratch so the core challenge is this it's that bootstrapping decentralized infrastructure is difficult and Ian layer the whole I guess you could say

the purpose that it serves or the means to the end of the whole reaking is that it provides a platform for developers to build arbitrary proof of State networks by inheriting the economic security of ethereum so with igen layer users that re St their stake that they're already using to secure ethereum you can kind of bring that power of ethereum outside of the evm so we're used to having that Economic Security within our smart contracts but you can kind of extend this Beyond to build out arbitrary uh networks so I like tldrs because they kind of like take a bunch of mumbo jumbo and kind of make it really succinct so a

couple of tldrs here you could think of igen layer shared security for ethereum or increasing the programmatic programat okay I'm not going to try to say this program programmability of ethereum um so what what is that even mean it just means that right now you can program smart contracts but with IG layer and similar products you can program anything so what does shared security look like in practice I'm probably preaching to the choir here because I know that that's a very highly technical group of folks that come here and also to eth Berlin where I just left but let's talk about the evolution of blockchain for just a moment the original networks were application specific meaning that if I was a

developer and I wanted to build out a new idea I had to literally build the whole blockchain from scratch so therefore we had blockchain we had application specific chains like Bitcoin and Litecoin and all these other um specific things that were essentially slightly different from the other but no one could kind of pick up a single line of code and deploy it and then have a new blockchain or new decentralized um app that inherited any of that security it just didn't exist so the big I guess evolution in this entire industry was programat uh blockchains that were programmable so programmable

blockchains smart contract blockchains and the first one was obviously ethereum so it was a big deal because you could take a single file and now have a specific set of functionality that you described in that file and you did not have to build all of that infrastructure you you could kind of describe what you wanted so examples are any smart contract that became successful that is now a product Unis swab all all the defi protocols you have um now all the l2s with social networks and all these things but the underlying Network that kind of enabled all that

was a smart contract platform like the evm running on something like ethereum but what we've gotten to real what we've become to realize is that scalability does not provide the the the current networks do not provide the scalability of what we want to have if we start comparing the usage to what we might see in the traditional web 2 world so in the web 2 world at AWS where I worked for a while we had a database called dynb and dynb would manage literally 100 million or so operations per second for a single application so a single application

using their own database was you know hitting millions or tens of millions or even up to 100 million operations per second this was not a shared blockchain or a shared infrastructure this was just for them and if you kind kind of compare that to where we are in the blockchain world where we have a what we consider fast Network or performant network like salana for example maybe you you might disagree with that whatever but let's just say that that salana can do 10,000 TPS real TPS which that is obviously you know um something that can be argued but let's just say that it did do that salana is also sh a shared network so it's shared by every um smart contract or program that's been deployed and it's also a

Shar between all of the users of all those programs so what has happened is that we've realized that there needs to be more scalability and there are two approaches to scalability in software you have vertical and horizontal vertical is making the execution faster horizontal is splitting up the work across multiple nodes so what has been realized in our space also is that we need to scale both so we're seeing new execution environments better execution environments but we're also seeing this rollup Centric road map where people are trying to build out application specific Networks applications specific rollups and have interoperability between them so we want to make the execution extremely fast we want to have uh anyone

that needs their own application in the future potentially have the ability to deploy their own network and have everything interop in between and that is kind of the like end goal we're not anywhere close to that yet but that that's kind of what's being worked on right so with this we have this modular um Paradigm that came in into play that was introduced I think you know this name originally by Celestia so with the evolution of blockchain networks we now have rollups which are decoupling the different pieces of the stack and the very first one again was kind of like data availability so we're

decoupling this data availability layer and now we're starting to see all these other pieces uncoupled as well we're seeing co-processors we're seeing um different of execution decoupled but with all these new pieces that are being decoupled a lot of these are essentially new networks that need to be built from the ground up so with the modular Paradigm we're seeing new networks that need to exist but there is only so much money into in this space that can go to secure all these Network so every time a new network comes online there has to be some money somewhere to be put to stake to buy that token to secure the network blah blah

blah and if you think about this in like terms of five years 10 years down the road imagine there being tens of thousands of networks it just is hard to uh like really imagine how that can be made possible if we go down the road that we're kind of going on with everyone building from scratch so what is a solution to that there are there obviously multiple ways that you can approach this I'm just going to talk about the approach that igen layer has brought to the table so when you need a new service uh the network needs its own distributed validation sandic to do verification it typically needs its own token and you

need stakers and operators to opt into that Network to participate in the network so you need all these things and you need to kind of bring them together so the question is what if developers could access ethereum's validators or let's just say what if developers could access billions of dollars of economic uh stake to secure their networks and these are arbitrary networks and the general idea here is that that's what igen layer enables it's like these abss which are actively validated Services you can basically deploy decentralized infrastructure without having to bootstop your own trust Network I actually sent out a tweet on the way here it was kind of like

something that I was thinking about um because one of the things that I've actually heard and this is kind of the point that I'm getting to here essentially it makes it just a lot easier to build uh arbitrary networks one of the things though that someone said today or this week that that kind of made me think they said that well because it's going to be so much easier to build all these networks we're going to see a bunch of like networks and coins and like just crap being built and that's actually true right but when you think about it that's kind of what happened with ethereum or that's

what happened that's what happened with the smart contract uh networks that are out there you can Fork you can clone you can deploy anyone can do whatever they want is that a bad thing I mean some of it's bad for sure but if you look at it as a whole it's actually a good thing because you can learn from other people there's new things that people people are trying because they don't have to build all this stuff from scratch so I think ultimately it's going to lead to a lot of innovation with a lot of crap along the way so that's kind of like a a side from my talk but it's something that I was thinking about actually in the car rod on the way here that I that I just tweeted out but if you want to kind of look at what this kind of look like looks like

today you have ethereum or whatever uh Network that that you're building on um then you have other services that you might be interacting with and then you have your client that's interacting with one or the other or both uh the general idea is you now have this stake here let's say whatever $500 billion people are taking that stake they're reaking it to these abss the abss inherit this security they are no longer having to issue all of these tokens to all these validators that are uh having an opport opportunity cost of leaving ethereum I'm sorry leaving ethereum to go to their new network selling those

tokens or whatever and then kind of like buying into the new network they're able to participate in that new network without I'm not going to say without risk but without um the best word might be them having to exit uh ethereum and I guess you could say it might it could typically would be more risky to join a new unknown net networ so what are the network participants kind of looks like this you have you have IG layer in the middle you have application developers that are using different abss and the ABS developers are interacting with the IG layer contracts The Operators are running the ABS

services and then you have stakers that are opting into different um operators and The Operators the stakers can choose you know which operators they want to opt into there's all there's also this idea of dual staking where you can use two different tokens to secure the same network this gives a few different value propositions that a lot of ABS teams want and it allows developers that are launching valuable networks to still have their own token and have a lot of utility for it so yet another tldr abss or apps or systems or protocols or networks whatever you want to call call them

using ethereum trust outside of the evm so what are some categories I'm going to look at some specific protocols that have been announced recently we're tracking over 200 uh abss from teams that we think are good right now um there are probably about a couple of dozen that are publicly announced these are different categories that we've put together a lot of these categories kind of like cross over though because some of these things will be used by rollup services that are under other categories and um some of these will be interacting with other with each other things like that I think some of the more interesting one I think the most

straightforward way to think about what could build what could be an ABS basically any existing successful protocol that already has been proven can be rebuilt as an ABS also very specialized services that might not have made sense to build in the past so imagine you have a a service that is needed by your app and your app only but maybe it doesn't make sense for every everyone else's app that might be a good a good uh you know I guess choice for an ABS if you also look at I think and I have a blog post it's more of like a hackmd article I'm writing up right now but if you look at what foraster did

I thought that was super interesting they launched uh you know a few years ago and they just announced a a big raise of like $150 million which is really crazy at the app layer what they built though to enable that app was like their own decentralized infrastructure that they had to kind of build themselves so I wonder if we're going to start seeing more client side applications become successful that are building their own proprietary or their own specialized uh networks to enable and facilitate their own uh their own specialized front ends so if if you are building in that manner this also could make sense so some specific examples I think

the most well-known example is data availability because Igan da was the first ABS to launch or one of the first abss to launch one of the reasons that IG da launched first was that it is very complimentary to all the abss that are being built now so we have a lot of teams that are building using both IG day as well as uh creating their own their own ABS a couple of the properties of IG da very high throughput low cost reserved bandwidth and um I would say like if you look at I if you look at data availability there are a few different uh options now I used to

work with Celestia Celestia is great there's I da there's a veil I don't think that one is necessarily better than the other it's more about okay I have have a product I need this that or the other I'm going to now look at all the different options I'm going to choose the best one that's kind of the way I look at it so some other examples of live or publicly announced abss I just spoke yesterday on like this live podcast thing that I do with versus who's building something called Allegro which is really interesting it's basically a verifiable digital ocean drop so you can spin up this digital ocean type droplet you have your own server

you can do whatever you want you can build Services there and they have different ways of uh to implement verifiability of the things that are happening there it's super it's probably my one of my favorite abss because mainly be it just has a lot of crossover with the full stack application development that I like to do that I'm that I'm used to it's more of a like real world use case that that probably a lot of people are going to want to try and I think they've already closed quite a few protocols that are well known to to to use that uh co-processors are really interesting so co-processors are essentially a way to offload very computationally expensive things that

you might have done in the past within your smart contract outside of your smart contract and they are asynchronous so imagine you want to aggregate a bunch of information about a smart contract that's like an nft contract or a token contract you want to pull multiple queries you want to do some stuff to that and then you want to verify that own chain uh lrange would allow you to do that this is their API it's actually pretty nice API also and um the way the way that this works is that you basically have a way to initiate some type of um process onchain there is an offchain computation and then there's a call back into the into the smart

contract so you're verifying within the smart contract and they have already going live and you can already start using their um their service another co-processor is brevis very similar it's a ZK Cod processor we they have a typescript SDK and a go SDK that's pretty nice to use I think GES who's on my team is working on something there to open source it uh databases data stores and I think uh one other thing that they're working on is a um forgot the vector database or they're they're actually turning this also into a vector database is another option so there's open DB they they basically

provide a SQL API on top of any data that you want to have verifiable this isn't an indexer it's more like a true database so you can store and and read and query data and all the data is verifiable and I believe they're also working on archive node service that for verifiable data there as well another one is witness chain proof of location proof of bandwidth they also have proof of one other thing I forgot what it is but it's like a deep in we have uh alt layer alt layer is building these things called restake rollups which allow teams to deploy a rollup along with their own abss for

different pieces of the stack so they have three separate abss that you can deploy along with your rollup they have seen a lot of uh adoptions so far yeah have vital Mock and Squad decentralized verification fast finality and decentralized sequencing and then there's WS is the service that are using end I think Caldera conduit gelato alt layer are all four that you might have heard and then the last one I'll mention this isn't an actual ABS it's using an ABS which is IG da called Mega E you can think of them as similar to monad and the in the fact that they are rebuilding a lot of the execution from scratch and they're focusing on very high throughput very low latency and very low costs around

100K TPS is what they're saying but I'm assuming that they'll probably launch with like closer to 10K TPS if you want to learn and look at all the different ones that we have available you can go to igen layer. xz/ ecosystem I'm going to go quickly to my terminal and just run a hello world abs and then look at the the code base real quick so what we have is this very simple ABS that GES built and GES is here with me again he's on our team along with Wes but basically all this does this is like the most simple ABS you could possibly think of it verifies a string on chain but all of the pieces

are there to kind of build this out into something more sophisticated but I think the whole idea is to get your mind wrapped around the different moving Parts build a mental model so what we have are three files these are like literally the only three files that you need to mess with to play around with this and kind of get everything uh to to understand what what's going on um there there are a couple of different commands that are set and you can read these and how they work in the in the in the readme but there is a command that starts the chain deploys the contracts and gets Anvil working this uses Foundry and then there's a command that starts the operator which is essentially

starting the service so this starts a typescript service now we're going to go ahead and run so let's take a look real quick at what's going on so right now we're monitoring for new tasks okay so right now we're we're monitoring for new tasks and we don't know what's going on because this makes no sense because we haven't looked at the code so let's look at the code and come back so the service that is running is here in index.ts and we're going to go down here to the bottom where we have this main function the main function is what happens when we start the service we

call a register operator which registers the operator and then we call monitor new tasks which is a listener and it's listening for an event to come from our smart contract so monitor new tasks is here the event that we're listening for is new task created and when new task created gets invoked we console.log the uh task and then we call another method called sign and respond to task and this sign and respond to task is the AVS specific verification that's happening so let's go ahead and look at new task created this is the Smart contract it's about 12

lines of code create new task is right here we create a new we have a task that we create a name we set a couple of other parameters like uh the block time or the the block number I guess and then we store these in uh in our local state and then we emit this new task created and then we call this son and respond to task which calls this right here called respond to task and this is like the verification that gets done in order to essentially verify that this method has uh worked properly there are

a couple of checks we have three checks we check to make sure that that we have uh the actual test ID is correct that the operator hasn't responded yet and then we go ahead and store that new task in our local state and then we admit that the task has been uh responded and that's really about it uh the create new task function here is what we're going to be running next and this basically is just going to actually go down here it's going to be a set interval function that just creates a random task every 15 seconds I

might bump this down to 5 seconds so if I go ahead and start that service then this should create a new task every 5 seconds so it should show up here and there we go we have a really basic ABS running now this is obviously not too impressive in terms of like the functionality but I think it's a really nice place to start to understand the different different moving pieces within an ABS if you want to try to build something your yourself so we have a couple of hackathons that are happening

right now that are ours is mainly focused on developer tooling and education so what we want to see built are example reference architectures like hello worlds and stuff like that and you can be eligible to win up to 12,500 usdc and a trip to ECC and if you go to uh the igen layer docs under resources you can see everything about that and then there's also an encode Club virtual hackathon happening and um you can actually submit your projects to both so if you hack on something in Prague and then you you can submit to both of these virtual hackathons also I mean at leasts to the best my knowledge I know you can submit to ours but you can submit to both and be eligible for multiple prizes but uh would if you want to get started

building with I layer I would suggest to check out awesome abs Fork this hello world just run it play around with the code and then fork and possibly check out the more advanced incredible squaring which is using our go SDK and that's about it so thank you for checking out the talk uh I encourage you to grab a programmable trust handbook if you want there's only about 20 of them like I said but if I if you don't get one come talk to me and I'll make sure I bring I'll reserve one for you when I see you on Prague thanks [Applause]