New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Cryptoeconomics at Scale by Karl Floersch (Devcon4)

DevconWed, Oct 9, 2019, 12:00 AM

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more. https://archive.devcon.org/archive/watch/4/cryptoeconomics-at-scale The next wave of internet applications will not only compete on functionality, but also incentives. With cryptoeconomic research we are witnessing the beginnings of incentive analysis being applied to the architecture of internet protocols. As this body of research grows, common methodologies are beginning to emerge. These methodologies are also beginning to be composed to produce even more sophisticated and scalable protocols. This talk provides an overview of these cryptoeconomic methodologies and calls for help in the quest to build a fairer web. Speaker(s): Karl Floersch Skill level: Beginner Track: Scalability Keywords: cryptoeconomics, incentives, equality Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 4 was held in Prague, Czech Republic on Oct 30 - Nov 2, 2018. Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

Transcript

[Applause] I love interim music at conferences is incredible by the way I had a whole like intro thing planned or something that I was gonna say but I just got to say like reiterate what what she just said that was awesome I'm a huge fan like let's please your unique backgrounds it is incredibly important who's going to talk about that in the end of my slides now I'm talking about at the beginning anyway my talk is on scalable scaling crypto economics and also a plasma primer so let's let's dive right in so this is a map of human knowledge and consciousness we have science like physics equals mc-squared that is a meme we have computer science we have you know philosophy we've got all these different disciplines we've got you know history we have cryptography we have economics I wonder if you know where this is going well right on this right there right there precisely there no other place there is crypto economics this kind of very weird weird thing it's like an innocent idea kind of signal and so what we have is it is a kind of combination of cryptography and a combination of economics and a combination of you know distributed systems it's pulling in a lot of ideas maybe even some you know philosophy in there too but absolutely no history because you know why look back we like the mistakes are better the second time and and you know why physics there are no physical limits in the crypto space come on okay we get out of here anyway so we're pulling in all these ideas from different fields to kind of create something pretty cool and and you know what what is that so what does this actually do we have a bunch of gerbils and they kind of come I'm a terrible person hopefully people know and and and they're they're learning about all the different fields everything that we we want to do and some get into computer science some get into physics and hopefully there can be this like little flag that says you know this is crypto economics there's something cool here maybe maybe I mean people in this room hopefully think that there's something cool in in you know what we're doing and so hopefully they can come in and they can get some good ideas and spread that information to different fields and we can actually like influence other fields to really care about decentralization when we create Internet applications to really you know make make the Facebook 2.0 or something like this make sure that it's not you know just a single kind of processor that holds everyone's chat information and holds everyone's private keys and make sure that you know it videogames in the future maybe they're like assets or any any internet assets are not held just by a central operator that can kind of you know freeze your account for instance and instead maybe you know put it on a decentralized network everyone's holding their private keys and you know encrypting their messages and oh my gosh this is like a dream this just gets me so excited to be amazing and you know all these like assets maybe there exists on on a chain that no one really controls and so no one can actually you know freeze your account so maybe maybe just maybe we can create the decentralized Internet infrastructure that we all want that we all know no one loved but but if we are actually going to spread this information back there is something that we need to do our networks are pretty small they're pretty you know relatively relatively wimpy and if we were to actually have the kind of weight of just the world Internet users on our systems it would just you know hold up no it actually probably wouldn't work out fifteen transactions per second that's not going to that's not going to cut it right so we need to scale we need to scale up we need to scale we need to scale we need to scale we need to scale we need to scale we need to scale it's a shocking number of puns that you can look up for scale it's incredible I was shocked and this is a scale bug anyway we need to scale this is you know there's with us where we are Prague oh my god we need to that's the whole earth but I'm sure and there if we're now here's here's galaxy so I created this terrible waste of time website for scale DEFCON it's like cookie clicker boat shared wheel and we can scale so every time you hear scale click click one on that website scale DEFCON comm anyway so people are talking about a theorem 2.0 right and I or you know sir serenity and and you know it is incredibly cool we have all of these you know the beacon chain creating all of the regenerating randomness which allows block proposal for the shard chains and you know committing to finalizing the shard chains and it's really cool but in this talk I'm going to mostly focus on a single single chain maybe maybe maybe plasma so well let's let's dive in what you know before we have this kind of construction I really think that we can have something very cool with plasma and I'm going to talk about some exciting stuff later on in this talk so what is plasma in the first place let's dive right in well it's an architecture for layer two black chains secured with a neck and exit mechanism it's kind of confusing doesn't make any sense hopefully this will illuminate things a little bit and I want everyone to have an idea what plasma is because the entire reason why we're building these systems what like decentralization means is you have a reason to trust the internet system you know infrastructure that you're using right we need to establish trust so you need to know how this kind of stuff works if it's going to be adopted on a large scale so we have the etherium chain we've got the plasma contract the plasma contract is deployed to the etherium main chain and mined by a miner right it's pretty simple so far this plasma contract has an address has an eighth balance and it acts as a kind of judge is a kind of mediator for all of the the you know funds that it's going to with a oversee and notice that this mediator is determinist to get his objective there is no kind of you know a question who's controlling this it is automatically executed like a robot well in a robot that has no opinions outside of just following orders so we also have this operator the operator can be a single entity it can also be a know a proof of stake validator set right it's actually surprisingly easy to you know turn this into a proof of sake system so we might as well lock up some coins and do that so next we have the plasma chain itself the plasma chain consists on of off chain data this is where we get our scalability from this is you know store it up in the cloud it's a whole lot of data and here it also it consists of on chain data like block commitments as well as deposits and exits and so this is all on the etherium main chain and the key is that our security actually comes from and derives from the etherium main chain so if the etherium main chain is to you know hold up its properties of you know since resistance and and you know safety then what we get is we get the same properties of our plasma chain we get that same level of security and so we while storing minimal data on the etherium chain and so there's actually something fun that I heard well you can actually achieve this kind of like scalability stuff with cryptography just alone using stuff like ZK snarks roll-up and and and you know some some really cool tech that's coming out soon but just and Drake has this thing that I really love where if if you can't use cryptography than try crypto economics because the cryptography is very expensive at this moment so it's pretty cool I'm a fan of that little saying so lastly we have our users of course and so we've got Alice and Bob Alice on the Left Bob on the rights very important that you know now we have three steps main steps for all of these plasma chains you deposit tokens you transact on the plasma chain and then you exit token so first we're going to deposit some tokens so Alice signs and aetherium transaction sends it to the miner the miner mines it and now it is recorded in the you know aetherium chain it reduces her eath balance and sends that eath to the plasma contract to control sounds good so far and so now we've got this deposit record the deposit record is immediately kind of reflected on the plasma chain it is stored in the main chain it is a little piece of data not very expensive but it is you know it's it's a non-trivial cost of gas and then that gives us 100 piece so this is a kind of you know plasma chain version of the the the asset and this works not just for eath but this works for any arbitrary token as well as E or C seven twenty ones anything that you you know want to any asset works on one of these these chains now next you can transact on the plasma chain so alice creates a plasma transaction and you know it's sending to Bob 50 coins and it's sent directly to the plasma operators or maybe you know the validators and created in a they come to consensus on it they form a block and they submit that block to the the actually sorry they actually create a Merkle tree of that block and a compact block commitment so this is a you know constant size basically a hash which is submitted to the main etherium chain that is a commitment to the block and then the actual block data itself is made available for all users to download so notice that the blog is currently grayed out that's because it's not yet committed to and so eventually what we will do is we will mine a block on the etherium chain with that block commitment and that will kind of like commit the plasma block to the main chain so now we have the security of the main chain so sounds pretty good so far and we now need to you know update the state and so we have this you know path and we're going to send it to Bob and you know if mine is 50 plus 50 and we're good so we've transacted on the plasma chain but the point of these plasma chains we can transact a lot right we currently don't scale we want to scale pretty simple so what we can do is you know notice that this transaction process everything is going on all the kind of main information is going on off chain right it's not actually being committed to the main chain and there's only a constant size commitment to the main chain so the larger the block it doesn't actually affect what you're committing to the main the theorem chain so you can instead of having one transaction you can have a whole lot of transactions send them all to the etherium the the plasma operators they'll create a block they'll create a Merkel tree Merkel route and they will submit that that block commitment to the main chain and so instead of being bound by the you know aetherium transaction limit which is like 15 transactions per second today you know you know maybe a thousand times X that you know in a little bit but still you know we can already get these massive blocks just by using a kind of sensible a you know sensible crypto economic mechanism like plasma so how many transactions per second you ask well we're gonna talk about it soon so the last thing is exiting tokens right Bob wants to exit their core his coins and he creates a transaction which exits the which is like I want to exit sends it to the main chain the main chain starts out this exit process and there's seven days for a challenge to be submitted so essentially what happens is we have this challenge period at seven days and we wait for a you know the you know Alice if Alice thinks that this exit is invalid and not actually you know maybe it's trying to steal someone else's coins Alice can send a message saying this exit is invalid prove it to this dispute you know contract and then the exit will be cancelled but in our case the exit was just fine and so it goes through we wait and finally Bob submits a withdrawal transaction sends it to the main aetherium chain and receives the you know the the reduces the balances on the plasma chain and receives the money on the etherium chain sent from the plasma contract itself so this is the general construction for all of these plasma chains it's pretty cool pretty like all of the plasma designs whether it be plasma you know cash MVP etc they all follow this same kind of format so that's pretty cool that's pretty cool now unfortunately this was only one transaction and they you know there's no point of having a coin on a plasma chain if you only transact it once because then you're just you know sending it once withdrawing it and the gas cost is like not even you're not even saving any money and so we really want like a huge number of transactions on these plasma chains it would be ideal if they could be massive or at least you know have one humungous plasma jayan that would be so cool because then we get these cheap transactions for you know all of the etherium assets and we can get them you know way sooner then you know then then we can see and we'll see you know how many transactions we actually get pretty soon so a brief recap of plasma history right this is it's been a crazy journey with a lot of different crazy names ending up with this kind of like last little plasma thing which I will talk about anyway so first it started out with this white paper right we're we're we're climbing we're starting the mountain it had a general idea of the format of plasma but it was a little bit fuzzy didn't really like it didn't didn't feel like it you could really implement it just from that spec and so what happened is vitalik created this plasma MVP architecture which was you know really great it had had a you know had a lot going for it but there was some clear flaws with with this spec and one of those flaws was confirmation signatures mass and no trustless like lines so we'll talk about confirmation signatures very briefly it's a pretty silly thing so when Alice sent a transaction and it got committed to the main chain turns out that it wouldn't actually be valid yet in fact Alice needed to sign a transaction saying I saw this message and send it directly to Bob this would make the transaction valid and to be honest that is a terrible UX that would be so complicated to implement you have to send to trick like sign two things just to send one coin that's craziness I don't know it was not not great the next one is the mass X of ulnar ability this is the scariest of all probably so we have one transaction in this block and that transaction is read what does that mean that means it's invalid it means that it is spending more money than it actually has right this is just literally an invalid transaction Alice is not sending this evil Mallory gerbil nine nine nine nine nine coins that's crazy talk so what is happening is that transaction maybe gets included into the plasma chain because Mallory and the operator are colluding some kind of you know some nasty business is going on so then Mallory this you know evil gerbil is going to submit an exit of all of those coins attempting to drain the plasma smart contract of all of its money right and it's going to reference that invalid transaction in its proof to the plasma contract now because of the way the plasma contract was designed in MVP it created this ticking time-bomb where everyone had to exit within seven days and if they did not exit well you'll see the people who did exit they'd get their money back that's great but the people who didn't exit time jump boom it would explode and all the money would be sent directly to the you know person who had this invalid exit right so this is extremely bad if you're like asleep for a little bit then you lose all your money with you know very very little recourse it's very easy for the plasma operator to just you know go away and take a whole lot of money now it gets even worse we're talking about a massive plasma chain or a couple massive plasma chains so like in that case we have a huge number of users and if a huge number of users are all trying to submit exits within seven weeks seven days maybe that's not enough time for all of them to be processed and so you know if you thought crypto Kitty's clogged the etherium Network my goodness this would be a nightmare this is just it just like breaks the whole system you literally can't scale up to this point so it's you know it's gone supernova game over let's try again so no trustless like line this isn't you know another important piece we remember had this this because this ticking time-bomb exists we need to check every user needs to check that there isn't an invalid transaction included in our block which means they need to download and process every single transaction looking for that single invalid transaction this is a serious problem because you know for it's great that they can exit but the thing is that downloading and processing every single block if those blocks get really big creates a huge bottleneck and so instead of getting you know tons of transactions per second we have to download everything and so that means like you know maybe a hundred transactions per second maybe a thousand transactions per second but like it's very limited by the client ability to download the transactions so that's not good next more viable plasma you know Kelvin created and Kevin and Ben Jones actually created this this spec that iterates on the MVP and removes those confirmation signatures think goodness that was that was you know he needed to go needed to go but then there was also this plasma caches plasma ridiculousness pretty silly but nonetheless plasma cash came out and so that actually got us a little closer I would say and so that kind of mitigated this max mass exit volunteer bility and it also gave us a trustless light client so so we'll look at how this kind of works what we did with plasma cash is we said okay each transaction is going to specify an index in a Merkle tree which corresponds to a unique asset at that index and what that means is that gives us like these kind of you know single assets at every single leaf node of this Merkle tree and so exits will specify the particular coins that you are trying to exit and challenges will kind of refute that particular coin in that particular index in that particular Merkle tree particular particular particular and so we have multiple this this actual information I won't go into details gave us enough information to cancel exits if they're invalid instead of forcing everyone else to exit you just respond proving to that that a plasma contract that the exit was invalid that the transaction was invalid and we cancelled the exit in the first place so this meant that not everyone needed to submit a exit before that time limit one person needed to submit a cancellation of that invalid exit so that's pretty cool and by the way you know a deposit is burned to kind of like pay for this this the trouble so no rust to exit and the attack failed thank goodness but there is more thankfully we also have a trustless light client this is actually pretty cool so remember that the reason why we had to download everything is because we didn't know where in the block that invalid transaction would be located but because we have a particular coin ID for every coin that we care about that means that if Alice owns maybe at five different coins Alice is only going to download five different Merkle trees or in this case Alice owns you know one or two coins and they only need to download those particular trees and so now we can scale the block sizes up and the amount of download like the size of the download scales logarithmically which basically means you can scale it you know exponential logarithmic it's an amazing thing Oh looking like if you don't know logarithmic oh god I love it anyway so that means you know maybe a thousand transactions per second or maybe even like ten thousand transactions per second it's you know pretty good with this light client however unfortunately we introduced another bottleneck really sad we have these huge transaction history proofs which that which means is that if you're downloading the history for your coin you need to download that history for every single block that's ever published and that means downloading a huge amount of information and so with like a thousand transactions or ten thousand transactions per second they could be like a gigabyte of history per coin which is crazy like it literally just doesn't make sense once again it like breaks the whole thing it's insane it's very very sad so that's a problem the other issue is that we now have you know this is no there's no fungible tokens support no good fungible tokens support so the idea here was okay every single coin has every single index has a different unique asset and so maybe you have a few dollars in some of the indices and maybe you have a $5 bill you know another maybe a hundred dollar bill so if you want to send one hundred and six dollars you have to send three transactions with you know five and a one and a hundred this is like a usability nightmare to be quite honest and just doesn't work once again for you know wallet software it's like pretty pretty bad um so yet again another issue another big you know leap that we have to hurdle like this we're getting closer but we're still not there so plasma debit came along dan Robinson super super awesome kind of addressed this no fungible tokens issue with combining state channels and plasma and that you know that got us a long way you know that got us significantly further it also helped with the transaction history proofs so this was this was along the you know the right the right you know the right path it was it was getting there but then you know a couple posts by Vitalik and you know seventeen plasma implementers calls later my god these have been crazy and yet another plasma thank goodness um a prime this is this is I would say you know I feel I feel like we have finally hit the peak of a mountain and it is very nice and some Sun is coming up I have felt to be honest like all of these you know all of the research leading up to now there's always been like that layering issue that you really wanted to solve but plasma prime who it's looking downhill it's looking downhill I'm very excited as you can see so what does it do well it addresses this no fungible tokens issue with just replacing all of the leaf nodes with a single denomination and instead of having a single like a small Merkel tree of a you know a bunch of non fungible assets we have a huge Merkel tree and our sins they specify a range of tokens and so if I'm going to send you some coins I'm going to send you you know tokens 0 through 105 and so this preserves our property from plasma cash that we get a light client support but it also allows us to get this fungible tokens support so it's actually pretty cool and we have the same simple challenges that we have in plasma cash so we get to build on that that research another thing is it addresses the huge history transaction proofs with some RSA magic which you can learn about in a plasma implementers call that we had recently as well as a few blog post by metallic you can actually prove that there were no coins transacted in a long range of blocks with a single proof a single witness and so what does this mean this means that as a user if I don't transact my coin I can just you know download one piece of information that kind of covers the entire range of blocks and proves that I have not transacted my coin for maybe a hundred or maybe a thousand blocks so that saves us a hundred or a thousand or way more Merkle tree branches that we would have needed to download otherwise so we're you know we're back down to a reasonable size you know kilobytes maybe a megabyte whatever transaction history so our transaction history instead of growing linearly with the number of blocks that are being added to the plasma chain it's growing linearly with the number of trek times we transact that particular coin much more reasonable so this is 10,000 transactions per second limit maybe like a hundred thousand transactions per second that would be like incredibly cool and then there isn't it doesn't feel like there is a kind of you know thing looming ahead that that keeps us from doing this in a like kind of implementation production setting so bonus while all this research was going on we kind of figured out how to do atomic swaps as well as you know batch auctions some simple designs you can just kind of plug in play with these these auction designs and so we can build on this atomic swap thing that that is native to the plasma chain and we get this kind of scalable crypto economics we get the scalable you know payments and exchange at the same time and so this is really really cool in my opinion and so even cooler right okay so I'm saying all these things you have now the intuitions for what all this means but not only is this is this you know research here but River key for a friend of mine I was telling about I was like men this stuff is exciting as heck I don't know what I'm doing plasm proud I don't know I don't know what the problem is yet like I don't know why this wouldn't work and what he did was he implemented in a single week literally one week you can check the commits a kind of like pre-alpha you know kind basic basic version of a testament of this kind of plasma variant and so this is literally you know the right now it is a little bit you know where we're going to kind of release hopefully hopefully tonight maybe tomorrow but but a kind of like pre pre-alpha it's not it's not quite this was literally one week of work but the point is that it is actually possible to create this chain in a very reasonable very it's like it's a clean architecture finally and this is the kind of process that I've noticed happen all the time where you research a problem over and over and over again you iterate you iterate you iterate and you find out there's a new problem there's a new complexity there's a new area of difficulty there's a new bottleneck and you kind of plug those holes and you kind of expand your processing capacity but this is the first time where a scalable plasma chain kind of makes sense in some ways which is super cool and so you know this is this was implemented in Python using leveldb you know super super simple stuff basically so that people can read it also in Viper I should have written that up there shout out to Viper super fun and so great there's there is this kind of like what what is what lies ahead and and everyone knows you know who does hill-climbing stuff that they this could be a local Maxima but nonetheless it looks pretty good right with one thing that's really cool is we can actually you know the smart contract side of things can stay the same as we scale this this operator so as we you know kind of optimize the kind of back-end side of this plasma chain we can actually keep the same block structure keep the same general format and instead we're just scaling you know maybe a computing cluster so we can basically you can shard Merkle trees very easily so that's cool so like 100 transactions per sec 100,000 transactions per second and like the thing is that i was not going to be satisfied or you know i'm not satisfied until a crypto economic mechanism a script like a real secure blockchain like a blockchain that is really decentralized and good can can process huge amounts of transactions per second that you know these centralized architectures have been able to process for a long time so like this is the goal the explicit goal and it is actually you know it's it's seeming so another cool thing just like randomly there even in a sharded context these plasma chains do make some sense so you can actually you know as you're building up the beacon chain as you're building up the shard chains you can actually create a plasma chain that has a plasma contract across multiple shards so if you spawn your I see 20 tokens on a different shard then you can actually deposit into the same massive plasma chain and transact that that you know thing independently so that's pretty cool and you can even you can even commit to you can commit to token allocations on chain with a Merkel tree and then immediately transact those coins in the plasma chain in a scalable setting so you don't even need to like register the the tokens themselves on the main chain so it's pretty pretty cool these are like some very cool designs and hopefully and I actually right now I'm not seeing why not you know we can scale to a very large you know a kind of like global internet scale like we need we need to make sure that these crypto economic mechanisms if we're going to say that decentralization is the way this is the future this is the you know the way we should do things well we need to show that it actually works for supporting a large number of users and so of course the theorem 2.0 has that kind of vision in it and is actually you know very far along and I wish I could you know I wish I had an hour so I could just do the next talk on the theorem 2.0 but or on serenity but hopefully even with this you know with plasma next to you know aetherium 1.

0 or theorem 2.0 and more you know of course this is not the only technology that's going to be required for this hopefully we can actually support this kind of real global economy and hopefully we can create a you know the crypto economy make sure that it is a self-sufficient you know this is this is going to be something that I don't I don't see like external value coming into the you know crypto system I think this is the point where like the external value has come into the crypto system people are like oh wow this is really cool and are speculating all day however we need to actually generate value within our economy and actually create like this internet future thing I don't know this kind of Internet land that is actually free and decentralized which would be pretty cool and hopeful this will be enough to really spread the memes of decentralization x' @ decentralization as well as the means is a fun one anyway so that is that is that I just put this here I'm just like shilling Yoona swap for a slide I don't know it was interesting anyway I'm also stealing crypto economics test study for a slide i crypto economics test study it's a course and a book written by jinglun wing and I am I just like I just I'm working on the lectures and so I just like put through a couple lectures they're actually it's not just me working on the lectures to be honest there's also you know Kevin Kevin who's working on some lectures as well as Jing so like this is a super super cool thing and once again this is what this was the beginning of my talk was like okay we need to make sure that everyone is included that we you know spread this information because you know everyone has something unique to contribute really and to be honest if we're going to create this like new future free amazing economy like the only way that we're going to prevent it from kind of degrading into a centralized you know like basically control system power structure that we hate already today well it's only going to happen if we have people from different communities that have the actual information access to this information to build it together because otherwise we're going to forget certain things we're going to create systems that don't actually promote equality and instead kind of promote a single person's interest I am I fall victim to this too like I do things that I really absolutely regret while while completely having the right intentions I you know will will you know make make mistakes so we all have to you know remember we're all we're human we need to make sure that other people kind of can balance us out we're in this together and like hopefully this this whole thing will work so you know check out that Devcon are scaling to have god cough that ridiculous website by the way it's probably broken right now but but whatever but more importantly check out the the plasma prime implementation that is you know I'm gonna I'll send out a tweet or two and when and you can download it and actually like send transactions and and you know mess around on a plasma train and exit and then let's scale this thing up because it's actually possible no thank you [Applause] you

Automatic transcript — names and jargon may be misspelled.