Stateless Ethereum: a preview / Guillaume Ballet

EthPrague 2023 · June 2023 · 19:57

Guillaume Ballet previews stateless Ethereum, the effort to let validators verify blocks without storing the network's full state locally. He explains how Verkle trees and witness data work together to let a stateless client check a block's validity using only the proof shipped alongside it.

Speakers

Topics

From EthPrague 2023, hosted by ETHPrague.

Transcript

hello um yeah in this talk which is going to be a bit less technical than what I usually do I just want to explain what stateless ethereum is and more importantly what you should care so a couple of months back I finally decided to go uh you know with a home staking solution I wanted to build um I would yeah wanting to build my rig and everything and you know I I realized the the front like the The Upfront investment was already quite uh stiff I mean obviously there's the 32 each but on top of that you need a good machine you need to pay for electricity you need to pay for a good internet connection

so there are obviously some other Solar Solutions you can do that cheaper you can for example use the Raspberry Pi which is what the ethereum on armed guys are doing they're awesome talk to them but nonetheless these methods are still um you know they're not they're not for the faint of heart they're they're quite difficult to to manage um so yeah I I went for the standard option and then what happened is that I found a lot of problems I'm not going to go through the whole laundry list of my first world problems but there's there's one thing uh you need to realize when when there's one

thing you learn when you start doing this is that you don't know your how good your ISP really is before you start staking and you don't know how you're how good your electrical grid is before you start staking and that you know that's a lot of stress because you always like what if I miss a block you go on holiday of course the validator crashes and you can't really uh you can't really uh reset it so uh yeah as a summary it's expensive it's complicated it requires a lot of babysitting and as a result ethereum centralization increases because why would you go through all the you know the the heartache and the

Thousand natural shocks that sticking his hair too when you could just dump your uh like let's Amazon handle the internet connection the power cuts and everything or you could just take on on Lido um and while not those none of those problems are you know uh centralization per se they're still relying on a reduced set of actors and that makes them uh that makes the whole ecosystem like ripe for or at least makes capture of the entire ecosystem easier so let's revisit this you effectively have a dilemma either you choose the pain and uh the rewards I guess of homestaking or you go for a centralized

solution but there's nothing really in the middle um how do we fix this well there's no obvious fix there's no simple fix of course but when it comes to at least we could solve a few problems that would make things a bit more manageable and one of them is the state uh just the size of the sorry the size of the ethereum state is growing and growing and growing and that become too up to a point that it becomes unmanageable so stateless ethereum is looking at at solved solving this problem of course I have to mention the existence of right clients so what is a light client it's a it's uh it's a node you you run a

node but it relies on a different uh it relies on the full node to to do all the checking to get the data so it doesn't handle the data itself it just basically follows a note so it puts a lot of trust into a different actor Ergo that's a risk of of centralization what State sorry what stateless clients do they basically try to find a sweet spot where you have a maximum trust as exactly the same level as trust as a stateful client but the power consumption or the the power you need to run a node is much much uh lighter so what is stateless ethereum it's

basically what I said it offers you the ability to the same level of trust the same functionalities of as the real like the state full ethereum but without storing all the data and stateless ethereum is composed of four major uh Endeavors I will only talk about the first three because uh Matt AKA like client will talk about the fourth in this presentation here at 3 40 p.m so be there the first uh the first Endeavor I'm going to talk about is the one I work with I work on it's vertical trees what are vertical trees is just a Nutri structure we change the so all the data in ethereum is stored in a tree we just

change that structure like the the shape of the tree if you will and why do we do this it's so that we can when we need to prove things that are in the tree uh we need less data to to to do so it takes the less space to to to prove that the data is in the tree and uh what do we do with this proof we simply prove uh enough data and just enough detail that we need for the execution of a block and if we have all that data and no more but no less we have exactly where we need to run a block without storing the state locally we download the block we execute it we've validate it's correct and we uh well we take whatever we need from it and we throw

away the data um yeah so how do they work very very uh short summary this is this is the representation of of A3 of course the current etherm tree and vertical trees will be much larger much wider much deeper um and if you want to prove for example so this is a very contrived example but if imagine that Pink Spot here represents your account like you want to send money to uh to an account let's say money to yourself because that's a very very contrived example um and all you need really you just want to prove okay this is my account this is how much data it's got so you're only

interested in that tiny bit that tiny ping a bit of the entire um the entire tree so what you do in the current method you have to pass for each level you have oops okay that was too fast yes okay you have to pass every sibling so of course once again this is a very small example but you have to pass sibling of which there are more than one on every level so if you use the current model of the tree each proof will be for a typical block 1.5 megabytes that's a lot with vertical trees the the proof system

um yep still not uh okay okay uh with vertical trees you only need to pass the data along the path so this is ex this is a great approach because you can make like it it kick-starts a virtual cycle you can afford to make the tree much wider if it becomes much wide wider it automatically becomes much more shallow so the path gets even smaller even shorter and um the consequence is that you can take that data and pack it into the the header field of a block and when you do this you can like whoever receives this block can take

that data and reconstruct just the view that you need to execute the block so in that very contrived example or where there's only one account that is being accessed for example it's red um you just this is this is the view of the tree that you need and this is what you get from from the proof so why don't we use them already the problem is the size of the state it's it's huge uh so we need to perform a conversion and currently we're looking at a pro an approach where uh in we have a transition period with two trees the old tree format and a new tree format and every block we move maybe a couple thousand leaves from One Tree to the next until all the data has been moved

and then we can forget the old tree um so we have written uh all right so I wanted to say it we estimate it might take depending on how many leaves we we transfer per block it might take two weeks it might take one month if we relax even more like if we transfer even less leaves we can be a it can be six months but we're trying to do something uh I mean it doesn't look like it's going to be that bad uh so once you see this once like we we have a we have a prototype that uh just uh perform the transition and you see this message because each hard Fork each major hard Fork has a spirit animal we haven't really decided on one for vertical trees but I just wanted to point out I'm on

team elephant um uh okay so the second approach is uh the portal Network so if you think of the ethereum network you can sort of see uh imagine the all the all the computers being connected to the network in some kind of big giant Circle and as it turns out everybody has okay it's kind of hard to see on the on the screen but everybody has the same copy of all the data this is a bit wasteful so we could imagine that actually some computers have some nodes only have you know part of the data and if the node at the bottom wants to get some data that it doesn't have it simply requests the

data to uh like from a different machine and gets it and he gets it of course it gets the data with the proof which is great we just I mean we were talking about vocal trees verco trees allow for smaller proofs so that makes the scheme even more practical uh and the last uh like Endeavor I will talk about is called State expiry and it's I would say on paper it's the simplest you just forget the data so you say whatever address was created Leicester or touch or accessed less than uh more than a year ago you simply forget it um of course it's not completely

forgotten the cryptographic uh Primitives will still work but to recover it to resurrect it you need to pass a proof and if you pass a proof um you know did I mention that vocal proofs are are smaller you could resurrect just this bit of the state and proceed as if it was never deleted to to begin with this sounds pretty simple it comes with a lot of usability problems so currently the that effort is dormant we are not really worried about this because it can be addressed later first of all and even if we never get to this the I think vertical trees and portal Network were probably enough to to buy

buy us a lot of time so okay uh last part of the presentation what uh is more like let's imagine how um like stateless could make uh is there a more decentralized so this is the typical View that you see when you're staking uh you this is like your your income stream you have at the bottom what you earn every time you validate so because that's the way proof of stake work everybody needs to validate the like that the blocks that are produced are correct and to do so to motivate people in doing so you just you receive a reward a tiny reward I mean which is nothing compared to this

huge reward which corresponds to a block being produced so the block being produced is uh like the block reward comes in two pieces there's the consensus reward per se and then there's all the fees that where the green part is all the fees that were accumulated so let's see how we can unpack this uh with the help of stateless one thing we could do is create a first mode where we say well I don't care about the block reward uh I can I'm happy just validating so just this income this is great because okay you don't get like the big fancy Spike that makes your hearts race so you're a heartbeat race but uh you also don't lose sleep you're

not gonna miss uh building a block because you're not going to build a block so you still need to come up with the 32 each but you don't need to store the state because you will get the block with a proof package you can run the blog verify it's correct and then uh sign like Pro a test to the block and say this is correct so this way you can start using machines that are less powerful like Raspberry Pi's uh well okay maybe not Raspberry Pi's but uh you know our machines and um you don't uh yeah you don't do you don't need to store the state you just do you just do the the simple thing you can take the opposite approach we say

which is to say I'm not really interested in validating I'm just here to produce the block I mean technically this is more or less what the Mev Searchers are doing already they don't bring any stake they just have machines that can do a lot of computing so you know those those will remain stateful for for the time being um and it doesn't matter if uh if they don't put the stake because if you produce a block and uh your stake becomes uh and uh sorry and you produce a block and it's invalid you have an army of sticker that has just increased because of the of the other strategy this strategy um so your your army of validators will uh definitely make sure that your block

was correct otherwise you will be your block will be rejected so you lose the the big fancy like the the the excuse me the spike uh and also potentially uh if we imagine putting some kind of stake still you would lose your stake um and then there's the third approach so this time it's only execution income so what happens if you are you know just serving data to the portal network uh well presumably people will pay you so that you serve the state for them so this uh this strategy here does not even need to store the the state eventually all they need to do is prepare the block and when they realize

they need a piece of the state they just send money to whoever is on the portal Network willing to provide it to them and then uh this is what the what the server on the portal network will uh we'll see just uh fee income coming from from their serving and you don't really need to store the entire state to get this kind of of reward so you can also once again run on very inexpensive machines low power machines um yeah so that's that's the the idea so uh that was my last slide I have um yeah so I hope you underst you at least you you got I got you excited a bit about stateless ethereum if you want

to try it we have this uh test net so uh come and come and break it and this is a bit of a long address but this is where we give our updates I need to come up with a with a smaller address but uh sorry yeah I should have put a QR code but I will uh I will put uh I mean I'm sure is Prague will will share the slides and if they don't I will so there's no there's no issue and yeah that's pretty much it if you have questions I think we have time foreign yeah very nice talk for uh you know

retrieving the data that you need in this stateless ethereum I presume you will use something like a DHT or something like that maybe I don't know what is the the the the structures that you plan to use but I'm curious how do you compare this with Dan Chardon in which you know in Blobs of data of the blocks are also kind of distributed across nodes is it similar or not at all okay so I didn't quite hear the the like the whole thing but you're asking uh how is it how does it play along with Deng sharding right yeah if the structures are more or less similar or not uh so it uses okay it's similar in some ways and it's different in other ways it uses the same let's say set of Technologies like proving things although it's not exactly

the same uh Deng sharding uses something called kcg commitments we use another proven technical IPA um but yeah it's it's not I mean vocal trees and uh I would say vertical tree stateless and then sharling I've been invented more or less by the same people um so clearly it's meant to play along it's not it's not competing if that's the question uh you could eventually assuming then sharding like the full-scale Deng sharding happens um that would be uh like they would play nicely together because if you start you know a validator set could be shuffled between uh shards and if you find yourself uh on one shot and then you realize you have to start validating on

another one uh you get your phone on another one what happens is that you need to think unless you have record vertical proofs that you don't need to do a thing for basically any other questions no okay hey you um uh I was wondering Beyond just allowing ethereum clients to start becoming stateless moving the stage try from the Merk Patricia tree to a vertical tree are there any other kind of applications or use cases you think that this will enable that's not very that's not really possible today well so one thing that would be that I can think of of the top of my head is um just like reducing the disk uh space

like just because the vertical tree is more shallow it will take less space on disk at least that's the Hope um is there anything else well yes of course uh there's uh the potential to move to ZK proofs because the MPT uses a hashing like technique or hashing primitive that is extremely unfriendly to to ZK proof with vocal 3 we start we went for Primitives that can that make it easier for people developing the ZK system or ZKA proof system to uh yeah to build circles that are much cheaper so that would be I would say I would say the the other major um yeah asset of vertical trees

time for one more question takers all right thanks [Applause] [Music]