DAPPCON 2019: The Finality Gadget, Putting Eth 2.0 to Work - Alex Stokes (Ethereum Foundation)
DappCon 2019 · August 2019 · 20:09
Alex Stokes of the Ethereum Foundation discusses the finality gadget behind Eth 2.0 at DappCon 2019. He covers how Casper-based finality complements proof-of-stake block production, explaining the mechanics that let validators economically finalize the chain as Ethereum moves toward its staking-based scaling roadmap.
Speakers
Topics
From DappCon 2019, hosted by Dappcon Berlin.
Transcript
we're gonna talk about the finality gadget which is a way to use aetherium 2.0 to improve aetherium one today yeah so aetherium that's ideally why we're all here it's this cool blockchain thing you probably heard about we can do post up with it right so crypto kiddies 0x maker we have the stable coin die auger with prediction markets always applications people are thinking that we can do that I really weren't possible for and really what we'd like is to kind of have this like you know unbounded capacity to like build all these applications in a way that like no one really has to like worry about you know this sort of scaling of these apps or
really any sort of permission in that way there's a problem there right as we kind of all know because the etherium that we have doesn't scale in this way I was just talking about and so we have some ideas around how to make the theorem go faster this is called a theorem 2.0 so it's building on like several years of research here to do this and it's really this like batch of upgrades to the network initially we tried to upgrade the existing network and it turned out for a number of like technical reasons that wasn't the right idea so we're kind of start from scratch with this new system it's gonna have a bunch of stuff like prove mistake instead of proof or consensus scaling with shardene which I'll get into more
in just a second and ultimately we want you know these flexible save smart contracts to do these applications we all know and love but a lot of them really fast so hopefully you'll see that like this whole undertakings like pretty complex so it's gonna be good if we can take as conservative as conservative and approach is possible to actually pull this off and a good way to do this is actually like to employ chunks of this thing in phases so if you follow this stuff at all you've heard about these different phases there's zero with what's called the beacon chain there's one with what we're gonna call char data chains and phase 2 where you have kind of what you know today is aetherium but
in this like scalable fashion so I'll kind of touch on each one of those and just to give you some context so the first one is phase zero it's the speak in chain you may have heard of and it's kind of the system of a blockchain it's where everything in the system for the scale insists or the shortest system is like kind of coordinated you can think valley there's like live on the beacon chain the consensus of this blockchain so it's a whole new blockchain and depending from the existing chain that part will be important as we go to the finality gadget so I'll say like f1 f2 a lot to refer to like f1 is today and e2 is this new thing we're working on so yeah beacon chain Casper proved mistake which we'll get into a lot more in a second
and to begin in this first phase there's kind of just like stubs for like the shards where in these future phases will then add them in and right so I had this cute little picture here is supposed to be like blocks on the beacon chain now we moved to phase 1 and in phase 1 we like add these shards so you have these little circles or like the shard chains or started blocks and the idea that supposed to be like a thousand 24 of them that's like the current number we're kind of targeting and at first they'll just basically have like random data in them they won't sort of mean anything in the way that transactions on ethereum today have like semantics of the EVM right and there's this cross-linking thing basically again like
the shard state is kind of patched into the beacon chain and that's how everyone keeps track of the whole system then we moved to phase 2 the last phase of getting what we have today to like a very scalable place this is where we can then have all these applications across all the shards and should be awesome so yeah we have these phases and there's a lot going on we're actually just with phase zero today so there's a spec freeze the sort of actual implementation of this stuff has been going on with a lot of research to date into the actual specification the specification is like
a sort of detailed list of like what the things should do which then implementation teams can go and like actually put into code right so we just had the spec freeze for phase zero which means anyone can go now there's a beacon chain spec you can go on build a beacon chain there are something like ten or eleven implementation teams today who are doing this and it's this huge effort we're just the beginning of though right and then you have like phase one or phase two and you're like well I want my super scalable cheese wizards like when is this gonna happen this is the question you know that you always get so the short answer is that it'll happen when it's ready I'm not being cheeky but he's like you know it's very important we get this right and so we don't want to like
rush anything or like move ahead of time when it's not not the right time so recognizing that you know the stuff could take some time do you since we're looking at a zero launch first quarter of next year and you know then you could imagine some amount of time for each phase after that so it'll take some time to get to this cool Phase two thing that everyone is after and in the meantime we have to ask like how can we approve aetherium that we have today right like there's just really successful Network otherwise like how can we how can we make it great so there's a bunch of ideas people have had for even before youth to was the thing
about how do we improve the theorem and this kind of planet in this constellation of stuff called aetherium 1x so there's a number of stuff like state management right so like if you talk to people there's like this huge bottleneck in terms of the state growth of aetherium so there's like ideas around how to improve that there that's like some sort of fees for state or something like this updates to the EVM itself so like the actual virtual machine could use some love so there's some ideas their protocol economics if you follow Aggie IP 1559 this is like changing how fees on the network work and it should have some nicer properties one of them is the finality gadget and that's what we'll spend the rest is talk on quickly though I just want to throw this out there that there are other ways
they eat to kind of help equal next year right I don't have time to go into them today but essentially do like briefly touch on them with phase one we can actually think of using the shards to essentially provide this like scalable data layer to aetherium today and that's helpful because we can do things like plasma zk roll up that need basically more block space we can give them the char box space because you recall there won't be anything except random data in the box then they went to phase 2 the plan is to ultimately like roll anyone in to eat beef 2 and so you have like today's from our contracts but again this like very scalable charge system okay so the finality gadget the main idea here is that we're gonna
deploy the beacon chain which was this like sort of you know initial system level chain there are validators building this chain so whereas in like proof-of-work you have like miners right we now move to approve a stake model where you have we're gonna call validators validators are building this beacon chain in the particular proof of stake algorithm that we're using it's called Casper Casper has this property you call it finality which basically is like the economic security that maintains again the security of the chain so the idea here is to basically use the security on this proof of stake chain and apply it to the existing proof work chain and that's like the high level idea again I have this cute little picture here there's like the two Oh chain at the top so this is like the
beacon chain the green squares our beacon blocks then you have the 100 chain these blue squares are like proof work blocks and this like gold sort of ray stuff the idea is that's like finalizing the 100 chain so high-level idea the Canali gadget can kind of be seen as two pieces there's a finality engine which is what's happening on the beacon chain and then this process of eath one data so again finalized you've won by now the gadget so let's look at this finality engine see what it's about
and the normal case here we have validators on the beacon chain and they're basically doing something called making not two stations these at two stations are here's like my local view the chain right now yeah and then what happens then is as these agitations are gathered on the beacon chain you can then kind of summarize them and that leads to the consensus here so with these blue squares again well in this case they're actually beacon chain blocks these blue arrows are supposed to indicate validators are like starting to we could think of those like voting on blocks right so they're starting to vote and there's like some votes here so then we get to sort of this first key property
of Casper where values justify blocks and the justification here happens when valuators across the whole set at a current point in time when more than two-thirds of them have attested to a given block we call it justified so that means that sort of by stake again there's a notion here where validators to put down some Eve and a sort of finalized bond if they do something bad then that sick can be taken away and that's sort of the key security property here so you then have this property of mystification how this works then is that once 2/3 of the active stake has attested to given block and these are
like you know sign messages on the network so anyone can see this when you've hit this threshold then we say we justify and that's why I try to indicate here with this like gold arrow so like we can see like validators as a set have said hey or at least we'll say more than 2/3 of them have said hey from this first block to the second block we think this is in the chain so now it's justified and like similarly you can follow the arrows you notice we skipped when he and that's actually okay if two kind of prioritizes liveness over consistency which the idea here is basically like let's say for some reason there's like somewhere network latency and like most of the set is kind of moving forward like want them to progress on the chain and not be stuck at this middle block
because then the network can't progress then we see another justification and then we're at sort of the tip of the chain here and we just started to justify we haven't hit this two-thirds boundary yet and so that's why you still see this like blue arrow hopefully that's clear okay so now we're quickly going through like how Kaspar finality works so we've justified blocks we can do that the next step here is called finalization with finalization you have to have a justification on top of it justify block so let's just take the first two here let's say the first block is Genesis block and there's like a sort
of special case that the Genesis block is finalized that's sort of your base case and holds after that so you start with the Genesis block and then we have this gold arrow the first gold arrow and that says right that it's justified more than two-thirds of validators on the network I've said yes I think this next block is the canonical block after the Genesis block so they do this it's justified and what that would mean is that now the block before it the Genesis block is finalized but it was already finalized so that's fine we moved to the next one and we see now there's another gold arrow so like validators have justified that and because they justified this blue block after the second gold block right
that means that that one is now finalized and so when we finalize a block there's kind of color theme here when we finalize a block it becomes gold right and you can kind of follow this and see so again here like you see that because we skipped this block ultimately there was a justification made but not to the skipped block and so because of that you can't have like a directs child of this first blue block be justified so because of that you can't finalize that block but that's also okay because again we're we are favoring this like liveness property in the sense that like we just keep going okay also jump in ask questions if you want
right how it so right so the important bit the important bit is the justification chain and then the finality chain if you like it like that or the finalized chain is like sort of drive from that so as long as again as long as you have this direct child property of justifications then you finalize the block and then there's some more stuff which we'll get to in a second called slashing conditions and these basically mean that as long as these rules hold then like this is safe it yeah it means that's not finalized
but then you finalize down here and because these are in one single block chain like it kind of implicitly finalized that behind it that makes sense like if you finalized up here so like one way to look at this is that when you finalize a block it becomes a new Genesis block all right yeah based on the value set so you have to follow the valuer history so but you have to define what crapping it means so it's a valid block so you start where you start with like all
possible blocks you end up like a tree of blocks right then on top of that you have Casper running then you have from there right you want to pick like one chain that's me it's like the justified tree from there you can have this finality property and given the slashing conditions you basically end up with a single chain yeah unknown blocks um so yeah I mean there's like a block tree here in general but we kind of confuse things to go into it basically you can imagine that like well we'll get that hold on here okay this is what I want to show you anyway like you could have a
fork here and so basically like you the valleys would pick a block and then what we're starting with is this like 2/3 special and that determines with the top block is so these are the slashing conditions that I was just talking about this is why it's final the way that it works is basically there are some rules like one of them being you can that you can't justify walks at the same height and so as long as you have that then this can't happen without getting slashed which implies delay instead of the steak so you like burns to me right and this is the security because essentially giving these rules and how this game is playing out you end up with the single chain as long as no one has forfeited their deposit and that's like
where you get the security here because then you may still have to say hey like you can attack the chain you can try but if we catch you you're gonna lose all your deposit which can be made arbitrarily large right so as long as no one wants to lose their eath which we kind of are expecting them not to but then you add with the single chain because what would happen at this work here for example right is that like you would end up with 2/3 there'd be a minority on the top and so you wouldn't finalize and just to put some numbers to this sort of a reasonable number we could accept in terms of validating on the beacon chain would say would be say 10 million that then implies a third of that would
have to be burned under a successful attack to get this scenario right or there's like the divergent pork I just based on today's numbers that's like over 620 million dollars so it's a lot and we'll get to this bit later but like a key property is that I this is sort of per attack so like if I went oh okay I lost track of time I anyway it's very expensive so the other half to find out a gadget is that there's eath data entering to the beacon chain and that's how we end up knowing what's happening on the etherium one chain that goes into making this final gadget work so there's
some stuff here there's a deposit contract I'll post these online after so you can read them if you'd like but essentially the the key idea is that to be a validator in the new system you make a deposit on the etherium chain today that then is like a proof that can be used on the beacon chain to enter into this validator set what this means though is that the beacon chain needs to be a light client of this smart contract that's managing the deposits and that's happening again through the existing validator set whose putting the sequin data on chain as we do this though we're getting each one data on the Tor chain as the two of chains being finalized we're finalizing that each one data say a block hash which then implies that
that block and the chain is finalized this is the finale gadget why do we want it again better security because of the way this works is that if you know we have proof of attack we can basically delete your stake it means that you have to have this much eath like per attack which is way more expensive than say the pre-work case where like the best you can do is like change your before kaga rhythm and but that will take longer in general again then you have like finality which again has this huge like economic incentive to not revert on the report chain today which is useful for dabs and stuff this is a one that people like is that we can also then because we have this Casper security on the pertain
we can actually lower block or words lower issuance yeah and we get this tangible benefit out of e to like way before the whole thing has been rolled out so it's super great basically like it's early stages for the found a gadget but this is the idea and what we're trying to do I started this working group so if you go on 8th magicians you can like learn more there's a telegram group if you want to join I've written a lot more about this on medium again this is my handle on all these things so ask me questions read his stuff I'm happy to help
oh yeah that's it [Applause]