# How to Develop Generalized Applications on Layer2 by Yuriko Nishijima, Shuhei Hiya (Devcon5)

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2020-10-09
- Duration: 21:51
- Topics: blockchain, smart contracts, distributed ledger, ethereum
- Watch: https://streameth.org/watch/yt-ylVkoa_hUe0
- YouTube: https://www.youtube.com/watch?v=ylVkoa_hUe0

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more.
https://archive.devcon.org/archive/watch/5/how-to-develop-generalized-applications-on-layer2

Cryptoeconomics Lab has been researching generalized Dapps using the second layer technology especially Plasma and building a framework with developer tools for them. The final goal of our R&D is to produce more viable applications running on top of Ethereum by enabling developers to build secure, scalable, and usable Dapps with better developer experience. In this talk, we will first clarify what it’s like to build L2 applications based on the design of the Optimistic Virtual Machine, our latest research focus, which enables the generalization of various Layer2 constructions. Then, we will showcase example L2 applications, such as a payment application with instant finality using Plasma and payment channel and DEX supported by Atomic Swap technique.We hope that we can contribute to the Ethereum ecosystem by sharing our research outcome and its implementation as a library with all the other research teams and create more of the application use cases on Ethereum cooperatively.

Speaker(s): Shuhei Hiya, Yuriko Nishijima
Skill level: Advanced
Track: Developer Infrastructure
Keywords: technical

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 5 was held in Osaka, Japan on Oct 8 - 11, 2019.
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

[Applause] my name is Yuri go I work at a company called crypto but a meet-up allocation framework five containers so today I'll be giving the latest research update of their technology and the engine is another favorite called as much chamber and the Gulf a stock and I won everyone in this room to know what exactly it's like the mother not on top of negative first before we start I wanna I just want to give a learned of our background of food yard and where we came from so big time for the Moustakas research and development team consists of three people on the top row including myself and we focus on some of the flavoring that I just mentioned and the other three on the second row are in adoption team and they are internal running EEOC projects putting our R&D efforts and out comes into the putting into practice and when the real work is pieces and how exactly quick talk economics thought started and what he focus on the obstruction of layer two so ever since the company was founded plasma has been on a research focus but we had this major breakthrough when this blog post was released it was written by covering major former plasma researcher at plasma group and he was this article last summer so back then we were researching all different kinds of platinum flavors but it took us like a whole months to convince ourselves why exactly me and plasma was really feasible and after reading this post we thought as the game should be really really application-specific then we concluded that there should be a programming language they can handle application specific exit games instead so so unlikely shoelace focus our research scientists she hates speciality was designing programming language to define a set of problems that can handle we decided with our research focus on the generalization of thousand applications on top of plasma and then we decided we chose partner - construction which prioritizes fury over expressiveness of the application and immediately immediately started working on the implementation interested and thanks to this huge effort on implementation went forward proceeded pretty fast and we titled the framework magma chamber and introduced it at common this made a same time we have been writing GOC projects but all our clients for example we developed a trading system home generated and a Christine worship electric power and also we we cooperate with an antique phone company to research cloud main use cases on their platform [Music] I just wanna stress together we are very very grateful to another clients because without them we wouldn't have been able to run a sustainable R&D and create your digital plan last month but however sometimes it was tough to run POC projects and do the research at the same time because POC projects expecting birth and the base design of the framework it's updated so here after addcom we stopped took time and started linking over the core values that we want to create in our framework once again so here's the exact conclusion that they've got first if you build applications very easily so boxing developers will be able to application developers will be able to build their apps both LT specific features such as instant payments and gaseous transactions very easily model as well so they can cut the repetitive the moments for those features either if they use a framework and every function application developers will be able to fold them in the same manner from foreigners to a skilled software engineers the second thing is you can build applications securely so the expression of all the fraud Reformation is standardized with a universal notation so before discussing all the different types of exit games by a natural and improving the security of the design was very challenging and time-consuming time-consuming but now with an application framework it's going to be much easier to check and strengthen the security of the design from two aspects the first one is you will simply write less code so there's going to be a few of potential bugs and the second thing is acclaims design for an application will be interpreted in smart contracts and client by the same interface so so in the same manner so there's going to be you can reduce bugs and the third thing is you can build application flexibly so block sheet average application developers will be able to vote apps with decomposable building blocks dick him we used in composite because of our building blocks or different types of applications for example essentially plasma and state channels can be built with exact common components and then this income from position and reconstruction is a huge goal in the abstraction of layer 2 but the impossible combination of all these little building blocks will be automatically deducted by a compiler and you me you me you will be able to know that it doesn't work as an application beforehand so teeny these three values we decided to discuss there should definitely be a universal language for help there too so there's a saying that math did not alone pretty fast until some early year because there was no universal notation to describe all the basic math equations that we're now very familiar well and if you're familiar with all the discussions and proposal made today in research before you probably know that every time making a post you always had to write so many definitions at first and point we started wondering maybe it's better to create some Universal way to melted all different kinds of predicates for last month and we thought it would bring more efficiency and in the communication between researchers and be able to provide them with more logical way to prove this beauty so if you want to know more detail but we describe that in our class memory predicates research repo on our github and when we first saw thought of the plasma predicate in song then plasma group proposed obn and as soon as it was proposed we decided to go over it because that was exactly what we wanted and what does it really mean to generalize all the Frog group secondly of solutions putting it's a simple word I think frog proof can be compared to traditional system all of them can become judicial system there is a constitution a strongest though sitting on a pagan and in the case of a chain it is immutable but the point here as brother is plasma state general we're optimistic rola all the claims submitted from the second layer to the strong strongest well the Constitution will be following the same format and it is on claiming property so how did it exempt the state claimed this information is correct to the Constitution the example that I used on the strongest lobe is called adjudication contracts on Ethernet and then how do you exactly claim that some information is correct to New Jersey here you use first order logic first order logic is preposition that contains sentences with 25 variables for example if you an estate that taro is a and you can claim the sentence in this format there exists X such that X s Kotaro and X is ax men where there exist works as a quantifier and X is work center variable and OPM employed this standardized notation they expressed all different kind of properties to the adjudication contract and so let's see some examples of the quantifiers so in the eunice state something this injured neat feature only comment then you have to use universal quantifier for example you have if you want to claim that every cat s cute and you want to make this point to be true and you have to submit this claim to an adjudicator contract and you can decide this plain true if there is no picture of I'm going you can't submit it to to adjudication contracts as a challenge and then if you want the another example as a quantifier as a decision on fire so if you want to claim that there is a fine cup of - then you just simply want to submit a single picture as an evidence that has a cat with wings and fly so using these basic property on standardized notation you can even make plasma which is very complicated their solutions and before before deep diving into all the properties that are needing for plasma and we first explain how plasma cash works in general so there are two users who want to make payments to each other so they have to lock their funds on - Padma chain make transactions and after Don interacting with each other and the plasma chain they have to make a plaintiff exit to the main chain and after passing a dispute period without getting any challenge they can finally we will draw their funds and that's how a plasma cash cars in general and to enable this whole process you mean three different kinds of properties checkpoint property exit property and ownership property so I will oliver each property checkpoint property is to claim the validity of the coin history so it says all of the stage updates within a certain going range before it and in that every single block before the current block are all deprecated so to noted this statement you use universal quantifier two times and to specify the certain coinage and exit property is to claim the coin has never being used what does not predicate in a notation and then the third one this is a key point of this presentation it plays a huge role in the generalization of the altitude application design so here it says ownership property is simply to claim that is to validate the ownership of the coin and it requires the signature of the but if you want to make this application design as requiring the multi signature then you have to simply add another address to the signed out conduction so enabling switch and enabling to switch this third property here makes here makes it in plays a huge role in the obstruction of the legacy application design so to analyze notation he stopped and think covenant over the favorite design again and implemented plasma cash based on the IBM again after have gone so it's now it's of course secure proud that the authority but now even more simple and in flex flexible but the OPM so the application developers will be able to focus on designing application logic and front-end development so they can repent an implementation implementation for those are two oriented features and also the combinations of different constructions on the layer two you are possible so you can for example make channels or asthma attacks of Cosmo and here this is gonna be the highlight of this presentation and we took a video of our demo kind of to showcase what kind of application think it actually felt with cosmic chamber here so disconnects flavors what's going on here he's trying to make a payment from rights on the wallet on the right side to the wallet another on the left side and he sending instead day I think it was five died yeah fine die to wallet on the left side so now he is face thing I dress up the wallet on the left side here and the bottle sets and so the transaction is completed here now he's checking the payment under the wallet on the left side as well here now the volume on the left side has five times this is the payment after we've created with and the next showcase app is next up and some exit changing 1/8 to $10 so he's choosing 1/8 and 10 died to exchange making those wallets he says new offer on the button so the offer on that exchange is a minute then he wallet on the right side has to confirm the meet author of that exchange so he clicks and confirms that exchange offer now it's completed so if you check the history of the exchange it says oh if you check the balance of each wallet now the lot of them the right side has [Music] one money and then enough both of the left side has Tendai so these were one application and showcase our study created with our framework this is a favorite the moment that we have been doing to create these apps so it basically has two components obn contracts on the second layer one and client implementation the option contract has inverse education mantra that I just explained the strongest of and then the little building box to pay for the standardized notation and client-side has basically two three big components of the important decider and plasma hanging anime and science now I'm going to talk about some of the challenges that we have been facing during our favorite moment so it was kind of difficult to balance between the runtime design and its implementation at the same time because all the applications out on top of their runtimes is usually depending upon the runtime design so we have to think about runtime design abstraction of the application or kind of obligation that you can build it can be felt at the same time so and the interesting part about runtime design was designing criminal bulging box for the properties for example it showed up on the example as more than I just explained that I explained before but the fine by Sundberg etiquette primitive profit predicates as its it's a predicate to check that the data is signed by this certain address and another example of the preeminent premature predicate s and predicate and it's a predicate to combine two different predicates and the next challenge is a property serialization so property has to be interpreted about these smart contracts and clients so one woman okay so it has to be method design like a better better efficient way to earn the smart contract giving to to interpret all the properties and because all the properties some of the relatives can have dynamic variable they decide if you have to think about data structure of the provinces better and the most difficult thing was multi-platform implementation for Android and multi-threaded programming using j9 for Android was very very good and so considering needs challenges we have to be decided our next major milestone to create quality for developers and developer for all by the end of this year so I'm just going to explain a little test of your coming next term so we are actually putting all this little tasks on it only fondant issues so please find us and if you wanna go pitch velocity creates joke these ups all right we all work these cases please come to talk to us come up to us and let's open it together thank you for listening [Applause]
