Generalized Plasma, Layer 2
EDCON 2019 · April 2019 · 24:25
Karl Floersch reframes Layer 2 scaling around reusable adjudication rules and off-chain messages. Drawing on Plasma development and testnet experience, he compares validation and dispute-based approaches, then explains ownership, deprecation proofs and ways that generalized Plasma designs could interoperate and evolve.
Speakers
Topics
From EDCON 2019, hosted by EDCON.
Transcript
I'm Carl and I'm gonna talk about plasma I'm gonna talk about plasma group and let's dive right and so here's a blank screen just a few months ago just a few months ago there was DEFCON 3 for DEFCON 4 and I talked about scaling this is a lot of pictures of scaling I like to reuse jokes it's hard to come up with them so this is a great joke and I really talked about you know how do we support all of this you know if we want to create a open financial infrastructure if we want to create an open economy if we want to really enable use cases that we don't have today then
we will need to scale in fact you know aetherium is already useful as it stands there's a lot of things that you can do with it however there are just things that are not that feasible and you know one of them being let's say a really fast you know order book like a really nice exchange that that's something that is hard to do so one thing you can do is you can do plasma and that is just generally layer two and so I kind of talked about the the general format you know we've got our two gerbils of course gerbils and Alice and Bob and we have our plasma chain on the on the right and if your ham on the left and so we're committing these compact we're creating these you know big blocks which are just Merkel trees and then committing the
roots to aetherium so you know this is developer conference curious how many of y'all like no plasma have heard about plasma you know if you heard the rap I said plasma a lot in it intentionally to indoctrinate everybody so how many people know about it if you raise your hand Wow everybody okay then my you know slam dunk for this this stuff so the cool thing about it is we don't have we're not limited by this you know 15 transactions per second because these transactions are made off chain however it is important to note that this 15 transactions per second which is the etherium you know the current approximate you know transactions per second on aetherium which is generally a kind of like weird measure and you know
don't really trust these numbers overall but I'm gonna use them a lot because they're you know the culture Marketing so the the you know 15 transactions per second we're not limited by that however it is the number of disputes we are able to resolve but I'll talk about this later so off chain layer to scaling so there was this this mountain and the future was unknown and now it's known because it's a couple months later and we kind of dove down a rabbit hole of plasma I wasn't I was medium into plasma at the time you know running the plasma implementors call and doing all of this stuff but it got a lot more intense when to the plasma group form this was a really defining moment
it was really exciting plasma group formed it was jinglun Wang Ben Jones Kelvin Fischer and myself and you know we came together and we were like okay plasma needs to exist and it's you know I think that we we can do it and pig pea IGI is some one of our repos and so we kind of acquire this mascot of the pig piggy so that is you know this this this team got together and my goodness it is amazing to work on a team like this because only in like two months we were able to release a test net and so we we created it we made a blog post introducing the test net and you know we
created a website and it was actually incredibly easy to spin up one of these plasma chain spin up an operator you just npm install it you create an account and you deploy it and you know as long as you have NPM installed it was it's a it's a it's an easy one to you know few step process so we got like more than 50 plasma chains deployed really pretty exciting and there's you know you can list all of these plasma chains and they had funny names and stuff in fact you know let's to be clear very few of these plasma chains we're doing like really useful stuff but it's pretty cool to have you know that process be easy enough that a bunch can be just deployed and each one of these chains could process like two thousand
transactions per second so like at least we were in and so you know that's a lot of transactions and once again though don't trust these metrics because not all transactions are the same these are just like simple sense to what you know to random like mm you know made-up addresses that you know I'm simulating and it's dependent on the number of counts there's like so many factors that go into these kind of benchmarks that just makes them kind of hard to trust but the point of the the main point is that with you know more than 50 plasma chains each running many thousands of transactions per second you can think you know okay that's a lot of scale we're pretty fine so thousands of blocks were produced once again a lot of these blocks didn't have really much in them
really just simulated transactions or empty blocks but still you know it it is cool to see these plasma chains actually you know working so on the launch day we had you know a number of features we had like this one click deploy that I was talking about mobile support for the client node here see 20 support atomic swaps optimistic exits you know here's here's running a simulation this is the wallet this is you know a burner wallet similar to you know Austin's really cool wallet and you know a block Explorer of course and also a speck that kind of outlined all of the architectural choices that we made and it was great there were tons tons of code got written
and we were you know celebrating and it was honestly you know quite at quite an adventure but we had one question what about state channels hmm hmm and this kind of spurred some thinking and you know some melting pot of you know plasma group folks and you know other people and this is just generally like you know I don't know how ideas form but it's definitely kind of it comes out of a community a community came to an idea and so we are all sitting around then we were like in oh my god what's happening what's happening what's happening what's happening I told I said I would sit down for this this is weird whoa whoa look at all those layer two
technologies whoa whoa whoa layer two layer two oh I have a lot of these oh my god I'm back trust Trust trust the world can scare Hill trusted computation scales with love you know anyway so after that crazy realization it was a unifying moment of just layer to tech and like it was it was weird because we were like oh how do we introduce state channels oh we just kind of figured that these things aren't that different after
all and it all fits in like puzzle pieces into one larger whole like universal consciousness and so now I'm gonna go over some of those with those words each one of those words that I that I had on the screen I'm gonna go over them individually so first there's aetherium I don't know if you all have heard how many people have heard of aetherium okay um anyway so here's you know Alice on etherium we have this on chain State and Alice wants to know her balance and so she downloads that on chain State and boom now we have this trusted State this you know address and some amount of eath and maybe alice is running a light client node and you know using all that kind of stuff so this is this is you know that's how aetherium works in in a nutshell now you
understand it so another one of these was roll up roll up is a pretty cool relatively new and and definitely exciting tech that has two components a you know a little bit more than just aetherium with just transactions now it has these you know roll-up contracts and off chain zero knowledge proof provers and so these proofs are supplied to aetherium and that updates the balances and so this is actually a more efficient way instead of validating all of the signatures you know one by one we have a zero knowledge proof that all of these signatures and all of these balances you know do check out and so that's pretty cool and so now if you know once again alice is just downloading stuff from aetherium and generating this trusted state this is the state that she can
trust but with payment / state channels it gets a little bit more interesting now we're not just using aetherium for you know downloading the state we're actually using aetherium for this kind of adjudication process so that means that if you already hidden know about state channels you know that there are the is off chain messages and people sign and send messages between each other and then if there's ever a problem or a dispute someone goes to the main chain to essentially you know fall back to the main chain functionality so that you can decide what the actual balances of each one of the users are and so this is a kind of like you're switching a theorems role from being you know a recorder of each one of these balances to instead
not have the most recent balance but instead just adjudicate if there's any problems so adjudicate just means you know judge whether you know be the person who judges what is true so like you're kind of a judge but I like the word adjudicate so we have these off chain signed updates and you know now Alice is downloading both from etherium but she's also downloading from the state channels and so now our trusted state is a kind of combination of this on chain state and off chain messages and so you know if Alice wants to update this state she can just sign messages and that you know changes the trusted state and you know Bob is counter signing them as well and so this is pretty cool because all these messages are completely off chain that is you know we're not limited by
the 15 transactions per second but once again that adjudication process is limited but you know that's why we have a theorem 2.0 anyway so next we have plasma plasma this very similar we've got now we have on chain you know plasma contracts and these commitments these block commitments and the inclusion proofs as well as some other you know transaction data off chain and so now if Alice is able to you know download once again download the off chain data download the on chain data produce this kind of trusted State so generally this is you know this is a kind of like just generally layer to where you have this these off chain messages and you're you're using them you're downloading
those off chain messages and you have a proof and you have your local understanding of what is trusted state what is the actual state of the world what can I trust and that's really the fundamental thing that these blockchain technologies are all about and so we have this layer one and layer two pretty pretty simple and layer 115 transactions per second layer two who knows many transactions per second really like you know the once again these metrics are a little bit weird when people tell you them like you can technically have a to a state channel that you know you send messages back and forth saying I'm gonna update my balance by one and just you know you can use as much computation in this like little stay channel accomplish nothing but your transactions per second would be you
know in the billions if you want whatever so here we're using once again we're using the the judge so we are limited in some ways scales in the number of disputes instead of the numbers of the number of transactions that is pretty cool and we're making sure you got to make sure that it can run on a phone right you can download these proofs and generate a trusted state on a phone in a wallet and you know use it for applications more generally and so you know we are working on making sure that there is a client you know we are we're not necessarily going it's best to not be the only client hopefully some other people do this but just like making a general like layer to client is it's a very sense sensible thing to do but these are early days and so we're just getting started
however you know we already do have our wallet which works in a browser you just go on a web page on your phone and it's it's it's literally embedded into the web page so it's very lightweight it can you know it's pretty cool so here layer one this is you know gonna be a fun little diagram layer one we have our our you know smart contracts just you know all the things on aetherium you to swap or you know CDP ES and whatnot and then we have the adjudication contracts that I was talking about and also the role of contracts I should have put here and the you know state commitments and then we have this boom we have this whole other level of infrastructure which is you know the plasma operators or the payment channel hubs and you know
maybe all of the watchtowers and this is definitely not a complete list but this these are all you know these parties that kind of exist outside of the context of this fifteen transactions per second that are kind of contributing to the complexity of this financial ecosystem and so even more you have even more kind of participant where you have the you know like potentially will will see like a you know zero knowledge proof a proof miners and also third-party state storage which you know of course we already have and you know we can we can really scale these things that this is just the rest of the Internet right and it's kind of like it's like pulling in the trust from that really tiny tiny little bit of you know trusted computation we're able to expand it very similar to the light wave I promise it
wasn't just for funsies although it was a lot of for funsies that meditation thing is pretty fun anyway so now that was that's that that's kind of a the kind of overview of this layer two thing now let me dive into like the specifics of what the format of this like generalize plasma stuff and predicates so the key piece is the state object and so this is just you know a particular piece of state it's just an object of state and it has two things it is a one a predicate address and two parameters predicate address is a smart contract deployed to aetherium the address of a smart contract deployed to aetherium this is an adjudication you know it contains some adjudication logic parameters are the parameters to you know relevant to that state that will
you know may or may not be feet fed into the predicate and are used for you know these state transitions because everything is just state and state transition folks I mean I you know who Vlad got mad at mean last time I said that but I'm gonna say it again because I never learned so these are just some little predicates that that you know we we have a very that we have like a you know SPECT out in in some capacity we have you know ownership which is just okay I own a particular coin or multi-sig or State Channel predicates or you know Dex predicates which is really just add atomicity conditions between you know two transactions and CDP's all that kind of stuff and so what we're gonna do with this state object is we're
going to actually put it into these block commitments so this is those periodic commitments on plasma that I was talking about and so a state object you know we have this predicate address it's the ownership predicate that means that the state object is really just an owner and the owner is able to transfer whatever the value of this state is so maybe this state is like you know 1/8 or something and the owner is Alice and that is being committed to a particular block and so now what we have is we have the transition from this state to the next state so the ownership predicate has all a kind of a deprecation witness so we deprecated this day that makes it you know it's making it the old state in all out-of-date state and that deprecation
witness includes two things it includes a inclusion proof in the next block of a you know transfer of ownership as well as a signature that authorized that transfer and so we can put this all together and we can see this this diagram where we have to state objects in two different blocks the first one is block zero and that state object is allison is the owner the second block is you know bob is the owner and the state object and the second block is the most recent state it is the only non deprecated state it is the you know head state it is the trusted state and it is the trust is based on two things one it's based on the commitment which is on the main chain and the two it's based on this
owner these this deprecation witness which is off of the main chain so we have the same format once again we've got our proof which generates a trusted state and alice is able to view what the world looks like through this this this lens and knows that her idea of what the world is is the correct idea right that's what we're trying to do we're trying to build trust and so here's aetherium you know the adjudicator and here are the off chain messages now this is a kind of fun proof because this proof not only includes the you know plasma messages the off chain inclusion proofs but it also includes these off chain state updates so you can mix and match you know this is really with all
the same kind of stuff so in this case it's you know a plasma chain you know plasma chain is part of this proof but also a state channel is part of this proof so the off chain inclusion proofs are you know let's say the first state object was committed to the you know the main chain and the second state object but then we also have these off chain signed updates which were you know transactions in an estate channel maybe the first state object was I'm going to open a state channel those two other messages were sending money and then the third one was closing the state channel and this is still all done off chain so we get the nice scalability benefits so it's all you know it's all one it's all just layer two like this is what we're really talking about is like intelligent
ways to interact with aetherium so what do we well we get a clearer picture of what layer-two is we get native Interop between plasma chains we had this before but it was really made clear that all of this stuff that we're talking about we're you know whether it's state channels or plasma they're all they'll live within the eevn they all live in within the same execution environment so they're able to access you know synchronously all of the different state within that execution environment which makes it really nice to do things like atomic swaps which could be tricky if you know if you're doing it across chains that have no native way to you know read each other's state now another thing is you know of course expanded
functionality the reason why it was you know it's actually easier to expand the functionality of some you know a kind of decoupled architecture like this in the reason why is because you're able to you know audit P components individually and multiple people can work on different components that all fit into the same ecosystem kind of like you're auditing different smart contracts and so that also ties into this upgrading the functionality right we're able to dynamically as a as a plasma chain is living you know upgrade its functionality and not actually have to you know redeploy the whole chain and re on board a bunch of users which would be you know pretty much not a non-starter to be honest and so of course we also get the scaling crazy scaling properties
of layer 2 so some things that we did was we hacked together a lightning Network predicate it's really you know not complete but it you know just for for testing purposes we also you know release this this explainer thing so if you want to dive in deeper definitely check out the medium you know plasma group and also we put together a spec and a simple Python implementation so that that's pretty cool and so there are still definitely a lot of challenges and the biggest one I would say is like all lives on this developer tooling perspective or a kind of boat because it is really really not trivial to make you know plasma chains generally in layer 2 technology generally right in in
aetherium smart contracts you're just defining the business logic of your code right but in plasma in layer 2 more generally you have to also define the arbitrary in logic which is you know decides whether or not you know who is the owner of what based on off chain messages which you know introduces these data availability problems and you know a whole host of things that I won't talk about here and so you know things that are may have made way more difficult it's like large shared states state that has a lot of dependencies that a lot of people share it makes it very very difficult to to you know work with and like into to adjudicate and we want to make it as easy as possible and so this is you know definitely an open question
and you know potential solutions you know true bids here knowledge proofs you know weaker trust assumptions you can of course have a you know a party that will sign off on things and if you trust that party you can do anything you want really so another thing about this tooling is that a lot a lot a lot of you know plasma you know research and there was a lot of implementations that have been created and they're all kind of reinventing a lot of wheels we're all like coming up with the same stuff so it'd be nice be nice to kind of put together an example of like a something that is more extensible something that is less opinionated something that can be reused and so that is something that we are definitely trying to do and trying to influence others to help do and that is just like build let general
layer layer two clients that would be really really great and once again you know these things can live in mobile browsers fantastic so the path to scale right we we actually have the first three of these where we have a age you know a test net release we have a generalized plasma specification generalized plasma you know test implementation is really just kind of you know simulation but it has all of the logic they're the main things that we're missing it are like auditing the smart contracts as well as hardening the code base and getting it ready for production payments plasma PPP you know tell your friends about PPP they have something to look forward to
production payments plasma so this will be this will be a lot of fun but you know of course it's not the end of the line you know what's next will will this will this will get us to the point where we can actually scale payments in a secure and decentralized way which is like definitely a you know a big it's pretty pretty pretty right and that will like there are definitely these claims that you know black chains can't scale or theorem can't scale I mean they're just like ridiculously you know false essentially and this is stuff that is done you know can be done in a matter of months it's not that hard it's not hard at all and now what's next it's all about the plats all about the plats y'all and so one of those you know one of those flaps that we can say oh my god that rap is gonna
live with me for the rest of my life well okay the next one is decentralized exchange right that's a nice one and of course asset issuance and you know video game ownership you can issue massive amounts of assets in one on chain transaction or you know tons of cool stuff and you know some rainbows and fluff so it's gonna be a lot of work I'm not not saying that it's not but it is definitely like a short term get you know short term scaling thing but we're you know we can we can get through it and you know now we get invaded by this yellow thing and piggy our little piggy our little piggy it can support the scale of the world it can do it he can do it look at this cute pig you know pigs are very intelligent you shouldn't
eat them they're probably sentient weight self-aware at least anyway great so this is all about veganism love you love knows no borders I always put this slide I haven't prepared anything to say here but really it's important for us to you know share information and just be good to one another and you know be good to ourselves remember to self-care is very important and also blockchains can scale they do scale probably you know enough for a while for a lot of applications already and to be honest we just need to like be patient there's nothing crazy happening we're just moving forward one step at a time and it takes a while to get to the
decentralized economic finality future of you know artificial intelligence and AGI and you know happy totalitarian states but we will get there thank you so much plasma guru [Applause]