Darren Langley (Langers) - EIP-4788: Beacon block root in the EVM

EthStaker at Devconnect Istanbul 2023 · November 2023 · 14:09

Explores eIP-4788: Beacon block root in the EVM.

Speakers

Topics

From EthStaker at Devconnect Istanbul 2023, hosted by Eth Staker.

Transcript

next speaker it's Darren Langley who is the general manager for Rocket pole thanks again all right um hello everybody uh so uh I'm going to

be I'm Darren Langley I'm from rocket pool so rocket pool is the second second largest liquid staking provider um we uh we're a decentralized equid staking provider so uh we have over 3,000 independent node operators in about 100 uh different Geographic locations um we account for about 3.5% of all of the eth that's being sted in today so um today I'm going to be talking about EIP 4788 um it's kind of like a obscure uh and small EIP but it has a Major Impact um on the staking space and in fact uh as a Staker you should be very excited

that this EIP is going to be coming next year so I should have jazzed up the title a little bit uh this is this is a better title um the name of the EIP is a bit generic um but uh this goes to show that it is actually a a big deal okay so uh what does uh what does EIP 4788 solve okay so currently uh there are still really from a smart contract perspective there are still really Two Chains uh we've had the merge and that's that's fantastic but from a smart contract perspective uh the smart contracts don't know about anything that happens on the consensus chain right the

smart contracts live um on the execution chain um but they have no visibility of what goes on um on the consensus chain now in most cases this separation is actually a good thing right but for staking applications and staking protocols this is a bit of a poses a bit of a chall Cheng okay so imagine a staking protocol uh and there's a staking protocol here in Orange um you you'll notice that uh so this staking protocol um is a bunch of smart contracts sitting on the execution chain okay and the the issue is that they need to it needs to get information from the consensus chain um but it but

it can't so staking providers or staking um protocols what they do is they implement an oracle all right uh now the Oracle transfers information from the consensus chain to the um execution chain inputs into the smart contracts so the smart contracts have that information the issue is that the Oracle the smart contracts have no uh idea whether what the Oracle has given them is actually the right thing okay uh they have no way of verifying that they they've done that so in a staking protocol um situation the oracles have to kind of like rely we have to rely on like an honest majority or like reputation or some sort of

social leverage to make sure that the Oracle is um is is doing the right thing now you know that sort of Oracle system works you know well enough uh but it's not ideal because we've introduced some sort of level of trust um in the system and which we which we want it we don't want to have the other the other big problem with having these oracles is that they can be become uh Gatekeepers uh so you know they're needed let's say for example that you need um a participant that submits some data and you need an oracle to then check that data to make sure it's correct um from the consensus chain point of VI you know then they become Gatekeepers and you don't want that

either okay so what is thep 4788 so what it does is it provides trust minimized access access to consensus information so it helps staking protocols reaking infrastructure uh some me applications and to be much more efficient it also promotes a lot of innovation within the the staking space uh the amazing thing about this is that it is coming next year so Danon uh denune is is kind of in testing at the moment they're going through the the hard for on the test Nets um and so that will be available next year as somebody who kind of builds or helps to build a decentralized staking

protocol I cannot wait for this to be uh in uh in ethereum uh it opens up so many opportunities and as a Staker um you should be pretty excited about the the future and we'll get into that in a minute so how does it work so um the consensus block um has some really interesting information in it okay it has validat statuses or what sorry the the the the state route has lots of information in it so it has the validator status has the validator balances um whether validators have been slashed um it has exits in there it also has a lot of performance information as well now what they do is um there's a

there's a Merkel tree um that contains all this information um and that's all bundled up into this hash tree route which is at the top so this this kind of like string um is is the route that you can then use to verify any piece of information within that block so in other words you can verify um from that from that hasht tree route um you can write a proof that verifies any piece of information within that uh within the consensus uh kind of block and um block state so EIP 4788 what it does is it puts the consensus block group um in the exec block technically it's the it's the

parent of the of the um consensus block but I I'll skip that because it's complicated um and uh so that that's so that's now available uh within the within the block this isn't this isn't that helpful um particularly for smart contracts and because ideally from a smart contract perspective you want to be able to get a block route for a particular time period or um at some point in the in the in the past and so that's not NE necessarily as useful but it it becomes B clear in a minute okay so along with that kind of like Beacon State Route in the execution Block You've also got a new smart contract that's going to be deployed called uh it's actually called The

Beacon root contract but for consistency I've called it the consensus route contract um the idea behind this smart contract is it enables any smart contract to be able to query uh for an individual um uh block route and so you can essentially um give it a a time and it will give you back what that block route was at that that slot um one of the things about this contract is it uses this thing called a ring buffer uh so that um you know the state doesn't keep growing and growing and growing that ring buffer lasts for a day so essentially what it means is that you can query um block routs for um within like 24 hours or a day okay

how the block Roots actually get in there um is so now going to remember the the consensus clients or execution CL sorry the execution clients um submit the um the block route um each time it executes a block um and so they actually put that in there so it's available for um querying all right let's let let's give you an example so that um you can kind of like see how all these pieces um work right so let's say for example we want to um give a nft to anyone who's been on validating on the beacon chain for over a year all right so the idea here is that uh some some validator would call

this mint function on the on the nft uh they would provide a proof to um and the values for a certain information right so they would provide the withdrawal address for the validator the activation Epoch and the exit epoch uh and they would they would call this function from the withdrawal address okay so that you you can kind of link that it belongs to that validator what the mint function will do is it will go to the consensus root contract it will get the consensus um route for you know that particular slot uh it will then use that and this proof well actually verify this proof against that route to make sure that those

values are as expected what it'll also do is it'll check the signature to make sure that it's from the withdrawal address and then you can prove that the person who's submitting this is actually the owner of the um the validator and that they have been validating for more than a year and at that point you can then issue them with an nft and everything's great um so this is a bit of a a trivial example um but you can actually take you know the the basic concepts of this translate it into staking protocols and you get massive impacts um for the the state of staking today so what are those impacts so the F what the future looks like is um we

start to uh become a lot a lot less there's a lot less trust so at the moment these staking protocols need these oracles um but with this Beacon State Route we can essentially get rid of those oracles and replace them with trustless processes instead of like kind of like processes that use trust so what that means is uh you can actually move it from these kind of like trusted actors to participants of the of the network so in our case for example moving it from oracles to our node operators because it's trustless you know and a staking protocol shouldn't really trust the node operators or at least a decentralized staking protocol doesn't trust their node operators and so we have to have these um these

trustless processes um to to for it to work so what this does is it introduces that so it means that there's there's no need for these trusted um kind of oracles anymore uh the other thing is efficiency and this is probably where you know from a Staker it becomes a little bit more interesting um it it becomes a lot more efficient and a lot lower costs because the information is um uh we can verify the information um a lot quicker we don't need these oracles to to send over the information um it can all be done um in a kind of a trustless way by somebody submitting the information themselves with a proof um and then uh we can we can verify that that is is absolutely correct uh it also kind of yeah there's

a lot of efficiency improvements within that so you know from uh if you're a liquid staking token holder or if you're a node operator uh Within These um staking protocols um this is going to make a big deal to you uh the other thing is around Innovation so you know there's a great opportunity to improve the current staking protocols um you know the exist today but also whole new um types of staking protocol or different ways of of kind of doing similar thing but in a much more efficient way okay cool so what are the resources uh so the EIP itself is actually quite approachable um I'd kind of recommend uh having a read um the uh there's actually

a a brilliant series called um Peep and from the ethereum cat herders uh this one in particular has um Alex Stokes going through the design decisions around uh EIP 4788 um and actually a big shout out to Alex he's kind of pushed this um this EIP very very well um yes thank you very much the long story short uh EIP 4788 is going to change the staking landscape uh it's a very important EIP even though it's a very small one um but uh yeah be excited for the future that's me thank you we certainly have times for any

questions here I see some hey thanks Darren um can you just explain again the purpose of the Ring buffer in the um the contract yeah so um so basically we don't want the state to be to to kind of like grow and grow and grow um because it means that that's that's going to um uh cause a lot of chain chain blow um so the idea behind this is to um have a a ring buffer that uh keeps it to just a day worth of block routes um in general a day is is perfectly fine uh you you only really need it for a few you need enough um

time for like a few blocks maybe um to make sure that transactions can kind to get processed um but in general you know day is ample um for this sort of uh this sort of application any other questions all right well once again Darren thank you very much for an excellent presentation