(Proto)Dansharing and collective KZG ceremony Catropy contribution / Mário Havel

EthereumZuri.ch 2023 · April 2023 · 31:39

Mário Havel explains proto-danksharding, or EIP-4844, a planned change to the Ethereum protocol that introduces ephemeral data storage in the form of blobs. He also covers the collective KZG ceremony, the community trusted setup that the upgrade's KZG commitments rely on, and contributions to it. The talk was recorded at EthereumZuri.ch 2023.

Speakers

Topics

From EthereumZuri.ch 2023, hosted by EthereumZuri.ch.

Transcript

foreign [Music] thank you so much uh let's see if this works uh awesome awesome yeah thank you so much all of you folks for coming I'm very excited to have you here because I will be talking about some things I consider rather important I'm going to talk about the next ethereum upgrades about its scalability and how cats fit into all of this and uh yeah um maybe you heard about the summoning ceremony maybe you heard about dunk charting again that's what we are going to uh dive into today because the Whispers from the Shadows Tales of

powerful Spirit of dankshard so what is the the Dank shard and to understand that we need to look at the ethereum roadmap first so you might be familiar with this picture it's the updated roadmap from vitalik from like maybe a year ago almost or something like that a few months back and as you can see we managed to do a big move here where we finished withdrawals this week in Chapel of course the biggest upgrade in Chapel was push zero but it also withdrawals and stuff I mean huge huge kudos to all devs to uh finishing this because so we we see there are multiple tracks multiple uh these boxes of things that needs to be done on ethereum that people

are working on implementing and researching and um uh today I'm going to look deeper into one of these boxes especially the surge and as you can notice the surgeon is talking about the scalability about eip4844 and having what is it say 100K transactions per second oh my God roll ups yeah I I hated the the the estimations there but um yeah let's let's work with this so we will talk about scalability and um what does it mean or what is the problem here what do we even need to talk about this is the three Lemma or dilemma that we have in blockchains because the whole point of ethereum the whole point of Bitcoin the whole point of this ecosystem is to be decentralized and secure

um in a way that each of the people are sitting in this room I would say and many many people in the world are able to actually verify what is happening in ethereum that's what makes it trustless that's what makes it centralized it right all of you I see some folks with the computers here I believe all of the computers I see here are able to run the ethereum client and verify everything which is happening on your interior but to verify everything means that the more finger more things there is in the everything the harder it gets the more computation you need the more storage you need the bigger computer you need and it gets incredibly more expensive that means that just just the richest from this room

would be able to uh to uh verify it and the digitalization would be sacrificed so our goal is to actually scale ethereum to enable to put more things in there while not increasing the the demands the requirement for uh for verifying everything um and uh well the reason for it uh it's supposed to be a gif but it's a PDF I'm sorry but yeah um so the the reason for it you might notice especially in those days of D5 summer that the gas are pretty high um uh and uh that's that's that's that's the thing right I mean we've been

talking about you having some World computer accessible to everyone but if it's going to cost 10 or my run now right now it might be a few dollars or tens of dollars sometimes maybe hundreds of dollars per transaction that's not very inclusive so we want to make ethereum um to be scalable which means enable lower fees and at the same time stay decentralized as possible so Here Comes The Surge and The Surge is uh the search is all about the the layer 2 scale link you might heard about that and um we'll get there but first uh uh you might notice the word in the in the beginning the sharding because it all starts with that like the sharding

is this this um this thing in ethereum community which was discussed since like years and years ago I don't know seven years back more 2023 like eight nine years maybe and um uh the idea was the execution sharding in a way that um soon in right now we have uh after the merge we have ethereum the ethereum right now looks as the the execution the actual the actual data all the transactions all the contracts which are uh driven by the beacon Chain by the coordination layer which is which is doing the consensus uh that decides what is uh what a what a validator consider or um uh valid or not and um uh the idea

of shorting is that we use this Beacon chain layer to actually coordinate not just not just the ethereum execution as it is now but many other layers or shards and um the the sharding was something which which seemed like far future a few years back and it still might sound like where are these shards we are still hearing about but today we have the layer twos right the uh the ZK your optimistic layer twos and uh these are scaling ethereum today and um how Roll-Ups work just to just to give a quick summary on that well they interlocked the daytime put them on ethereum um the idea here is that

um in well in case of of optimistic roll up or I mean in both uh we have basically a separate chain the its own network execution layer and and its own data and uh we just either create a proof or just compressed version of this data and we put that on ethereum so imagine that I can do many transaction on the layer 2 and or on the roll up and uh uh I pay for the gas fees on ethereum itself just for a fraction of it because I'm able to um I'm able to uh roll it up like this and I have two ways of doing it either using some fraud Pro mechanism which

which can decide if there was uh something executed not correctly on the on the layer two or uh using validity proof in ZK um but no matter what I'm what it means is that I take this take this roll up data and I put it on ethereum so yeah it is what I was explaining this is how the ethereum looks like right now we have the consensus layer the execution layer all the transaction the evm the ethereum state is here and roll ups are putting more data into the state they are using what we call call data to basically just store their their transaction data or the validity proofs in the in the ethereum itself so we have this bunch of these Roll-Ups

they put the call data to ethereum so this is how it looks like today and if you try to use Roll-Ups um you might notice that it's still not as cheap as some people would like to it's still a few cents maybe a dollar or even a few dollars per transaction when uh the fees on the ethereum goes High because well the the the the fee that you pay for the Roll-Ups is mostly determined by the still by the ethereum uh mainnet gas fees uh that's because we store all of the all of this data on ethereum arbit room is missing here which is like the biggest track it will be like more than 10 gigabytes of data so let's say we have like 20 something gigabytes of data stored in ethereum uh that's that's like

incredibly expensive and all of your computers if you're running those notes are storing this data which are kind of useless if you think about it because we already used them so the so we have because in these two mechanisms uh in optimistic roll up you um an optimistic grow up you uh can create a fraud proof only in some given period so uh if after a week nobody create a fraud but nobody create a proof that the execution on the layer 2 was incorrect based on the layer 1 data uh uh if nobody does that then uh we we consider it I don't want to say finalize but unchangeable nobody can

challenge it anymore and after this week or a few weeks let's say the data is still sitting in ethereum but it's completely useless because well it it can be used for the fraud Pros anymore uh in case of ZK it's similar we have the validity proof and if it's verified and settled once like why should we why should we uh keep it forever there um okay so now enter the proto-dunk shirting I'm sorry I have alarm because I used to wake up at this hour and it's another phone I'm sorry yeah okay I think I just snoozed it let's see you in 10 minutes

um anyway so so so uh we are putting the data on ethereum itself but with the prototank sharding so the pro dunk shirting is the EAP Freight for four also called um the block carrying transactions so we are introducing these blobs basically a new kind of transactions and this transaction is special because it has a backpack it has a backpack called blob and in this blob we have arbitrary data we don't care what data this is just some some chunk of data that the transaction takes and puts it actually on the beacon chain it's put it puts it on the consensus layer in a way that sitting here it will disappear in a few weeks we will store it only for a month let's say

and uh while we are storing it there what what the hell like how can we reach it in the like what I'm doing right now is I when you talk as a user your wallet your or if you're a smart contract Dev you're talking to the execution layer you're talking to the to the RPC of the node right and that's accessing all of these data in evm but the data is not there now we don't know anything about the data but what we have is a commitment to this data a commitment you can it's a sort of a proof that the data exists or existed at a time in this form so um as a layer two I'm connecting I'm

connecting uh here to the execution layer and I verify that the data uh my role of data is in the blob on the consensus layer based on this commitment this kcg commitment so yeah um that that's basically what we are trying to achieve why because now if I don't need to use the call data here I don't need to execute anything in the evm I just create this kcg commitment from a pre-compile and it will be it will be uh uh basically no computation and um and the data storage is ephemeral right it uh the the data again the blobs uh doesn't have to be there for more than

few weeks because then it's useless for the fraud proofs and uh we we the the layer 2 needs to keep its history by itself anyway so um your node will just store uh this data for uh like some bigger amount of data just for a few weeks then dumps it so there is some upper limit that it reaches and this way we can save a lot of resources and still uh save bunch of data and therefore make it much much more cheaper cheaper like magnitude amount uh magnitude level of cheaper and uh yeah there is this discussion that like it's not really execution sharding because we are working with The Blob data so the current meme is uh that it

dunks we dunk scale The Blob space um just it's like the latest uh latest uh is the upcoming upgrade now we had the chappella and the next one uh will be will be dencoon that's that's the current Focus uh right now that's what is considered for the inclusion there and uh um the court of communities now uh doing its best to uh finish the research to finish the implementations on the um on the 4844 or the the bank scaling developed space so um now back to the commitment back to the idea I don't want to I don't want to

dive deep into it but the idea is that we have a polynomial the kcg commitment is basically a polynomial commitment what we are able to do here is like represent the the pieces of data that we have as a polynomial and uh if you have a polynomial you can you can uh you can prove it that you know the data without the data itself just by referencing some point on the polynomial right and the ktg is a bit more complicated but it's one of the one of the ways how to do it and it was it was uh decided to be used because of its features here is a nice summary of various ways how it could be done and you see why kzg the First Column here

was was chosen to do it so we need this kcg cryptography to create commitment for the proto-dunk shirting um and then for the dunk shortening itself so so the idea right now with the 4844 is to create basically to to take the current layer twos and uh thanks to this cryptography make it uh make it more scalable but already forward compatible with the four full dank charting so the Dank short link right now is uh his idea is based on data available to sampling I don't have to go there but like the full full dunk shirting will be uh based on like uh reading pieces of data from from the

various charts and um and uh uh thanks to thanks to the data available sampling uh basically it ensures that the data is available again thanks to polynomials thanks to that you can uh you can uh um it's like the Erasure coding like in the DVDs right when you scratch part of your DVD it still plays because it can calculate what is missing there so so this is like the full dunk sharding and before we get there we get this protraunctioning is named after dunkrat Feist who was rich researching kit and the product sharing by Proto Lambda who took the idea of already using the kcg to create the blobs and as you can see here the the the only problem with this

kcg or like the main problem first of all is is that we are using um uh we are using uh ecdsa we are using pairings it's like a bit more complicated cryptography so like there is some complexity to it but the main problem that you can notice is that it requires the trusted setup now that's a scary thing and many people um many people were scared to hear that ethereum should have some sort of trusted setup because it's something which uh didn't gain a lot of trust in community over past few years I think now what is the trusted setup um so so yeah trusted setup is a way how we are going to invoke the spirit of

dunkshard this is the spirit of dunk shirt it's a dankrat as a spirit um so so uh right um yeah first of all so um the the thing here is that for kcg or maybe also like snarks some ZK cryptography you might know that we need what is called a structured reference drink like some some secret which is uh which is created uh for the for the cryptography setup and um it needs to stay secret because it's used to actually create those proofs uh we uh this is this reference point and in case that somebody knows this number the secret number they can create false

proofs they could create commitment to data which doesn't exist let's say and uh he would break the whole whole security setup of ethereum so we need to create we need to craft this number in a way that it's um that nobody knows it and nobody can reveal it that's not an easy easy task but that's what a trusted setup is and um it works uh we are going to do it with so-called multi-party computation ceremony uh which means that many people can connect to the ceremony using their computer ad to this computation and uh ah we get output which is which is setup but not one person but by many people

uh you might heard uh about like many of these setups in history basically any any scenario like starts with z cash where they did it like maybe 10 people in a hotel then they destroy their computers so they don't store the data which which uh created the setup but there's been many other other of these ceremonies uh for Toronto cash for example for Aztec in ethereum and um how does it work in these generally in these ceremonies what we are using here is called powers of Tau and you can imagine it as a relay race uh because it works in a way that uh we have some initial setuper and now uh uh the the first person

adds his secret adds his data and uh that's the computation creates basically a public key which is not revealing the his secret it's just the public part uh passes it to the next person again he adds his secret does the computation creates a new public key or the public data uh and moves it to the next person and and and we create this chain of people with each person uh adding their secret to the system and the Assumption here the whole security assumption here is that uh unless unless uh uh everybody gets together to uh redo the whole

ceremony everybody reveals their secrets um it's secure oh here it is um again it's basically one honest party assumption if there is at least one person who does not reveal the secret they put into the ceremony the whole ceremony is secure because you would need each party to uh reveal the final Secret so this is a way how we can make it how we can make it secure and the ceremony has been going on for months maybe you haven't noticed but it's been a you see it's been almost a year since the since the uh initiative started because we need to create we need to uh finish this we need to make this multi-party computation to create the the secret it

needs to be ready before the actual dunk shorting or protractor link um gets implemented so so uh it's been developed during the last year and this year in January uh it was open for contributions so uh basically uh what it means that you could go anybody could contribute because uh the more people contribute the smaller chances that somebody will reveal uh their secret so um the idea is that some I don't know some Bitcoin or somebody come to you like oh ethereum uses trusted setup it's trusted italics has the key or whatnot

well no he does not I have the key I I set it up I contribute to the ceremony I secure ethereum you can say that if you contribute um and now this is the contribute the the main interface for the contribution and of course it needs to be more diverse more recent throws that this is just one way how to contribute uh there are multiple client implementations which connect to the ceremony so in case there is a bug in one of these uh implementations uh the others are still secure the the most popular one was front-end website which is easy to use so you could just go through it and through your entropy by moving your mouse writing something there also your browser generates entropy in this case

uh you need to log in and then when the powers of Tau are passed to you your computer does their computation and publishes it so so this is how you this is how you could secure ethereum however this open contribution period for now is over uh it it finished around a month ago it was open for like two months and uh right now there is uh there are only special contributions allowed which means you need to have a have a good friend uh who are doing the ceremony and they will get you around now it was for it was there was a uh actually uh um a grand uh Grant mechanism for people who wanted to

create some special contributions uh to mention some of them there were guys doing it from a satellite they contribute to the ceremony from the space there were folks uh in New York Calvin from optimism who organized this monologue party where they created an ephemeral album it was like multiple groups of people creating their own music then they played it used the recording or use the music to to generate the entropy and then deleted everything right it was the album just was played once at a party in New York so there are multiple ways how we can contribute creatively to this ceremony and uh yeah just to uh just to reiterate um we need a lot of contributions in the

public ceremony there was around 80 000 contributions so we can assume that up to 80 000 people were contributing it was less because there was some spam but we have thousands tens of thousands of people contributing and we hope you're at least one of them didn't save uh didn't save the uh uh the the secret uh we have the multiple kind of the sequencer you can see it in the slides the sequencers online we are connecting to basically this this one Central entity which is just ordering the people who are contributing it doesn't have any other power than doing this and uh we can trust it yeah trust or we can verify it we don't need to trust it uh because you

can just download you can download a file which is like 150 megabytes at the moment and it's a recording of all the contributions and you can you can cryptographically verify that it's the chain which which works together so so uh we know it's secure now again we need more and more contributions and I would like to use today to to do some of the contributions um but before I get there I would like to take a moment to think about how we actually do it how we actually create this Secrets because I'm talking about generating some Secrets some secret number and if you think about it this is how all the computers are secured is how all the cryptography is secured right your ethereum wallet you can see the address and the private key which is

hidden somewhere in your Hardware wallet or your computer or somewhere the private key is just a huge random number right like uh atoms in the universe big number and it needs to be random enough so nobody can guess it but now the question is where do I get the randomness like there what is what is the randomness because the randomness the entropy is something coming from the from the nature from the space computers are calculators they cannot think of a random number like you are a person if I tell you the random number there is a high probability you tell me seven but a part of that like there is there is a you're a pretty good random generator but computer is not computer is like does equations so uh your computer your phones when they are generating the

cryptographic keys or like all of the internet the https traffic everything is secured by some keys generated by the CPU from some noise from some electrical noise temperature maybe maybe your mouse movements if you are using Linux and you call the slash UDF random uh it might even tell you that I'm still collecting Randomness not a good entropy you have to wait so so the idea here is that as we need a hold of contributions we need a lot of a lot of people a lot of nature creating this Randomness my idea my idea was to use cat but not just a few cats but a lot of lot of cats and that's why I have you here because today you will

you will become the cats there is this paper called proof of cat which explains how cryptography can be secured by your cats because Wildcats are pretty random they are their own beings they they uh you cannot really predict their behavior so uh what about using them as one of these inputs for our computers to generate randomness um so we can find the details with proof of the cat and this paper proposes a device for uh generating Randomness uh using a cat toy with a microcontroller and it's called catropy uh this is the device that I have right here in this little ball so it's this fluffy ball it's handmade uh my friend

in Slovakia we with hackers in Prague we designed this board um it's called ketrapy it's open you can also make it yourself or you can uh uh get one yeah this is the this is a movement when you move with your hand like this with a gyro so basically it has a gyroscope accelerometer and it collects the movement data and the more you move it the more end of it gets so you can give it to your kid to play with um and right now I would like to do the ceremony with you folks and I believe that I before we start so right now it's on and uh as this blinking when it when it turns green it's collecting the data so it collects the data in some random intervals and uh actually before we start with the

people do we have a cat here I believe we have a cat I would like to actually use a user use a cat and come here come here I can promise that it will work it's too big for him oh yeah give me give me a paw come on give me give me the sniff give it a sniff it's too big too big it moves it moves come on come on ah okay um well look that's why we need so many cats because not all of them are are excited by the toy uh not all of them are not all of them are some we have a bunch of bunch of lazy kids in the world

but some of them are playful and uh if I put it on the floor it's a good idea Joseph can you get it but I mean we can I mean we had the kitty you all saw it it's cute and all so let's let's maybe move to there we go uh but he's not gonna jump down there okay um so so let's just let's just let's just ah you get it thank you but if you can pass it to the people please everybody oh please please like just move with it just play with it a little carefully because you know there is the electronic inside like don't apply too much force but uh please pass it to everyone

everybody just play with it for a few seconds and you're oh it was a like please like try to throw it closer because it was pretty far I hope it survived it if it's still blinking it's all right is it blinking ah cool cool uh yeah I mean it's a lot of entropy thank you ah okay take try to take shorter pass please um anyway so now your the entropy firmware movement is being collected by the toy and um after the we have just few minutes but after it I will take it to my laptop and and submit it to the ceremony so so this way we uh we you can tell that you secured ethereum on itsurik and then

that we have some so so like effort of this this little boy we have around 20 cats securing ethereum thanks to this toy um and uh and also like more than 100 Chordettes um also so I would I would like to mention is that uh these toys I made a bunch of them uh um and uh I was giving them away based I'm not selling them but you can get them based on a donation to a cat shelter in Barcelona it is a beautiful place in Barcelona called harne delgat it's a garden of cats it's a kitty land and uh it's it's a lovely lovely place where they take care of uh straight cats um they have like 40 of them and thanks

to thanks to catroup thanks to this device and the donations from ethereum Community I was able to donate like 500 euros already and if you would like it for like 30 bucks donation to catropy.eat and you can you can send an email and put an email there to me or or Meow at proof of that cat uh you can you can reach out and you can get a toy as well I can ship it to you uh I don't have more units right now but if you would like to have it for your cat or just you know play with by yourself uh you can uh you can get it by donating to kitties in Barcelona uh yeah so so that's it if you want to learn more about the kcg ceremony check out the kdg ceremony repo which is like the main uh

coordination where there is all the all the information um about the ceremony which is still going on um and if you want to learn more into technicalities of how it works I would recommend the talk by Carl who is actually one of the main brains behind the whole ceremony from Defcon explained really nicely and uh yeah also this is nice about the implementation part of it uh an interview with our the talk by folks from the PSE team um again like the the public ceremony the public contributions are over and the special contributions are finishing tomorrow or on Monday so this is like your last chance to help to secure

ethereum and where is my ball I don't see it oh you get it oh thank you whoa ah thanks okay thank you all for your for your for your entropy here uh I will I will uh keep it safe and yeah I believe it it's it so thanks again for your attention and for your entropy foreign