Yuriko Nishijima | How to Build Generalized Applications on Layer 2 | CrossLink Taipei 2019
Taipei Ethereum Meetup·Fri, Oct 9, 2020, 12:00 AM
Event web site: https://crosslink.taipei ===== 加入 Meetup 以得知下次聚會時間地點: http://www.meetup.com/Taipei-Ethereum-Meetup/ slack 討論:https://ethertw.slack.com 。請先從網站取得邀請信: http://bit.ly/252hNY0 通關密語:decentralized 臉書社團: https://www.facebook.com/groups/443751072484739 歷次講座投影片、程式碼整理: https://github.com/EtherTW/Taipei-Ethereum-Wiki/wiki
Transcript
alright hello everyone my name is Eureka I work at a company called cryptic economics lab building an LTI application framework called plasma chamber so today I'll be giving the latest research update of layer 2 technology and introducing our framework so before we start I just want to give a click I just want to take a quick audience poll so how many of you guys have card ovm optimistic virtual machine ok and how many of you guys have heard cryptic and I'm Slav or plasma chamber okay thank you so much so today um the goal of my talk today is I want everyone in this room to know what exactly it's like to build an application using a framework on top of layer 2 and ovn so here we go so in this presentation I'm gonna first talk about why LT application abstraction matters to us and introduce some of the POC works that we have been conducting with our clients and then going over some of the basics of the plasma and ovm I'm gonna demonstrate a showcase apps that we built with our framework so that you could you can get a clear view of what kind of application you can build what plasma chamber from the video and then I'm gonna cover some of the challenges that we've faced during our framerate development and introduced quickly like next major milestone for us so before we start I just will not give a little bit of background of who you are where we came from so crypto economics lab has six people in total and its R&D team consists of three people on the top row including myself and the other three on the second row are in the Dobson team and they're in charge of running running POC projects with other clients putting our Rd efforts and outcomes into the practice with Rio use cases or Plasma so how exactly crypto economics love has started and wahby focus on the generalization of the LT application so ever since the company was founded plasma has been our research focus we have this major breakthrough when this blog post was released it was written by Calvin fetcher he is a former plasma researcher to plasma group and this he brought this article last summer and when we were researching different kinds of plasma flavors back then it took us like a whole month to convince ourselves why exactly evn plasma was not really feasible and after reading this post we thought that exit games should be really really application specific so so we concluded that we concluded that there should be a programming language that can that can define an application-specific exit games instead and because our chief scientist Xu Hayes speciality was defining programming language designing programming language to define a set of problems that can handle we decided our research focus on exploring succinct way to express different kinds of generalized applications on top of plasma without sacrificing security then we chose plasma cash which prioritizes security over expressiveness of the application and started implementing it adding our own unique features and thanks to you she has huge effort the implementation went pretty fast we title the plasma chamber and introduced that at Ithaca on dismay and in that presentation we played a demo video of payment up as our first prototype of our framework on our framework and at the same time we have been running POC projects with our clients again and for example we have been developing this peer-to-peer token trading system of home generated electricity with chubu electric power and also we have been researching with IOT platform company to explore on REO use cases plasma and I just want to stress here that we are very grateful to have them as a client because without them we wouldn't have been able to create your would use case plasma and run a sustainable Rd at the same time as a start-up so yeah sheesh thank you to them and but yeah here June however it was sometimes tough to run POC projects and R&D at the same time because when when the project gets back and forth as the basis design gets updated in the research our hope to get the framework Doublemint done as soon as possible and run the POC project entirely upon based upon our framework got stronger and stronger so here June we stopped took time and started thinking over the core values that we want to create in our framework once again so here are the exact conclusions that we've got first you can build applications very easily so developers application developers will be able to build their application while out to specific features such as instant payment and gaseous transactions very easily without hassle hassle so they can cut their repetitive development for those features and every every buck chain application developers will be able to build applications for example from beginners to skilled software engineers will be able to build them in the same and the second thing is you can build applications very securely so now expression of all fraud Provera fication is standardized but shared Universal notation so before discussing exit games specifically designed for an application was very challenging and time-consuming now with our framework it's much easier and check it it's much easier to check and strengthen the security of the application from two aspects first is you will write simply less code on your own own so you can reduce potential bugs and also the second thing is now the claims deciphering and applications are interpreted interpreted in the same way and some both in smart contracts and clients so there's gonna be a fewer potential bugs the third value that we want to create in our framework as you can build applications flexibly so so application developers will be able to build your application but this decomposable building blocks so this decomposition and and then they can reuse them for different constructions this decomposition and reconstructions plays a massive role and in the abstraction of layer 2 for example plasma and state channel can be essentially built with the same exact same building blocks but impossible combination of the other different building blocks will be automatically detected by compiler so you will be able to know that it doesn't work as an application beforehand then we discussed to create these three values we definitely need a shared universal language so there is a saying that math did not evolve pretty fast until some early year because there was no universal way to notate all different kinds of basic math equations that we are now very familiar with similarly if you're familiar with all the discussions and proposals made on earth research you probably know that you every time making a post you have to write so much definitions at first and at one point so at one point we started wondering maybe it's better to create some Universal way to notate all different kinds of plasma predicates so following the following the same format and we can so that we can create we can create more efficient communication with researchers and provide them with a logical way to improve security rather than using natural language and if you want to know more detail we described in another plasma predicate research repo so please take a look then plasma group proposed the OBM it's a shared language for layer 2 and as soon as it was released we decided to go for it because it was exactly what we want that so putting it a simple word OBM describes that all different kinds of fraud proofs on layer 2 can be compared to a judicial system so there is a strongest though there is the strongest low sitting on the III M which is called a Jew dication contract and the point here is whether it's plasma state channel or optimistic roll-up all the claims submitted from layer 2 to the adjudication contracts are following the same format an adjudication contract decides whether the claim is true or not so how can you exactly claimed some fact is correct to the adjudication contract you hear you use first-order logic it's a proposition that contains sentences with quantifiable variables so if you want to claim that taro is a man then you can follow this format saying that there exists X such that X is taro and X is a man where there exists this phrase works as a quantifier and X is a variable and OBM again shared language for layer 2 employ the standardized notation to express these properties so let's take a look at some of the examples of the quantifiers so first it's universal quantifier if you want to claim different kinds of things are having this having feature having the same feature in all in common you want to use quantifier so here this is basically saying that every cat is cute so and following the format you can claim this statement for all X such that X is a cat then X is cute and if you want to clean if you want to decide this claim to be true then you can you have to pass a dispute period without getting any challenge maybe for example like a single picture of ugly cat and if you want to claim their EGIS exists cat that can fly or attacking that has wings then you want to use exist tential quantifier so following the format first order logic format you can say this there exists X such that X is a cat and X has wings and if you want to make this if you want to decide this claim to be true then you just have to simply turn in a single picture a cat that has wings and flying so following these basic notation universal way of notation you can even make properties for plasma which is relatively complex compared to other l2 constructions so before deep diving into all these different kinds of properties for plasma I don't know I just want to explain how plasma cash works in general so there are two users we want to make payments to each other then they have to deposit their funds to plasma chain and send messages to each other on the plasma chain then when the transactions are sent aggregator has to verify the transaction and collects them make a mark on route and publish Marko hash hash root of the Marko tree it's like a summary of all the transaction to the main chain and it gets it gets stored on the main chain then those users who interacted with each other can finally will draw their funds to the main chain from plasma chain so to enable to allow this whole process you need three different kinds of properties checkpoint property exit property and ownership property so first checkpoint property is to claim the validity of the coin history so it basically says all state updates within a certain coin range between every see every single block before the current block gets is up deprecated so in order to specify a starting coinage you use universal quantifier this one on the left two times in the claim and following the first-order logic so the universal quantifier is represented with this upside down like a mark and next thing is exit property exit property is the claim that that coin has never been used so what does not predicate in the first-order logic so it's a state updates including Bach B and also it has never been deprecated yes and then in order to create this whole process the last thing that you need as a property is ownership property it is to validate the ownership of the coin so it says the transaction has been signed by this account Alice and if you want to require mod signature here then you can simply switch this ownership property to a multi SiC property and this is the key point of holders presentation so allowing this allowing to switch this ownership property to multi SiC property plays a huge role in the abstraction of the application design because it gives a possibility it gives flexibility of the applications of the layer to so in order to in order to enable this Universal way of notation we newly implemented plasma chamber after addcom based on the ovm again and now application developers will be able to focus on designing application logic and front-end development because they don't have they can cut the word redundancy and there's gonna be less repetitive implementation for client also there's another thing good another good thing for plasma chamber now the combination of different kinds of alta solutions are possible based on the OPM so for example China on plasma or text on plasma or possible so what can you actually build with plasma chamber so I brought this demo video here today so these are two applications to client application client and he's trying to send five died from the light wallet and the left one wallet yeah and then he's trying to paste address of the left wallet here and now the terminal is aggregator so when he sends a transaction that an aggregator has to verify the transaction and make a plasma plasma block and submits it to the main chain when he's sending a transaction then it gets completed so now yes terminal moved and aggregator made a new transaction then the wallet on the Left has five die sent from the wallet on the right side and this was a this was this is a payment app as our first showcase application then the next showcase application is Atomics offline atomic swap application which can be used for attacks and thus is he is trying to exchange one East to attend die so he's creating a exchange offer and now it's kind of uploaded and you can check it check that the offer is uploaded from the wallet on the right side so he checked that there's offer and he confirms it then he said okay then it's completed yeah because again aggregator verify the transaction and included in a marquetry and include a plasma block submitted to the main chain so now the exchange is completed so this was our example application that we've built on top of plasma chamber so in order to create these kind of applications obviously we had to develop framework itself and what we did was we implemented plasma client and rust including OEM runtime and aggregator client that was showed on the terminal on the left side and a user clients to clients on the right side and also we have written some of the oh the universal adjudication contract that I just explained previously in the slide and solidity and also the basic predicates that can come by all this kind of problem predicates so I'm gonna jump into some of the challenges that we've faced during our framework development so um this slide is just to share our protocol development um if somebody is interested in the product of the movement here so the most challenging part of our framework was OBM runtime design because runtime design defines the constraints of the applications and what kind of applications can be built on top of framework we had to design runtime and think about application abstraction at the same time and challenging but interesting at the same time one thing that was challenging yet interesting at the same time was defining primitive building blocks for properties for example we need atomic proposition predicates such as signed by predicate or also logical operation predicate such as and predicate signed by predicate was explained and previously in the param other properties that can make plasma but it's it's a predicated check if the transaction is signed by a certain address and and predicate is kind of a connecting tissue of predicates it can come by two different kinds of predicates and we had to define these primitive properties as smaller as possible so that we can build our virtually complex on applications I mean properties and the second thing is property serialization it was difficult especially it was difficult to enable enable smart contract be able to handle handle properties that has dynamic variables inside because decisions have to be decided both in smart contracts and client we had we had to we had to have on properties we had to have properties D no we had to have properties serializable and designing this yeah and second the third thing the third thing that was challenging was implementing like client and rust for multi platforms so it was difficult to build build like clients in rust and compile it to multiple platforms such as Android or Linux or Mac OS that was our original plan that was very difficult for example on especially Android the multi-threaded programming using general I was very tough so considering all these accomplished accomplishments and challenges that we faced these are next our expected their deliverables so we want to create all the world and developer portal on browser and also more of the sample application on browser by the end of this year so stay tuned and yes so to wrap up wrap up the stock these are some of the resources learning resources online so there's a introductory blog post posted by a plasma group this is going to be definitely helpful to start learning about ovm and layer two in journal so please go check it out and also we have ovm standard repo to discuss the specs of the obn and also we have our own medium page to let everybody know our latest research updates and the blog post also we have this rust or VM implementation in our github so please check them out okay so thank you everyone if you have any questions please tweet us chat with us on our telegram group chat or the committee and I and from research and development group team will be here at the venue so please come chat with us or if you have time and take a look at our code please open up issues or to start discussing with us thank you very much thank you your call do have any questions from the audience don't be shy raise your hand gentle metal back what do you think about optimistic roll-up and sorry can you raise your voice please what what do you think about optimistic rollup button constructions like that sorry we cannot really hear you what did I think what did I think about optimistic roll-up we have to research more yeah but it's a ok so it's a that's a great invention but we just want to focus I think we should have we should allocate all the resources of the research into like different branches and then plasma group can focus on optimistic roll-up and we want to focus on plasma so that we can separate our works to be more efficient so I'm really interested in a technique personally but as our company I think our we are gonna stick with plasma on the implementation thank you do you have any more questions from the audience okay and you can find our sharing on the our telegram group chats we have a lot of articles up there and you have any questions please feel free to austere and if you have any questions about plasma and please come and talk to cuticle and she'll be here to the end of this event okay thanks and for your sharing thank you so much and now we're
Automatic transcript — names and jargon may be misspelled.