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

Loading player…

State Channels and Blockchain Applications - Jeff Coleman

Devcon — 2017DevconMon, Oct 9, 2017, 12:00 AM

Transcript

[Music] so yeah if the presentation gets you excited about developing some doubts this is who you have cup state channels making a petition practical so simple problem you're gonna build your awesome down through your applications access to the world's most secure decentralized and trust free mobile phone for $19.99 how we deliver an amazing user experience and talk about if any of you are building large-scale maps you already run into these limitations and the answer is stay gels with the giantess flavor info that you came down from time to read so we're gonna quickly review the concept of state champ let's teach them something that come up I think any three of the presentation so far but I know not everyone will be familiar with them so we're just gonna do a brief overview of what is our step one to make me a state channel find someone you want to use it with and create a special smart contract idea of this contract is that is a very simple judge it doesn't understand a lot but it mostly understands that if you made a promise you keep that promise unless you changed it later so if you send the promise in to the judge and it says it can be ten years later kind of waits around for a bit but says what's the earlier promise I didn't hear later from this must be the final product and then it basically does everything says that's the basic principle of what we're doing with that principle we can take a lot of very important things that your application does take them off of the watching where it's expensive and slow and make it cheap and instant just directly between the partners so we have this joke you want to take some state and put the smart contract in control of it now before you do this make sure you get a promise that you'll get control of that state back that's very important the judge will enforce these promises and because in a state channel nothing can happen oh good promises can be added unless all the parties to the state channel agree that nothing can ever happen without your permission that means that having the judges in charge is still safe it still gives you the guarantees of the blockchain it still gives you the properties that you need in the security and reliability of your halves execution so step 3 now we're all set up we're ready to go this is not some part of those state channels the two parties can just agree that we promises they can just agree this is the new thing we want to do this is the new thing we want to do with our state this new way that we want to transfer these tokens this is the new way that we want to update this value that the smart contractors in control of and because you know that the judge will always give you time to tell your side of the story the instant you receive that promise that has been agreed upon by both parties it is instantly final because as soon as you have it you know that you are guaranteed that you can get in time even if the other party tries to pretend that a previous version was what was going on the judge will not be fooled they will always give you time to submit your response that means that all of these promises can stay off of the chain we can update these many times though the rape example this morning streaming live payments for an energy application that switches something off if you don't have time if you run the funds or you decide to stop paying for it in real time these are the kinds of applications that we envision for block chains for a long time but they're not quite performant impractical if you're gonna have to actually execute all that I chain going back to with your broader doubt if you're trying to give it a good user experience and your user has to do something critical in the app and then click and then wait for three or four block confirmations that's a major interruption in user experience these promises are instantly final and that's fantastic so you're all set up everything that you want to use inside the state challenges between the two parties you can just agree slamming promises I've been the state between the two of you three of you for me hurt me or the state channel if you do want to take some of that state and use it somewhere else there are some things you can't do excited state challenge that's your big disclaimer text in the bottom there then you can just sign send it straight to the judge you do not have to wait out that time GERD if you're both available and in agreement that this is something that you want to do so withdrawing from state channel is 10v has fats and normal as any other transaction on the network as long as the parties are available and that's a basic overview most HL it's very simple in fact it's a little too simple so we make it more complicated so let's make a little bit better let's amp this up a little bit so first thing I lied you don't put a judge in the blockchain you can put the judge into the premises and then you just have a multi-state in the boccie this is much better it's it's tighter it's more compact it gives you better privacy properties if someone's looking at the block champ they just see it won't stick that occasionally makes transactions nothing suspicious about that second users tend to go off the line one of the challenges if you are using a state channel is that you have to be available to tell me their story to the judge when users aren't often not available so this is another key insight here is that users who are gonna go online you don't have to be available yourself that that promise just has to be available what you can do is you can just take a bunch of bystanders set up an agreement with them this could be in state channels as well it says in the event that the other party does publish this this old state I want to make sure that you publish this latest thing and if you've set things up correctly there's going to be a big giant punishment to that other party for publishing something that's out of date actually Joseph who is going to talk later on about the security models that you work on it in context of state channels so there's gonna be plenty of money to fund the participation of these these three parties and it's very competitive if one of them doesn't do their job the other one is able to get in and get back that little edge so this is something that you can really rely on market dynamics to do for you and then third the most important thing like Hyksos presentation earlier this morning is you want to build these channels into giant networks so if you are going to be in a state channel with another user you don't want to have to set up that state challenge just for that one thing that you're doing that that does not take these full advantage of power of state channels instead you want to build these into giant networks so that if you have someone that you're not directly connected with and you're not even one person away from but you're two people away from meetings combine those three channels together you can make agreements across the channels that are all conditional on each other and the nicest thing way after they account Joseph Koon is going to show us a little bit of an example of that and build these giant networks so that you don't have to have a dedicated channel for every person that you're going to interact with in your application now and this is exactly where rain comes in this is what this is all I know the comment most assignment channels we think about these pairwise relationships between two parties there are lots of contexts where you want to put more in all of these situations where you have many different links the tides have a lot of resources one of the challenges in stay chalasis even though they're instant and they are trust free they do tie a lot of resources if you are super safe with them as you should be instead of having those spread across multiple channels you can sometimes have an urban people who have a reason to be in the same state channel together and tie up your regular multi-state was just a few extra keys and that works perfectly well as well so let's make this concrete let's talk about a specific gap and how it would change if we're using state channels I win oh and I grab either dice IO which turn it to be a bad example because I thought of it but that I wouldn't check and they're offline now but that's fine here's a rough overview about what ether dice the IO does this is a gambling contracts app that tries to be provably fair for some definitions of provably fair the idea is that the operator of the bed generates some entropy and they submit a half of that that ends me that secret into the smart contract the users then submit bets that are going to be based on the random value it's going to be calculated later after a certain period of time that's no longer be submitted they'd stop being submitted once those bets have confirmed deeply enough to be safe and this depends on websites that bets you want to be able to support then the interviewee generator submits their secret they reveal their secret you combine that secret with the other existing entropy and you calculate some random values and you select some winners and losers according to the pre agreed odds of the users are able to claim their rewards typical design for for that right here is the result of designing adapt in this fashion you have multiple ante transactions there are plenty of transaction fees at each step there are minimum practical bets that you can make it this context because you have to cover the cost of those transaction fees the users have no experience of instant gratification anyone who is in the gambling industry knows that that is something that you are always striving for the user experience for again we have liked this is that you bet and then maybe you win which is not quite quite the user experience that you're often going for and most importantly if this happens to take off in the in the curve boxing context you cannot have millions of users running this habit we're trying to create amazing solutions that are going to scale up support real world problems this is not quite going to work so here is either they sell IO on state channels a lot of the steps looks a longer first they into the generator hatches their secret but now we're not going to go to chain with that statement the users are already in a channel network such as raid they connect some gambling operator by the channels they make a contract for the bet offer in a sub channel that bet offer includes the hash of the secret from the Gregory the user that selects their bet they decide the amount that they're gonna bet various associated entropy a container a random number transmitted into the operator after the operator receives the promised bet it's guaranteed that it will receive those funds the gambling operator can release the secret to the user the balances are updated with either a winner of lost and these are to keep playing again or the channel is closed because what that user experience looks like that ooh I'm honest bet I lost but oh so here's our results we had zero on a transactions for this entire process of interaction we did not have to go to the table once we couldn't have gone to the chain if any of these steps haven't worked out for example if the user had smooth air better than the operator refused to respond with a secret then we would have been able to go to chicky but the operator would have known that so there's no advantage to doing that similarly with the balances the these you can take those balances I would ditch Nate but there's really no need to if you're in a state channel networking send those around do other things with them and that's probably what you want to do so zero on a transactions transaction fees not so much in the picture these are very low costs we're talking about sending and receiving and a few very short messages much cheaper overall this entire process then loading the Google home page this this cost that's in the trend in the the network if you have to pay those participants to build up the links that's still a very small cost and that could probably be absorbed cheaply by the house if you have some kind of margin on the gambling operation which means you can take very small backs this is practical to to bec micromanage you just came back to get a result right away at the normal web like experience where you just load a page and get the result barely even notice that it's happening and most importantly this level of transactional activity is something they can conceivably support millions of users with only a small level of server investment by the gambling service operator this is a comparable style of scaling to normal web applications you have to have a web server they can handle millions of requests but that's doable and not terribly expensive so I think I have enough time I think I'm at zero here so thank you very much if you're more if you're excited interested in Seychelles come find me in the Sun for this more

Automatic transcript — names and jargon may be misspelled.