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

Loading player…

Celer Core State Channel Architecture and Protocols with Junda Liu

ETHGlobalFri, Oct 9, 2020, 12:00 AM

Celer Core State Channel Architecture and Protocols with Junda Liu from Celer

Transcript

so let's guy started um the talk is state channel architecture and protocols this is just mmm front this is not a stage no.11 this is really more in the advanced level - you know reason about why cellar network decides on this kind of architecture and what on the more like the lower level the protocols how that does the protocol work and you know cellular network starts has with a simple mission we want to scale all block chains you know yes apparently a serum is one of the most active ones but we do support different kind of public block chains the the idea here is we try to adopt a layered architecture so when we want to say work with another block share the only thing that's different is you know the adapt you can think about adapter layer that it runs a smart contract on a different block chain and you know the technology path we have chosen is there to stay channel the benefit is pretty obvious right we stay channel compared to a side channel or the other different you know scaling solutions it has many benefits like instant finality and also the support is can be no linearly scale-out instead of you have to beef up the network or you are limited by how many block proposals you can get because in a channel there is no block we see the speed can be as fast as the internet and you know we have been in production for a few months and was actually pretty outside in terms of the within the blockchain community pretty amazing numbers yeah like for the most react the user for the transactions we have carry through with real money in the real East or Die or the other tokens on the midnight and on the other side our users coming from 89 countries I think that's kind of something really you know hit me as oh this is the power of the blockchain aside from the users we are also very actively working on to on broad the like non blockchain developers onto the blockchain world especially on the seller platform so we actually have more than 250 block developers already sign up on the our developer portal 100 games submitted the idea is we want to kind of hide or encapsulate all of this complexity be interacting with engine bits of shares you know all these complexity within our SDK and we expose very simple easy to use API to developers so our our you know tagline is basically say two lines of code and you're good you're good to go you can run your carro games already on stellar perform aside from you know the gaming vertical we also provide a more generic you know seller web SDK just you know I think many of the current blogs and developers are more familiar with you know web-based front-end development so using the web-based decade enables you know yes you have to deal with a little bit more detail like a little bit more lower-level operations but then you get the flexibility to say you are not restricted to only having a game where you can do many of them many people talk about the D file whatever the derivative prediction market all these kind of fancy or the top hot topics that people are talking about in the community you can benefit from the layer 2 solution in short it's instant finality big meaning you know you don't have to wait the moment there the message co-signed by all the participants is finalized and the other part is there's literally no transaction fee right there's nothing about that in past hackathons like in San Francisco and is Boston there are projects actually building very interesting streaming payments in basically said because the payment today is so low cost so instant you can use that in some some new way that no prior that no one thing is even possible right this is a literally I'm doing the payment every second and the very tiny amount you can even paid a single way right no one will ever do that on blockchain because the guests fear will be already so expensive at the same time we open source our code you know smart counter Everson and the full product protocol specification including the motivational under the kind of the trade-offs we have to make to the prodigal work efficiently so just two quick summarize Oh mmm seven Network already has the largest steel production network running for a few months with the real user numbers and real money playing as one of our seller acts vertical for eSports mobile games and in the past Neil one year and a half since seller network the project started we have been driven but by real use cases our business user real user feedbacks please experience a bit onboarding business is too slow to interact with sunshine all these pinpoints we have internal rapid iteration to solve basically to identify the problem and make a find a good solution for that at the same time mmm because there are different other projects very interested in the state channel space as well we are leading the cross project standardization process busy we say instead of you know everyone reinvents the wheels let's sit together we share what we have learned from the process and you know get to different ideas and see how we can make it more like a common agree the pounce back then all the projects can benefit from the last point is I mentioned earlier our developer portal already has more than 250 non blocks and developers sign up you know and then submit their games yeah that's kind of the high level overview of what no seller network the project the technology underneath and also the first vertical we pick for mobile eSports now you know what was coming next would be a little bit know as I mentioned earlier it will be a little bit advanced but then you know there's nothing like like rocket science you you need like complicated formula but then the desire and the thinking behind that I'm hoping you know beat you or even you are not really interested in like a lower level system design you might get some kind of inspiration so this kind of design philosophy could help first of all it's pretty simple we adopt what we call a layered architecture if you see if you many people know like the Internet has been so successful today in from the academia or the industry many country beautiful order like super high scalability - they're layered architecture design if you have the lower layer physical or IP layer then you have application layer each layer promise a common well upon a well agree upon interface to upper layers and they don't even worry about what you watch the new applications on the rather imagine the internet the core of the IP protocol was defined forty years ago and then at that time people might say oh it could be some other fancy application that use up to like one kilobytes per second now today if you look at the Internet today we have Netflix YouTube streaming real-time even 5g enable like remote medical operations right all this doesn't even change the IP layer so that's the power of layered architecture and I think cellar network kind of being the the founders background also coming from the computer networking research what kind of it comes as a pretty natural say hey we want to separate the concern we identify oh there's the bottom is what we call the anchor to the main network to the blockchain and then on top of that we have what we call a payment channel it will be a payment network only takes care of what token you want you want to exchange within this layer 2 network then on top of that we say if you want to write your own say financial prediction market all you just want to write your own you know goal or chess game that's our application so there's simplify the three layers right the bottom is the minute the smart contract and the middle is our payment network and on top is the applications this gives us kind of the benefit just like the Internet is it's simpler in each layer and is at the same time you can really optimize within each layers ahead I can make it even more efficient by not worrying about too many different uses imagine when they were designing IP they have to consider how like the YouTube works there they did it so that's why it's so successful because they focus on how can I make IP protocol only solve the single problem is like routing or like reach any other node on the Internet that's it and even for like reliable transportation it's the transport lairs job after that is HTTP or like Google has done all the other stuff like quake or anything so but at the same time remember just like internet the flexibility is is much much greater because we define this layer we say that's it any application as long as you comply to our interface which is actually pretty minimal you can run on top of seller yeah now let's kind of zoom means that what defines a payment channel right so what really is the minimal information you need just like for IP you need the source IP address destination IP address some hider or some sequence number some checksum right for payment Channel we also have to define kind of a data structure rather this is like the core of a seller network status a data model here again this is like after several iterations this we believe is pretty you know optimized and you know between two peers instead of try to maintain or share the single number we actually defined to one direction what we call simplex and in each simplex the owner of the sim purposely the sender of the simplex is free to update its own sequence number and say hey this is the new state this is a new payment I agree with you here you go and what's the other the receiving and need to do is simply cosign send it back this avoids you know many of the common issues caused by no the the other produce a hey you need to have to two nodes try to maintain agreement on updating a single number and oftentimes that doesn't work because your client make a disconnected especially if you think about the mobile environment say the guy walk out of the hotel and he disconnect from Wi-Fi reconnect on you know 4G or LTE network then your previous cosign negotiation will just break right so that's like optimized for really production use case anytime the client is the other peer is reconnected they can resume the communication and nowise need to really wait or even blocked by the disconnection and also what we issue here literally literally our actual data definition is written in protocol buff and there's something from Google it's also open source well supported the only actual we add you can see this so type right this is something we contribute to the community in the open source project and also recognized by the official we know Google protobuf project on their wiki page because they all by default you know protobuf support like a common language as JavaScript C C++ Java Python go blah blah blah and others but of course no know solidity right but we do need the capability in our smart contract to decode protobuf encoded binary data and we look around there were some kind of hobby project it doesn't up to the quality we expect so we kind of invest our engineering resources that let's make it one and you know they say the hint to tell the open-source solidity generator that to read this kind of data structure and automatically generate a decoder in solidity right so I think that's actually on github cellar network it's called PB 3 2 so that's the PVC region so that's the solidity code automatically generator we have done by reading this like data schema definition and the reason we have to add all these types this is the solidity native type again we could just use like bytes but it will incur incur much higher guest cost so that's the optimization to the minimum to the maximum like so really has native you in 64 but the reason we put you in here is to save little literally for guest you know in unit in case unit for the reason we have to do this because imagine this data structure will be used really frequently between all these communications even a saving of 4 is worth it you don't need to address so that the channel ID is no yeah the hierarchical data is no 1 channel ID define the two participants and one simplex only need to define their owner that's peer from yes that's a good question yeah and now we move on again as I mentioned earlier this is more like deep dive into the cellar core technology this is how we define a condition of payment the reason is you know the whole purpose of layer two is to enable frictionless low latency 0ly the same latency as internet latency but there is no block there's nothing there's no agreement or consensus needed the only consensus that we need is the cosign of the message and but then at the same time remember this later just like IP need to be flexible enough to support upper layer applications and we can now predefined that oh you can only write the games on top of cetera so we make it very generic if you say this is just defined a payment right the for payment it doesn't have because the payment could be multi-hop we define source and destination disagree in that other term source is the payer the destination is a payee right and then it can say the pay only happens when the conditions are satisfied and of course the condition has different types and for the pay we also defined how do you let's say you have a pay has the condition on tomorrow's temperature and how the you know the moon is aligned with the earth and now you say those two numbers combined together is how much I pay right so that's that's the complexity we can support and the flexibility so we see we kind of say we defined the common basic abstraction but at the same time it can enable all kinds of you know wild application the developer great thing about yeah I think you know before that up until now we have been very clear about you know between two peers you know that's the that's what we call the hop-by-hop condition of payment primitive it's just like on you know there is a hop-by-hop very similar in cellar network design then we say pouring again from the internet philosophy design philosophies and to an argument we design the multi hub payment network basically instead of only support between to directly connect peers you can send your payment through like all these relay nodes to reach your actual final destination and I think this actually give you the flexibility we are using the same seller network to support arbitrary you know see at the apps rights visitor you can have a chess you don't want every time the two players want to play when one of the chess game they need to set up a stage handle upfront you don't need to do that with seller as long as they both join the seller network the routing algorithm automatically finds the optimal path and make sure that the two players just like they have will feel the same as as if they have a direct connected channel but at a reality they actually multi-hop underneath right so basically today when you say I'm connecting to a Google server you know there are it could even be like a dozen of routers between you under the first Google server that respond but you don't see that you don't even care about that that's the same idea here yeah so the reason again right to really make it easily scalable because now we are pushing more of the complexity onto both end result at the source and destination and all the nodes as a relay node in the middle just like an Internet router does very simple relay of kind of the receiver conditional payment say oh I'm not a destination where is the destination using the routing algorithm find the next hop and send it out I think that's significantly minimize and reduce the rellenos complexity and that's kind of another reason we can learn from why Internet can scale out so easily because you can easily deploy more routers and then the currents can doing and interconnected the whole network yeah so with multiple hop now if we see we have per primitive then we have a multi-hop network then we say what else we can do right we have deal with the boolean condition that's a little more like I mentioned earlier like say B and C other rellenos they just need to do the convey request and response between the next hop and the final resolve of the pay happens between you can see that - the line happen between the actual source and destination a and D yeah this again right all of these materials is also on our website with the you know more like detailed documentation say hey the design is in such a way because we consider all the others like for example security guarantee for example oh you do not want to assume the client can always be online watching something right so I think there's other design choices we have made to like lead us to this kind of final engineering solution yeah after we have done with the bullying it obviously the idea here is that it's cell network has been like design with very optimized for common case boolean's condition meaning you either pay or not pay which already Kara was a more than ninety percent of the cases people can think about is especially in real life you think about a payment as especially a partial payment is actually not very common if you go to a merchant they would not say hey you you pay me depends on you know how many push ups you can make right basically it's more like a fixed price is either happen or not happen so in our term it's called boolean condition and because of the flexibility of this multi hop primitive we can support numeric go back to the example earlier you know in ads like Google Facebook when they try to make money from the advertisers they actually use something called second price auction which is a common you know game theory conclusions that a even you are the highest bidder they say you are bidding for showing your ads I'll just keep it simple let's say you want to bid for the painting in the entrance right you say I want to go piece teeth um but if you later you learned the second bidder only a bit one if you will feel oh I paid too much right so the common reaction will be it will be great if my actual pay is only a little bit higher than the second bidder or even the same right that actually will encourage every bidder to beat their true price from their heart so that's the game theory trick you can do a look a bit of crud there's a tons of literature research about that and it's actually really that's the money printing mechanism for Google Facebook Ads company the advertisers are free to be the much higher price but in the end they don't pay that price to only pay who paid the second the highest bid price and that's where the numeric comes in so this is you say I'm willing to pay certain if but in the end is you know if the second highest bidder is only one you only pay one so that's a numerical case and on seller network we also support that which is kind of yes it would be more complicated than a simple boolean but we still try to make sure the interface just like on top of IP you can have TCP that provides a reliable transmission and also UDP that's a I just do whatever I can right so yeah this kind of is it right now in in production on top of the serum in that what we have has been running for a few months and we kind of have been to different hackathons and have developers try you know some developer say oh I really like the idea of a mobile eSports game I will just do the gaming console X and some say hey I'm really into this whole defy of no prediction you know market or like derivative thing they can do something using the web a stick a pipe and the power of this modular architecture we actually feel we are not limited to what we can provide today the same interface characteristic if you are into the blockchain space where you might heard about some other like idea like the night which on the surface looks completely different but it's one other chore that kind of proposal forced a general but then we'll take a closer look okay hey our underlying primitive actually can make it happen right I think another and and notice from the original nitrile proposal now I think they are still having some issue with the multi hop and remember we already solved a multihull problem I survived in on top of seller with actually using the underlying hop-by-hop primitive we can actually make natural working multi hops then the original independent and natural protocol so I think that's really show the power of modular layered architecture and design yeah I think that's the that's the last slide I have for any question we have the you know we have all these communication channel you can think about and also our document and what I actually mentioned in this whole talk is public on our website yeah thank you [Applause]

Automatic transcript — names and jargon may be misspelled.