SF Scala: Dmitry Meshkov, Scorex -- the Smallest Codebase for Blockchain
Recording: SF Scala: Dmitry Meshkov, Scorex -- the Smallest Codebase for Blockchain
[Music] yeah hi everyone thanks for coming I'm very excited for me to even talk here so my name is Michi Mishka and I'm going to talk about blockchain how it works I'll make some brief introduction introduction to block chains maybe not all of you are familiar with it and I will tell about score ox but a very high-level idea ideas about quarks mainly so I'll share our experience how block chains look like what their architecture may be high level architecture what common patterns they're what can be different and yeah I'll first introduce myself I think I'm walking and blockchain era since 2015 as a developer and as researcher so I found the cool project quarks in 2015 when I was I left my previous job and I liked it from from scratch actually and you know we learnt this ih K company it's quite a big and well-known company in blockchain research they mainly do a research and prototype it's like R&D laboratory research and development and idea of score axis that is flexible and simple framework that allows you to create prototypes so and it was very useful for this researchers from academia because actually now there is a quite a big gap between theory and practice and cryptocurrencies maybe everywhere but in cryptocurrencies also so a lot of good researchers this academic goals it's two papers with proof of security and so on and so on it should works absolutely good but when you implement it you found bugs they found problems you found bottlenecks and actually to create something really cool you need a few iterations through research and development the researcher should tell you what is the main idea is implemented you find bottlenecks and you send it back to researchers and so on so this is not just a one step ID it's a cycle and now scoo rocks is not just prototyping framework it it's now week bigger because we have at least two block chains based on it so first one I should mention is a weights platform it's like in top ten cryptocurrencies right now with capitalization like half of a billion dollars and so on they took our framework as a base now they rewrote it but they took score rocks at the base and implemented all the stuff based on it and the second production software based on the score ox is a matches client for freedom classic it's supported by HK company and it also use of different parts of scores in its code base and actually now since this year just a few months ago and we decided that we have implemented quite a lot of good prototypes we have cool ideas that complement each other and we decided to create a new platform that will combine all of these cool ideas we like him in one blockchain they complement each other and you know we already know how they work separately but we should implement they all together and he's idea of where the platform is to create you know better blockchain in all aspects so we have but synchronization but transactional language but security but economical model so I was here - let's crypt economics and security conference and I presented our economic model there actually it's still on progress we think about it so yeah that's me and let me start with some blockchain introduction how it works on the simplest example of Bitcoin how Bitcoin locks because there are different now ideas so the main problem that is solved by blockchain is a problem of double spending so mention ennis have a coin and she creates two transactions in the first she sent this current to Bob and in second reason is going to charlie so separately all these this transactions are well it so transaction from Alice to Bob is valid transaction from register charlie is also valid but both of them are not valid because she have one event corn actually says you don't have two of them and Bob and Charlie do not know each other do not trust each other it's a distributed system IDs to process such a situation in a totally distributed system in the decentralized system where there is no central party and in centralized solution centralized solution is quite simple first transaction is valid so if you bank see transaction from Alice to Bob with accept its and then he will receive transaction from Alice to char and it will reject it so very simple idea but in decentralized world it is quite difficult to order all the transactions my time because you do not have actually timestamp in a distance or my sport and it's soft with the blockchain so blockchain is just a chain of clocks quite a simple definition yeah so if we have a block so that have linked to parent blocks every block have a link to parent block and now we actually have an order of transactions inside the block and between the box so if we put them in such a data structure in my regard as I just linked list it's quite easy to order this transactions but a new problem arises how to create this box who can create these blocks and how to deal with it and just to before I start it is prob problem with a solution I need the mention of hash function I think of you know what is it actually but I'll repeat a bit the most most important he is that is one way function you have data of arbitrary length um as an input just a message and you apply hash function to this message and you receive a fixed length wealth H and it's impossible to recover message if you have a digest you have a hash you can create two different messages which leads to the same cache and and yeah and actually hashes quite fast function so it's very fast to come computers but when you have a hash you know nothing about previous message and you don't know how to create a message that will lead to such a hash this property is used in proof of work so it's a process how new block is created in Bitcoin it's actually a very simple so we have a previous block yeah here's a fella left we put hash of brilliant bug to a new block I put some transactions to it every participant of this network do it his local storage it's different data from for all of us so imagine we have a network everyone is a participant here so we we all will have might may have different data here in transactions but you on your own computer can validate them all it's quite easy I did not need to synchronize with others and after that you start to iterate through field notes it's a special filter new block and you continue to do it until hash of all this block we will start from a lot of zeros so we'll follow some bit pattern now it's like seven to zero so in Bitcoin blocks it's quite easy to estimate what we should do to create such hash you again you you do not know what what should be the message to create such a hash you should iterate through different noses and trying to find it with brute force some kind of brute force yeah so you create use some nonce you receive some hash with probability 50 percents the first bit will be 0 with probability 25% year 2000 to 2012 is 0 with probability 1 and 12 and a half percent here 3 bits will be 0 and so on so now it's it's very very low probability to create a block like 2 to the power of minus 70 it's a crazy number actually good property here is that it's so very easy to validate that all this big big work was performed by usual so me as a validator I can get this block I crashed it I receive a message our hash function to it I receive a hash and I can calculate number of zeros in the beginning I do it very fast and I understand that actually this guy who created this block profound a very very big walk that's why it's called the proof of work because you just validate to prove that someone they found two very big walk and but actually this block generation is the random process we do it all of us do it separately and it make use that I have created block 54 and broadcast it in a network you should receive it but with natural cotton see someone else in another part of the world created block 55 and there might be different transactions in these blocks so block 54 have transaction from my list of all block 55 a transaction from register charlie and we again do not understand the what transaction is correct who received this coin and so on but actually no he is quite simple correct change the longest chain so there will be more blocks later but correct chain is just a longest chain at this point we still do not know what what is the correct block is the e-series but they all have rooted block 54 so we know that this chain may win this chain maybe none of this chain may win it's like random process but in all of them will have transaction from Alice to Bob now transaction from Alice to Charlie and its so-called eventual consistency there is a well-known sub theorem that in distributed system you can achieve two of three properties consistency reliability and partition tolerance so blockchain solve this theorem in term of eventual consistency right now you do not know the correct state our vision for current situation may be different but our vision for some previous state like a state and our goal with the same it's very similar like DNS yeah DNS infrastructure so right now this names me linked to different IP addresses different part of the world but after some time they will all send - they were all into the same maybe others so it's a block tree it's very important property of blockchain you should always keep it at mind when you implement a blockchain or some applications that use a blockchain because while you receive some transaction in the Sun block in a recent book you cannot accept it right now you should wait few confirmation well it all depends if you just get paid by a code for a small amount of money you may risk it may be okay for you to risk a bit but if you sell something whether it is very expensive you get better to wait few confirmations the waits 10 minutes one hour when if you went wait one hour you never you might be sure that your transaction here is corrected it's never cute and a Bitcoin history such a long crowbar but this year rollback happens they happens all this and you should always keep it in mind and now that was some brief introduction to blockchain maybe if you have questions about this part it's time to ask them now so a lot of questions ok until the pants question algorithmic yeah so what has out drifted blockchain use it it all depends in Bitcoin they use sha-256 and actually not just a sha but double sha off so they twice apply it so block but another block change there are other hash functions and here is quite a big problem that actually for sha it's quite easy to implement Isaac's a hardware devices that iterate through all these hashes very efficiently thousands of times more efficient that on here that he local computer the commodity hardware actually Bitcoin and in his white paper to mention something like one CPU one vote so it assumed that every people in the world have a computer and they can join this network and it will work until majority of the network is honest so if majority of people on the world is honest Bitcoin is secure and practice that's not true because of this hardware and because you know Chinese guys know how to create this hardware very efficient and the most of computational power in terms of this crashing power is concentrated on China and people don't like this and create a different algorithm of proof-of-work to be Isaac resistance so to create such an algorithm it's a challenge actually it's not solve the problem but it's a challenge to create such an algorithm that is probably secure to Isaacs it's impossible to create the specialized hardware that is much much more efficient that your laptop that a commodity at work but it all depends more questions Oh so the question is what is the algorithm we decide what what transaction is correct here yeah so actually I mentioned it that's the algorithm only transactions in the longest chain are correct if your transaction is not in the longest chain it's removed so here transaction from Edisto charlie is removed from blockchain it's not a longer chain actually other nodes will just delete this block and as if it was an Eric you'll never cubed so the the rule here is quite simple correct chain is the longest chain length if the transaction is not in the longest chain it is not on a block chain no questions yeah if there is a transaction well in this situation I am talking about situation that they are all worried so booth booth chains I win it so this is a valid excessive a little but they are different if you just have an invalid transaction like Saint in if Alice will try to send two coins well three have only one this block will be ignore it no one will accept it to do to the chain so all this block are corrects oh well it there is no invalid book here yeah the gap in between like first place longest chains and second place along this chain is that gap widens it becomes increasingly difficult for a second place to catch up but if that gap stay small why are you well it's a random process yeah and when you mine this no no yeah I'll tell you so here is we saw yeah the question is why do we have an irrational consistency and why this situation won't be forever so the only assumption I have is that majority is honest so majority majority should be honest well let's remove this book for now yeah so even majority may be splitted between these two chain chains yeah 50% smiled here my 50% my here but it's a random process and at some points new block we like you and when this block 61 we like you majority will start so we will choose this chain it's not correct it's now the longest chain so all the honest - I'll start to continue this chain and Eevee even if you have dishonest party here he might try to continue shorter chain but as far as he have minority of computational power he'll read books more rare than honest party so anywhere in honest players will create my books and finally will win I can tell concrete numbers for for this stations actually in practicing it's not so you know scarce in Bitcoin like two percent of blocks or faint so in this for and noting the main change so there is one such a block for 50 blocks in the best team so the this situation is not realistic it's just an example and yes sometimes there are forms of one length death and in a so the station is we we have like two blocks here but at some point we will have a new block here or here and when we will have block here over all the miners will switch to this chain will abandon please walk 55 and will start to continue chain starting from walk 54 well three transactions per second things a bit different number it's not related to this stuff yes so if you're asking about throughput its well yeah it's it's related actually and you're correct so we need to a blog propagation for to be very fast we need all honest party to receive the next block by Chris walk 56 very fast and if block size is too big it will go through NATO for a long time and while it goes through a network for a long time other patches migrate this block 57 yeah and concrete numbers in bitcoin is like time interval between blocks is like 10 megabyte 10 minutes and block size limit is 1 megabyte so you should download 1 megabyte quite fast to at the time that is much much smaller than 10 minutes that is quite easy actually so no no it's still 1 megabyte actually well it's Segway tricks is not completed now they have sacred but they do not have two weeks two weeks will be in the November so it's in two parts but it's another question actually yeah right now what size limit is one megabytes it's too much megabyte okay any more questions about this stuff yeah okay is it necessary so a question why should we do this proof of work to do this a lot of question to have such a simple ordinary yeah well a problem here is we can do this stuff in terms of if we have a majority so I thought we we need like more than 50% of honest players but the question here is that in a digital world it's quite easy to create millions of different accounts that will look like different accounts and if I'm the nursery I can create million of accounts and you can't tell whether it's 1 million of different people oh it's just one me yeah and so it's a protection to Cybil attacks so here is in this design you as an adversary can creates a lot of patches for free you are limited with your processor you computational resources there are other consensus mechanism not just a proof of work there are proof of space that you probability to create a block is equals to space on the hard drive yeah proportional to space on the hard drive drive proof of stake when your probability to create the block is proportional to your balance how much money do you have and quite a lot of different consensus algorithm two most popular is proof of work and proof of stake so proof of work do a lot of job yeah nobody writes it actually then the the second algorithm is a proof of stake where probability to create block is proportional to number of your points so you you can't create for free new you know computational resources and you can create for frequencies of not versus oh it's so to protection civil attacks if I'm an attacker and I create a lot of digital instances of myself it's not so easy to define a majority queue let's continue maybe be too closer to code because in our I can tell about blockchain itself for a lot of time I have to talk about blockchain architecture so what parts do we have in a blockchain and what do we do so actually blockchain is a network anyway is a network and it's a p2p network in first assumption it's one layer p2p network so all the parties at the same layer that's not completely true in practice but it's not so important here and we'll go to discuss one note what is its what's inside one node so first of all it communicates to other nodes yeah there are some requests to other nodes and I'll not send some modifiers that change our local state our local view of the world in scorch we have a network controller that process all these communications you can just define what type of modifiers do you have and how to protect them went over to scentless messages i will not this how this not control network controller and let's talk about different type of modifiers and very common type modifier is a transaction so whenever you receive a transaction what is the workload what what should we do so I should mention here that actually transaction consists of two parts first one is stateless so we should check that signature is valid that this amount is positive and so on so it's like semantics of the transaction you can do it anywhere for example at transaction digitalization from bytes it's like a domain driven design when you only have valid object in in it actually it's not a good idea because signature validation is quite long quite a long computation and this may lead to quite a lot of DDoS attacks if you do it right after creation and especially you don't want to do this stateless validation if you create transaction from your local storage because you already made this validation but it's possible to do it almost anywhere second part is stateful you should check that sender actually have these coins at this point of time so this stateless validation that way sorry it doesn't depend on time while stateful validation is may change from time to time so now now this transaction is valid after some time it's not and so on so we need a mention of state we have a mention of state so state is a current balances of all the parties in the network so we put this we sent this transaction to state and it checks whether it is correct or not so here we have a mention of minimal state it's a minimal data set required to validate arbitrary transaction it's very important that this state should be synchronized between different notes at the the same block if they have the same world where the state should be the same and it depends on a blockchain I maybe won't tell about this a lot of things but actually it's like a map from your public key to your balance so how much money do you have right now when we yeah yeah actually yes state may be authenticated it's a very cool feature and it's implemented in some blockchain so including the theorem so we have a map from public key to balance and we can create miracle tree on top of this data structure it works quite simple so we have elements of a tree we put put data to the reliefs and we hash all the purse so we hash this prayer and we receive this hash it has this problem this hash and then release it has these two hashes and receiver root hash with such design it's called authenticated State you can pray proof a balance of choosen accounts so we can just get some account a and provide this this element and this hash and it's not to compute eight little trash you do not need this data just need this top cache and also in our work we showed how to provide the proof of merkel route changes so mmm it's possible to provide the proof that sender actually have these coins at this point of time and state changed exactly as you expected for so if I send one going to if Alice sent one going to Bob you can check that all the things changed in the state that Ellie's balance become one coin less and Bob's bones become one coin more it's a coefficient I'll tell about it a bit later so we have a state we check the transaction and if it is correct we send it to mantle our mantel is also very common structure in the blockchain it existed in all the block chains it's a storage on frankeour film transactions so the storage of transactions that are not in a blockchain yet you just keep that in your local data structure it's frickin modified so usually it's kept in memory and that's why it's called mantle through it it's some limited size it should be cleaned so is some intervals I'll tell about it a bit later and yeah all this data structures are talking about we have in scorer X and we have interfaces you should implement in your blockchain if you want to have it and you'll have working blockchain so we have interface for mantle we have Enterprise for state we have some default implementations for for some of these data structures the IDS you can just define your transaction define some implement some interfaces and you have broken blockchain so it's a part of interface of memo what should be able to do the more interesting example is a full block when you receive a block so it's a block with all the transactions first you should send it to history it's like blockchain but we have a mansion hit three because it's not just a blockchain you need some more historical data here so you send it to history you verify that this block is valid in terms of proof of work oh you can validate in history you should money date it's at the storage actually for some historical data so it should be able to put this data with some validation should return it by ID and should provide some information to synchronize this history because history should also be synchronized between different nodes in the network when you after that see if your block is valid you should actually change check that transactions on it are correct and actually check apply this block to state if it's in a best chain if it it's not in the best chain you shouldn't apply it if there is some rollback you may roll back state to some step before yeah if we have Forks you may require to roll back state to previous situation and apply few blocks more if you have about a chain now so it's quite strong communication here between state and history also actually you should send this block to mem pool and you should remove these transactions from a block from a Mapple so you do not need them they are now confident that they already in the blockchain that you should remove them from man pool you may also remove some other transactions that become invalid so if you have like this transaction from Alice to Bob and from Alice to Charlie you can keep them all in the mantle but after the first transaction second become and valid in case of rollback you should transactions from roll back the block back to mantle that's also quite important part of dog chain and in addition you should modify your bullets because in Bitcoin actually not need just your does the private key to control all the money you need some public data that can be computed from a blockchain it's not a problem to get it but you should know oh like how much coins do you actually have you have a private key to send to side transactions but you should know how much choice do you have how much transactions did you received and wallet is a solution few private keys of some indexes required for transaction creation and also we did not use a mention of wallet we use a mention of world because we keep everything every local data to this storage is the storage of a lot of local data so correct pictures so this what is different on all the nodes in the network these two parts state and history should be synchronized Manuel should also be synchronized but it's not strict requirement it's better to have it synchronized through the network and Walt gives your local personal data and so when he applied full book you should do a lot of stuff you should check that work is valid in terms of proof of work in terms of consensus you should check that transaction Sunita valid safety to history applied to state there may be some roll backs in this this step removes some transaction from mam pool at some transaction to mantle from rollback book update you wallet and what's important here is that all these separations should be atomically so you perform all of them all none of that but it's very bad if you apply a block to history but you do not apply it to stage yeah where you have a race condition or something like this and that's why I actually have a not view holder it's a central part of our note that is that communicates with these parts it's like an interface here so you in incorrect you just communicate with not viewholder you do not have direct access to these concrete parts and this is not view holder knows how to process different kind of modifier and surprisingly this not view holder is very similar in different book chains it doesn't matter what kind of blockchain do you use what kind of transactions do you do have this workflow is the same and actually it's possible to implement it almost all the parts of no not view holder and we have this implementation so when you get corrects you should implement these parts but you have central part already implemented so it's it controls modifiers workflow ensures that it's consistent synchronize all the parts between different nodes and yeah it's similar for all the block chains services you know I haven't talked about minors or API I have something like this we do all this as a separate application so if you need to mine box you need to iterate from these hashes it's a separate application that is quite common in how the proof-of-work book chains in Bitcoin if you know miner is a separates software it's written on low and low-level language and it communicates to you note through the API so it's not built building in your note you don't need it included you not because it's better to write it in some different language may be the same for user API you also it's not so you know additional part it's out of this note this note is what you need to know download protest transactions synchronize the network and so on do I have some time let me check because this pass yeah this part is also quite interesting because in Bitcoin and in the Hyrum we do not have just a full block as I told not a block with all the transactions but it is splitted in a block header and transactions so in it's an example from Bitcoin so block hitter is just 80 bytes have the actually the rule we need to proof of work is that the hash of this block reader should start from 70 zeros and not from the full block rest from walk hero and so you can just download the skater and you can check proof of water you can check that work is done correctly without any transactions after that you can download transactions and check these transactions you there is a miracle route of transactions here so actually all the transactions I included here but just a hash of them you can change transaction in the block because if you change one byte he or the hash will change and proof-of-work will be incorrect so in Bitcoin they operate with headers all you do is head receive put it in a we can check that maybe you now have a best chain of headers and this picture become more complicated because it's like an optimization but very important optimization for work chains because actually man pool is more or less synchronized and he do not need to download all these transactions again from other nodes he do not need that a lot this full block with transactions you just download Peter in a low transaction IDs and you construct this full block from your man pool you already have all of this transactions in your mantle you already validated them and so on this is a very important optimization because actually bottleneck in all the blockchain is a network so we already had a question about throughput why do we have just three transactions per second in Bitcoin and it's just because network is limited you can have a super fast software on you note it's not a problem to write such no that process 1 million transactions per seconds on your laptop it's possible but you need to synchronize this 1 million transactions per seconds through network it's a distributed network we don't send directly from one node to each other you can have some intermediate steps so the main problem in all the block chains in terms of scalability is a network layer you should keep it in mind you can't just increase the block size so decrease time interval between box because you should should be sure that you're not synchronized and this kind of optimizations allows you to reduce network utilization and most of the stuff done by a lot of researchers developers is how to decrease network utilization in blockchains how to synchronize with minimal network resources yeah I'll speak a bit about different note regimes so we talked about full note that process everything and that's cool but what if you just the regular users and regular user and you don't want to process all this book chain you are not a miner you're not going to iterate through all the sketches for such cases in Bitcoin there are white notes or SPV notes they are quite quite simple and actually they don't have a mantle and the state because they do not validate transactions they trust to other nodes I should yeah so they'd download just the chain of hitters they don't want their own transactions with a proof I already told you about Merkle tree so proof of this transaction one is just the transactions and these two caches did not need to download all the transactions so they trust to proof of work majority that may be quite a good assumption me it's usually possible to trust to majority and you can quite fast work quite fast synchronized with the network you don't know just hitters chain that is much much smaller again block hetero sizes 80 bytes work and the block size is 1 megabyte it it's a good use if you are going to use Bitcoin use such an SPD wallet do not trust to some web boards or third parties actually it's a big issue now in cryptocurrencies that users do not like to run their own not to validate even this proof of work they go to some web wallet and trust some centralized party and if this web bullet will be compromised your private keys field the stolen your money will the lost actually there is an example of such a be here in hidden classic their main web wallet was hijacked and a lot of people lost their money and when you go to you know my bullet it can show you anything you had 50 coins and it still shows you that you have 50 coins but it already got you private key and Santa's current address or address but you have an interface you do not validate that you already have these 50 coins but if you run SPB not you validate that actually you have some columns and you don't send your private key stone to anyone the last section here is a very fast synchronization actually it's it's enough to download headers chain just few last blocks even if you're a minor and you need States all you have downloaded this headers chain you can download this few of us blocks but you need a state to stop process these blocks and fortunately it's possible to download state if it's authenticated I already taught it in the beginning so we've stated out indicated you can download its parts we have proof that they belongs to the same path actually it's the same what torrent clients do they download your file in a parcel it's a proof that they belongs to the this route rest of you done in the beginning along the root hash of medical tree and you don't what parts of your film with proofs that they blast to the same root hairs to this film we are going to download it's implemented in a theorem in Bitcoin and all in most of popular currencies now it's a mess to download all these blocks in if you know it will take you like a few weeks to process all the blocks from from the beginning so it's almost impossible but in such a resume you just need to download chain of headers and few full blocks yeah so in a lot state junk state manifest and in our state header which should be part of history and that's almost all what I wanted to tell about today so I already told that we have a framework to prototype different watches we have interfaces for most common parts for state mempool volts and history we have implemented some common parts like not view you can find it on github it's written on Scala and another good feature here is that common properties may be tested so if you have blockchain so if we have some interfaces we can test some common properties like you know if you roll back block and apply it again you you are going to the same state yeah it's quite quite similar idea and we have such a test kit now where we have implemented quite a lot of properties where you know such a high level properties like integrational tests four putts on like mental and state and history and four for all the notes so if you use our scores don't miss that we have also test get that with you you have some test for free some property tests for free at your block chain actually works as it should do not have some security holes so thank you for our attention care of my contacts on SlideShare you'll see this presentation soon and here are my organization's thank you you have any questions ask please I might yeah well actually I have just smooth and yeah so we have this score X framework and we have some examples we have implemented it's a full blockchain the most you know interesting example here is a hybrid example it's an example of twins coin so it's a hybrid consensus protocol of proof of Plus proof of stake it's a paper file extra long and yeah we have some test for him for it but actually yeah right them random now so it's an example how I would just keep test kit box not so beautiful yeah the back output here yeah but yeah you know when we have implemented all the interfaces and we launched the test net it works quite fine and we have this test it I like leave this idea mark so much actually because you know you check some common properties for for all the block cheese like you come double spend the transaction if you have applied this products online transaction once you can't apply it it's one more time it's common for roller block chains in it doesn't depend on type if you've implemented our interfaces they rose so yeah this tests are quite long because they generate blogtrotters block rollbacks and so on and all this tests propagators so it creates a lot of roll bags yeah I can answer some questions while they're running okay should I you know in learning it I know it's okay to look at the score x1 stuff has it changed dramatically [Music] well yeah it's changed dramatically so we have majora faction changed you'd better look at Scott x2 for sure we do not support score ox1 anymore but yeah now we played quite a lot of these different parts and we understood that our abstractions at score x1 are not flexible enough for our purposes like it was impossible to implement such hybrid protocol you have block of proof-of-work and block of proof of stake yeah unfortunately it wasn't flexible enough and it was based on some a bit incorrect assumptions it is wrong no model structure so we we now change it it worked quite good for quite simple examples is fine but when we started to implement more complicated block chains we understood that it's not enough for us and now we have scarves - and we support it I hope you have a quite a good quality framework soon when we will use it actually in our go so now we actively use it in a more or less production block chain so you improve quality will improve performance and so on so yeah we you sucker for network layer so it's a kind of a picture it's a p2p Network and the year we we use a quite quite a lot yeah we the same message we use Rock IO to send messages between different nodes and we actually send the same notes and inside and out the same messages inside a note soul is not beholder is a knocker actor and will be use it yeah how much the state can get it all depends as usual well I can tell some examples like in Bitcoin in it's like 2 gigabytes it's not so big in in theorem I am not remember but it's like the same size but I should mention here quite a good example from material history like a year ago they had to zero so you know the state is very important because you should validate transactions fast because well if you have proof of work you receive an e block and you should validate it and then you'll start mine on top of this block yeah and why you validate a block your hard West tail actually he would not create a box because you do not know whether it's oil it or not in Bitcoin history they were such an example when localization took like four minutes it was bad implementation not not optimal but imagine that just a validation of a block took you four minutes and you have a time until our like ten minutes between blocks and for four minutes forty percent of this time interval your hard West tail it's not good and in a theorem here go they had a quite beautiful attack actually DDoS attack based on the state so they were 1 million of users at this point of time and that was the increased state size to 12 20 millions of users so he created a lot of different accounts and this state was kept in memory and foremost almost devices for most computers state size become too big to to be in memory it was wrapped on a drive its access time become very slow yeah and block will addition to more time than time interval between blocks actually for like a month until they performed the Heart Walk to fix this so like a month or network of he knows it wasn't usable at all because of this DDoS attack and he after increase in this state size virtually become to touch random parts of this state so he increased this state size it's what drive and then he started to paw touch random elements from the state so state is very important part of implementation it should be very fast to validate transactions efficiently better to put it in the memory but you should be ready for such DDoS attacks any more questions okay then thank you thank you for attention [Applause] [Music]