Celer Network SDK
ETHGlobal·Wed, Oct 9, 2019, 12:00 AM
The team from Celer Network explains Celer SDK at a workshop at ETHNewYork. ETHNewYork was a hackathon organized by ETHGlobal and a team of hackers, developers and enthusiasts interested in building and creating in the ethereum ecosystem. ETHNewYork ethereum focused hackathon took place May 8-10, 2019 at New Lab at the Brooklyn Navy Yard. For more information visit https://ethnewyork.com/ and https://ethglobal.co/
Transcript
for one we have you know we have to body for once the first is called the safety murmur program very to build any kind of a gaming application utilizing some very simple application you know you got a chance to win $1500 and you know we also have a secure program which is like incredibly you know popular from our last experience because for that you can just use any set our SDK Tomcat you go to any kind of application and the first tool you know people registered always ask you'll be able to split the $1,000 award in total so you know that's like we we found out that's a really incredible program and then you if you could just want to spend like two or three hours try it out okay so just before we formally start you know I just want to say that this isn't gonna be you know the last probably been one of the last times are we kind of talked stood within raw level of the API officer in the future we're not going to talk about the raw level of the API but I also going to start to talk more about the application facing stuff that is that if you're just a for example book for example building a game that is focusing only on this kind of html5 game you know will have some very very simple wrapping API around that but that part is still being cooked right now and you know we are gonna have our main that launch next month and in fact we just had our private minute lunch at our boost so whatever the software is downloaded on our post is actually running on me in that today it's just like nobody knows about that yet so you guys kind of get exclusive access early access to this so without further ado I would like pass the mic to Michael and talk about current and SDK start we have we currently have like three kinds of I speak a but they all share resumes kind of interfaces Wi-Fi masticating other is to to system like a native mobile sdk of android iOS so this is like very intimidating environment so it's alright hey everyone i'm michael from Saturday Network and today I'm gonna just briefly go through our current setup of our SDKs so just a brief introduction of Sutter is like we're this state channel generalized a channel network that supports both payments and generalized like the apps which could be Hardy interactive and scalable and some examples of the past projects we've seen at other hackathons or for example like this is a prediction market so basically we so basically we use chain link to as an entree Oracle and then kinds were sent like conditional payment based on like the Oracle results from mount chain so if like some conditions is met like Alice is gonna send a payment right and this is no example where I think it's a very good use case of micropayments so you have a cloud provider that provides some kind of like SSO I guarantee you for service and if like say the provider validates the SOA terms and like the services down and you notice that and the provider is going to send you like a micro payment as a compensation so like this is another use case of like how powerful the setters conditional payment framework is and I think this code is on github and you cannot check it out and see like how it caused the setter api's and so how many of you are like web developers or like any mobile developer okay cool so we actually have like SDKs for web Android iOS and I'm gonna just go through the api's of the web SDK because that's part of the most the easiest one to demo okay so if we go to Senator adesh Network github the Iowa and that's where all like our documents are and just goes through and if you go to github.com slash Saturn Network and search for the cetera web SDK and under demo there is a very basic demo of how you like set up a set of kind and open a state channel and send a like payment of one way to the counterparty so that's like it's a micro payment right so if you were to send this on chain you're gonna cost like more gas than the actual payment but in this case you can like send one-way free and instantly and to run this you have to we provide a prebuilt settle kind like center kind binaries for both Mac and Linux and you just go to github.com Saturday network setup client and you check out the repo and you fall over to read me so this is going to start a like local seller node so it's going to connect to the cetera network service providers and basically that the routes the payments for you right if you're using mobile it's not needed right so the Mobile SDK has the shadowkhan embedded and you don't need to like so this is for like web and desktop and yes so this is on NPN p.m. and you cannot npm install this package setter - web - SDK and so basically you do like a new several kinds and this is the end point to your local center note and you do like kind open channel and it's a promise and once it resolves it gives you a channel ID and which isn't quite useful in this case but you can verify it on chain and there you can get the balance of the kind and it will print the balance in the console and you do like send east which sends an off chain like condition sorry off chain unconditional payments of one way to to the destination and wait a second and then you check the balance and the balance should be updated so a chart run this before but seems like I guess I'm like error which figure out like very soon guarantee so that's that's the very simple like basic payments and for like more complicated stuff where if you want to go something like the gomoku game we have you're going to look at more api's so basically you can create an app session that has the like virtual contracts or the information of the virtual gomoku contract and then you can send a payment based on the condition of the gomoku contract just like a jack here and talk about the or like a shuttle contract you know so how many of you actually heard about like generalization of the general contact okay all right so the concept of cameras they told us is basically you have some program and that involves certain defined party let's say there are like three different parties involved in as gains for six but it's limited number it's not even now the concept of state channel is so that each you know basically for each state transition of this application we don't actually need to broadcast a block introduction to the entire network we only need to reach consensus among these ten people as long as we can all the signatures from all the ten people on a civilized state of this application basically say the application has some internal parameters internal data structures and all that stuff but all that stuff can be is serialized into something structure right so let's say you know in very concrete case of gung-ho you can sterilize that entire structure into a byte array I saw some or some like a portable format we actually recommend robot here to do this come together for precipitation as we have this camera any cost roba our solidity so you know the cactus you know us act states and idea is that you know you basically add your signature on instant to your party and your card will receive the state look at it and figure out whether this takeout they were proposing is actually bad is this actually very state of it they the contrary stand back that state basically now this entire process is kind of a distaste progression of a state channel application and you know the the interesting part here is that now where does that actual like game or a chest or game or home game actually give you well in the co-operative case you don't actually need to instantiate any smart contract on adoption because you only need to kind of agree on okay this is the code that we're going on if we deploy the stuff right so you know basically I say we agree on the byte code of the program which Briana I mean you're off the bipod we agree on that the input or a random notes that is kind of you know so we agree on these things and we'll cash all the stuff together and generate something called virtual address so easier recently introduced something called the creator to that process that is he like movies but not right now well right now we still use the concept of this that vert this virtual attracts now you have this virtual address what it means is that once you actually want you to some you know resolution I say what her party dropped off mine in the process for playing the game with you now you got into a situation where you have to issue think we have some conditional of cheap payment days depending on the game without right so that the the dependency though is established as the commitment yeah now what you want to do is like you actually need to actually deploy the the contract on the blockchain and then rebirth but you know most of them we you know put a short time of the hacks on we probably don't like you guys probably may not have time to do this kind of entire float but I talked about this process so we know I can share that you know generally as a child you know is in the internal state and also [Music] as Kerry is actually working right so now the app the or via the virtual address that I talked about he is generated us through the come to the call often created an abstraction yeah great a there are some I've seen for years and that is kinda where we stopped all the year that are major alpha the contract code and hard about the jeans with so and you know your stuff the API you stop the binary is the constructor for yourself in a sense that's kinda right so yeah but we can test how structures created now we can kind of stand a conditional payments sanity source and like yours Tony with condition joint that is a stress appetizer station specify a string and this base condition and if you click into that condition what condition really is he is talking about like you know if actually the first first thing is that what it is that you can see myself the address is basically part of identifier of the dependency so it's basically pasta party and there are also some other things that is needed for this particular case of conditional that is you want to check whether the off chain process is actually finalized and in most cases it will actually be finalized and - perazol look at your waist like the result of the game and in the case of a simple boolean condition and if the uv/image has you know the mind you condition people and pay off but the other way so you know these stuff is but I think it handles that for you so when when the probation office a family results you just call resolve a result and all this stuff will automatically by kind of categories out for you so if you you know no worries like we will go through these guys just come to our so in the case of deploy so if you term biscuit Edison bulbs that goes into dispute right and the chat the say the komoku contra has actually deployed aren't hanging in that case like we required that the contract permanence to methods like is finalizing query results in that case the SDK handles like how like basically queries on chain to see if the condition is finalized so it basically transitions from a virtual country to an actual like the poet contract and the interfaces still remain the same so yeah and we also provide like if you want to do like interactive games like last time some people someone did like yeah just go back to the last time I use Denver someone did say for example this this one it's a rock paper scissor kind of game so it's called bulls bears and puffy corn [Music] great excellent so I'm also on mobile stack we also have to refer to that yeah there is the there's a bump pedal bumper yeah this one's my wallet doesn't happen and I want to create a game and against my friends so in iMessage we have an extension where I can instantiate a new game this is going to do is this going to create a new seller client and also like so the game concept is I need to place four bombs okay now this is all packaged up so in that package is also the seven-day my team and my my current game state my friends so that's pretty much it it's like whiskey they think they used this let me show you this San State API which we currently we have in the curve version of this SDK but in the future we're going to decouple this from the SDK so you can like send States file like any other form like we can't upload this ipfs and then the counterparty can download it and but the state the state machine can still progressed risky we provide this framework to like handle the state progression for you and like more on that later so yeah so feel free to like catch me at a question yeah that's a good question because we are like well I think the practice is for us to say deploy to set our state Chano contract on standard core and then so that's like a prerequisite but singstar evm compatible I think that should be a pretty easy test and yeah if I have some time I look looking today and see how easy it is what's that yeah yeah yeah yeah yeah definitely so like if you have just like charts like run the demo it will work for now I'm just gonna fix the service offers like for some reason it was like getting me contacts that i exceeded but I'll fix that and they're like you can try to run the demo and there's another like there is a slightly more complicated demo with send and receive so in this one you can Biscay client one sends to con to and I believe currency also sends back to kind one so you have like two people sent to each other and I mean we we technically as the blockchain is supports some kind of a turing-complete smart control object we can implement a set of contract and then yeah we're doing that for like some other broad chains as well yeah we're writers there's talk about features and about the speaker's we have yeah so you know we have that are holding our play some game and you know maybe we got off on the leaderboard and all right thank you
Automatic transcript — names and jargon may be misspelled.