DAPPCON 2018: Panel - Talking State Channels and Plasma
DappCon 2018 · July 2018 · 28:48
A DappCon 2018 panel takes up state channels and Plasma, two competing approaches to scaling Ethereum by moving transaction activity off the base layer. The discussion weighs the tradeoffs each design makes between throughput, security assumptions, and developer complexity, framing Layer 2 scaling as a central challenge for smart contract platforms at the time.
Speakers
Topics
From DappCon 2018, hosted by Dappcon Berlin.
Transcript
yeah welcome to the kind of off chain panel right we talked about plasmas their channels and yes developers most likely when the question comes to how to scale application the answer is easy to scare off chain use plasmas tensional sounds like this and then you might not know how to actually do it maybe we can bring some light into this today maybe you guys introduce yourself briefly like your name what you're working on how that might help developers okay so my name is Abu soo I'm working on the radio network I have been working on the radio network for two and a half years the radio network is a payment network so we are doing payment channels and not
necessarily state channels so the radio network is really good if you want to make payments that doesn't and you don't want to wait for the blockchain to actually to confirm the payments and you don't want to pay for the fees right so that's that's the scaling solution that we are offering we are offering the scaling solution for payments so my name is Tom close I'm the founder of magma which is a state channel research and development company so our first project has been the four smooth game framework which is a framework which you can build very simple state channel applications on and I'm gonna be talking about that more this afternoon hey my name is Alexander I'm with big noses and I'm a research over there and we are building
exciting decentralized exchanges using batch auctions boom hi guys my name is Johan I'm with a team that is called parsec labs we focus on plasma research and our target industry is kind of gaming as well specifically we're looking at how to enable smart contracts to run on top of a second layer solution like plasma thank you maybe I said what do the two second layer solutions that we're talking about today say channels and plasma design have in common technology-wise what do they share some building blocks in my opinion the biggest thing they have in
common is that they're scaling solutions but how it works in the tech side they have like huge differences for instance if you have like a plasma you need to wait for the operator to actually publish the hash of the current latest state in the changes of their interactions when used when you are using plasma with the maintain and state channels they don't but by definition they should not go engine right you're avoiding the change for all cost and I think that's like one of the biggest differences so it's like building blocks today both work with kind of deposits or Cheerilee yeah so I mean I guess I would say that there are lots of similarities between how the like high-level pattern
of how state channels work and how plasma works so some of those features they have in common is both of them require you to deposit some funds into a contract on chain both of them involve then some off chain agreements being sent back and forth messages signed messages being exchanged between some participants and then each of them has a I guess like a timed checkout process and that timed checkout process is kind of important to making the whole thing work cuz that's your ability to like challenge that something Bad's happened off chain so it's like those three things that deposit beforehand the messages of chain and then at the end
this like time period before you can check out your stuff to enable someone to challenge what you're trying to do I see there is just like the three things which are the main similarities between state channels and plasma exactly I completely agree and another thing that we share that we all think our technologies are very safe that they basically have the same security as the root chain but indirectly we all make the same security assumptions namely their transactions and being able to send it on the theory chain and that participants can get online so we take a live NASA sumption to these technologies yeah those are good summaries I would maybe add to kind
of create a distinguished went to other solutions is that it is not just like bridges to other data structures like other block chains because you have these crypto economic games that secure them and that's what gives you the security of the theory of miners or of your hosts blockchain security and you don't need to spin up a set of validators or create a proof of stake network to have all the security from this design model kind of okay so you would say there's if you want to have a high-level metaphor that would be
there's kind of the church and deposits on the blockchain and of chain we have signed messages agreements between participants which they can enforce in the blockchain if necessary something like this okay um then let's talk a bit about trade off so there's like two different technologies you're mentioned often say channels plasma we say are the trade offs between them yeah so for me like the biggest trade offs that you have with say channels is that you don't need to interact with the blockchain so once you make the deposit you open this a channel and then you can just make the exchange of science signatures sign messages off chain and you don't need to
publish that data to the to the main chain in contrast to the plasma where you you have to actually update the state on change so there is some interaction with the blockchain I mean in that and the consequence of this is that on plasma you don't have necessarily the same finality guarantees as you have with the state channels because in say channels once you receive a proof you can just store the proof and you are for sure guaranteed by how the smart contracts work that you can use that proof on chain and that means it's final once you receive the message in contracts in contrast to plasma that you actually need to wait for the confirmation of the d-block hash that's published by the operator yeah and yeah sure there are differences in
the finality that you achieve between state channels and plasma for me the biggest difference between state channels a state channel is an interaction between a set of parties that were fixed at the beginning of that interaction so like if you got an interaction between three parties and you know who those three parties are going to be upfront and people aren't going to join that group of people and people aren't going to leave then a state channel is a good solution if you need people if you need like an off chain agreement where people can be added to your chain and then removed then plasma is a good fit so that's like one key difference like with state
channels you need to know who's involved beforehand state channels proceed by complete consent between that group of individuals so there is no good way to add new people and remove them after the fact yeah that's to add to that I think when you want to use state channels you kind of have to come and start on the main Network right so you need to be able to send a transaction into the state channel to say hey I'm here and one of these set participants what you can do with plasma is that people come at any point of time so they might not actually know that the etherion main network is somewhere they might be completely new
to the blockchain space they create a key and they can participate in a secure network already without needing to pay gas they they're just part of this app and then once they kind of learn about the rest of the ecosystem they can exit into the etherium main network and you know kind of float around but I think that's definitely something that plasma will maybe be good at is to bring new people to the ecosystem and that the difference may be you are you disagree with this one but like on state channels it's much much to get general state channels that can also allow you to execute some smart contract logic within the state channels
and on plasma I think it's it's much much harder yeah that's definitely a topic that I spend a lot of time with and um last year my team or this team I'm working with has built a decentralized poker platform with state channels and trying to execute the poker logic in those their channels and the issues of course what if you're on a mobile you're traveling on the train and then you have no connectivity you know the whole kind of app state if one guy goes offline it becomes difficult I I would actually say that to like state channels have the capability to do these like arbitrary protocols but it's not like taking your smart contract
that was running on chain and just putting in a state channel having it work you do need to kind of like design your interaction with the state channel in mind so yeah I think that's an important thing to bear in mind like it's not just it's not just like take it and it works there like a lot of nurses term generalized state channels so what is actually generalized in that state channel like it's not the computation right as you just said so I mean I think so the term generalized state channels isn't completely well-defined but to me it means like a state channel where you
can run an arbitrary computation and in some way it's building on that metaphor of being able to take your contract and just put it in a state channel but actually it isn't quite that simple there is more to it it's more like a framework for building arbitrary state channel interactions rather and a framework for taking an Unchained contract and being able to run it off chain so I just published a post on f3 search with the title why smart contracts are not feasible on plasma so we kind of have these same problems or limitations that we can't just take any smart contract of the main network
and put it on a plasma chain because of these problems with data availability and the fact that actually everything kind of runs somewhere about not on chain um there's just very easy ways to grieve and attack and stuff like that and I think the point where the research currency is is more at the state of figuring out what is possible what kind of smart contracts can we kind of put into these off chain venues of execution and which ones can we not yeah that's quite interesting and can you give some examples of applications that you think are better built on top of state channels and others might really benefit from plasma design so I think plasma is great for decentralized exchanges just
because new parties once you join in and add their liquidity plasma is great for some kind of decentralized reddit there are many other more variants of these ones but basically all the time if you need that some other particles can join in then you definitely should build on plasma from the gaming world maybe not gaming entertainment think of casinos or something like that where you basically you know deposit some money and then you send it around a billion times between kind of the same set of participants and eventually someone withdraws it that's a great like use case for something like that and then if you can put logic on top of that
and have like fair tournaments and games and all these kind of things it becomes interesting in general if you just kind of create a sort your transactions on the theory and main network and you say those transactions are high frequency but low value and these transactions over here they are low frequency but high value then you definitely know that once the gas price goes up the first category is kind of pushed off the chain right and our project we're kind of trying to create a public venue where these transactions can have a home and to distinguish the different use cases that are good for that so for it's a challenge I think they're really good
for fungible tokens where you need to make like micro payments or frequent payments for streaming API s and that sort of applications and obviously payments right I think the main use cases yeah I'd agree with that so state channel sweet spot is like a small number of participants because they progress by complete consent you basically needs to get everyone's signature to progress the state so if you get up to like nine ten people you could imagine that begins to get cumbersome one person missing means everything grinds to a halt and so having like I imagine state channel applications will like their sweet spot is like to to like five or six participants one of the interesting
things is like to come back to that question of like what a sniper channels good for like what sort of things can state channels not do and there are certain things which are hard to do in a state channel so one of the things is the concept of time you know like if things are dependent on time that's a little bit hard in a state channel because in a state channel the only notion of time we have is the time that we all agree on you can in general challenge on time like if I give you a state and say I gave it to you at 12 o'clock and you don't say yeah I agree by the time I take that to the chain it might be like ten past twelve and there's no way the chain can adjudicate
whether I gave it to you at 12 p.m. or not so that like is one category of things which you have to think really carefully about it's not impossible to do that in a state channel but those sorts of in games that involve time you have to basically have different designs about when you're trying to bring them off chain yeah that's one example of things which become harder and a State Channel I guess okay so say if you would compare them on the dimensions of latency Genesis decentralization throughput could you give some rough comparisons um whether equal where one is I don't know
I think the throughput is really something that depends on the app and if you are building a plasma chain or state channel for one specific app you can run it in a pretty much centralized fashion right because you just need this operator or something and the users that use it they are still have the security of the main network so you don't need to create decentralization there so you can run a lot of computation but there is a limit of course because by design users can exit at any time and if there is an attack on the plasma network all users all the billion users you have on your plasma chain might want to come back to
the theory of main network and then it's kind of an issue so you don't really have capacity issues and running the chain but once you want to exit the chain then you need to think about scalability of the main network and what we don't want to do is people that attack the theorem main Network we don't want to give them even more money they can harvest from like plasma chains if they you know are successful at spamming the main network yeah regarding centralization I think the biggest difference is that when you have a plasma you actually need to have the operator so that's like one single point of failure that in contrast to state channels you don't have a single point
of failure because it's like a network in each single node controls their own state so it's a little bit more centralized in that sense even though they're you you don't trust the operator yeah although later on the later versions we can also make plasma chains with many operators it's just that currently it's much easier to have this one central guy and just because plasma is designed in such a way that if there's one guy behaves badly we are still all safe we just rely on it - sniffs oh yeah I mean state channels your throughput is limited to how quickly you can sign and send messages one of the nice properties about state channels is that your storage space is
bounded so like as we progress the state more and more and more you don't need to keep the entire history of all states you only need to keep the most recent state so it's like order 1 storage and as far as I understand that's not the case with plasma as the plasma chain gets bigger you need to store more I think yeah there's this arbitrary kind of period that the first implementations have set which is seven days and you want to come back every seven days and kind of we're talking about the plasma classic kind of variant here you need to come back every seven days and make sure that you know the plasma chain is still
liquid and there's data availability otherwise you should exit and only if you check every seven days your exit will be on time otherwise you lose your money right so and in this period of course you need to maintain a lot of data at least a check point so I could you could say it's kind of bonded to these seven days the amount of data that you need to verify idea you need to keep a check for Alex you said something interesting you said it's not centralized necessarily because you can just have multiple operators which one kind of ran a consensus protocol but no the question is what's the difference between plasma and the sidechain the main difference is how plasma is
kind of rooted into the root chain like because we are making these commitments every time we can use marker proofs in order to prove exactly what happened on the plasma chain very easily and this kind of gives you all the security later on okay so this is very different from say having two block chains which can communicate by sending messages to each other and are able to validate the validity of the messages I would say it's very different in the way that if you run to chain and you want to get out of one of the chains you need to be able to send a transaction on that chain or interact with it and then that way plasma is very similar to state channels that you don't
need to know anything about the plasma chain to be able to exit you just submit your exit and I don't know the client crashed or the company went offline or anything like that you can get out anytime without even looking at the data structure or what's happening on the plasma chain for the developers it's just something they can use right now just download use it as a building block for Jerry applications today for plasma I think there's nothing really in production these days but we have plenty plenty of prototypes and I encourage everyone to try it out to add to that there is kind of four good solid
implementation I think Bank EXO Mesa go one more and then of course ours but it's at this state where conceptually its sound and we know what the security assumptions are we constructed exit games for every edge case that we can kind of see but it's in the state of how do you say like smart contract implementation and back-end implementation there is no user experience designed for it yet so we don't have wallets that are plasma files and the way that they notify you if you haven't been online for seven days or something like that there is no e IPS that define how there is a general exit procedure from any plasma chain you're
on and I think what we should very much distinguishes implementations of state channels and plasma chains that are specific to one project so you might use a Mesa go and you don't know there's plasma underneath but you have this option to exit but there can also be infrastructure that is public and everyone uses it like the theorem the Bitcoin lightning Network is a public infrastructure right and everyone can send payments on it and in the same way that can exist the plasma chain that everyone can use to do payments or deploy contracts on this we don't have here so there is just specific projects trying to implement this design concept plasma for their for their apps completely agree and one
additional point like even the research has not yet really settled on yeah this is a really good solution I mean we started with a minimum of a a plasma window would plus my cache plasma XT plasma David and now we have two more viable plasma and like from all these iterations you can see we are improving the technology is still in research pretty much and yeah for as far as companies it's it's hard because if you're working on such a moving ground you can need to update all your thoughts and everything kind of on a monthly basis yeah but as far as the loading software inserting usually I need to say that you guys can use rate in the microwave it's working really good yeah yeah sorry yeah with payment channels of
C there's right and there's also like a payment channel implementation team called connects to working on which uses a virtual channel which is like a state channel concept for state channels themselves there isn't a lot out there beyond tweak owed at the moment so the L for counterfactual team will be releasing code in the next couple of months showing how their stuff works magno so mag know we've released a force move game framework which has some examples online you can check out the library and like build your own games with it and in the next in fact in the next week we'll be open sourcing an in-progress project where we are
building the game of rock-paper-scissors on top of that framework as in with a complete end-to-end user experience so if you're interested you can check that out so the Magno github don't know if the audience now knows whether they actually should actively already at this point in time look into you on these technologies to build their app or should I just keep on prototyping what they've done before on the blockchain maybe also relate to this question the what do you think how much harder is it to build off chain instead of just writing smart contracts to judge glide on chain say by a factor of two three four yeah I think it's way more harder because you actually need to
think on how you're going to make sure that they say that you're producing it's always a valid say that you can actually use to sell one chain and that adds a lot of constraints you how you actually make the state changes for your application you cannot just like write normal code you need to write code that makes sense you use an SI channel so I think it's harder to make a channel yeah I mean in many ways that's what the force nib game framework was about it's trying to make it easy for people to write these off chain games and interactions because those require a different way of thinking it's more thinking in terms of like states and state transitions and so what the force new game framework gives
you is it's a way of defining a set of States and a set of valid transitions and then having the framework take care of all like the off chain challenge and that sort of stuff for you completely most of these points they can we really copied over to plasma that we have exactly the same issues we need to build this additional infrastructure of chain infrastructure and many many services around that this I don't know maybe a factor of five five times more effort I agree with that and a general takeaway from building anything on the blockchain was always even with smart contracts is that you only put the core business logic on chain and everything else
happens off chain and just with the increasing gas prices and with these new design patterns it becomes even more important to think that way and just isolate what is really important for your app and put it either on chain or if you can into a stateful level two design but always make sure that you don't put like data or unrelated stuff into the business logic of your app okay thank you we have some questions from the audience some are around about what obstacles plasma will face design-wise security wise but I think that we discussed already and then there's the question about people have been confused about
the statement that in a station or not it's not open for everyone to join while a plasma yes is it correct that same plasma can send some terms to someone who's not yet participating in that work and only has to have say a broad key to later claim them is complete grant instead she knows that would not work because so in a way it depends which statement you're talking about like if it's a statement that you can join a plasma chain without having any funds on the etherium chain I think technically that is also true for a state channel like I could find you you could generate
a private public key ket pair I could create a state channel with that with your prime video like address you don't actually need to have touched the etherium chain at all but we could have a state channel open and I think that is equivalent to plasma if it's a statement that you can't join a state channel that does need to be clarified slightly so you state channels progress by complete agreement between a set of parties decided up front but you can create virtual channels so like if I have a channel on chain with Matt and Matt has a channel on chain with Bob then I can create a virtual channel with Bob so in
some way I've managed to join a channel that wasn't there with Bob's I've like managed to construct a channel of chain so in that way maybe I've joined the state channel but you can kind of think of it as like I've created a new state channel which also dresses by complete consent and once I've created that state channel no one else can join it so there is a little bit of a fudge there that like pretty much the way of thinking about it is state channels have a predefined set participants which can't be changed during the execution of the state channel yeah just sure that I think alike the biggest difference is that and in the plasma you actually don't need to
make interaction with it or with the blockchain to actually get in plasma but where with the state channel actually in to send a transaction to the blockchain to actually create the first channel I think that's the biggest difference someone does someone does some wasn't necessarily going to be one person in the state channel or could not do the on chain transaction