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

Loading player…

Smart Contract as a Service: Using Messages to Share Contracts by Brooklyn Zelenka (Devcon5)

DevconFri, Oct 9, 2020, 12:00 AM

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/smart-contract-as-a-service-using-messages-to-share-contracts Currently, developers deploy multiple copies of the same contract to the Ethereum blockchain. But with a shared global system, why not deploy contracts once and make them available for everyone?Learning from the actor model of message passing and the ERC1066 Status Codes Standard, I will present a model for “smart contract as a service”. This style of contract design can lead to highly vetted and secure contracts that anyone can re-use. Their persistence and re-use means we can also write integrations so that non-smart contract developers can make use of them off chain.  Speaker(s): Brooklyn Zelenka Skill level: intermediate 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] so here's talk about spark on Texas service earlier better title would be smart contract might remember services so my name is broken silica I speak basically in everywhere on the internet I am the co-founder and CTO at fission where we're building a such a decentralized firebase with user control data or not about three jobs or a dependence of about three it's all about three tuck underneath so that people don't have to worry about learning all of a sudden super system in two seasons I used a little bit of Sapa I love it here and so it to be back I'm so happy when I saw that I was going to be here and have a chance to sit again I'm a programming language theory and person she an enthusiast and I used to do R&D full-time on a grant basis but these days we're doing primarily desktops when listening from I had less in the services land I'm the co-author of a number of yeah he is including the emails or taste attack jobs which we hope to get into this artwork that didn't happen but there's a resurgence of interest so maybe that'll happen soon and also the other ones really didn't know here's Tennessee six which of the most often will be on the stack standard US house goes for mutation in if they're in classic lamp or the studying further over as well this is 1050 the other thing to note here as well is this event you know in a lot of other standards so people the situation understand there's going to be a penalty 1,400 secure children's use this as a dependency as well so this is already finance way out into industry refuse material regulation Sarah last night I hope use Twitter and saw this tweet so it sounds like there's interesting getting with this I embedded directly in my career in solidity and doing on training translation reviews as well which we have people contact code for on github so let's talk about whether contracts so the goal of this project broadly is in three parts first write your lines of code we are going to write the more lengthy or to introduce about it's also a gentleman I'm testing expensive to do occasionally etcetera so you can have higher confidence in code that lives munching they do call into that has been audited by say Boston or consensus diligence and isn't signed off and the community understands how it works and last goal is to make theory more accessible we have your semantic codes now that can eat understood you can build up the flow of East Coast through the contract through web of contracts or probably come back out to a user and then translate them into human readable language which times winning and we may take a look at at the very end high level idea just kind like how on the web we have satisfy those that came along with every request like a floor to floor we should have these as well for Starbucks right especially automated behavior or react to things in a smarter or contextual way than just to our halls or having some custom response type for every request and the other nice thing because this is it all fits into a single bite which means very very portable is that we can do things across different chains if we have occasionally with the et CET HP's bridge and cross our communication with me too so obviously this draw a lot of inspiration from you then HTTP and the actor model what's all these things home incoming composition we want to have contractor come visit shouldn't rather than taking existing contract anything in a bunch and hoping that still roughs the way that we have students before right even if you have a fully audited library and then you go audits and deploy it you've broken a lot of the core assumptions you have to get me out of it in theory it's a shared system why are three leveraging each other's code why do we have 15 million years to 2012 B's and so most of that logically counsel into single contract and if we can build these high value of highly use contracts as they're always make money doing that so on to many services something you know a little bit like this where you can count contracts come to contracts that are all fairly lightweight and thin and do single thing yeah it was basically what I just said some apple core technical idea so today you deploy since our contracts especially some of my chain that they're pretty much silent system you'd employ one maybe two or three contracts and they talk to each other in some special way and it'll really talk to each other right so we've grown the shared system but we really fell into a small mini blockchain see some are watching and you know sometimes sure maybe they do talk to another like maybe that's what took it ease and you know you're falling into it but for the most part they're just kind of there's a lot of duplication and a lot of things being redeployed onto the channel all the time so what we can break those barriers and call tuna so in this case the two multicolored ones here are you know secure verify on chain services they can maybe talk to each other and other contracts can talk about as well use them as proxy publish them for authentication or to do some juicing you know computation deal of difference cetera so what these folks actually look like as I said before they are a single byte and if you've read about it how to get a nibble so the just say how in HTTP you have say 492 our 200 range we hadn't saying that they are flipped around and that's mainly to make it easy to decompose them programmatically so here is 0 X or Y the first 4 bits right the category the last four risk or the reason and if you have something where the caliber is 0 this is the same case is having or 100 in HTTP but it just tells you that this is a user generated or user sign error pointer with no additional context so this one just like that you know so the sheriff takes for the reason this rates going into mini table so it's actually more charging this is all odd numbers our success among even numbers are failure so the callings are categories so things like time logic or authentication or negotiation governance even of change those are captured on here and the rows are really so you can say for example we have the two row which is searching and matching and waiting and together we guess that you're awaiting a match so both we can do this you'll read that note decompose them you might have to memorize 16 by 16 so 32 and that's why we memorize the whole 256 good space there's a helper library as well on NPM is lets you write these in a more general way and process them more programmatically a little bit more information out of them so here are some emails for February reason that you can then stick together pull apart and you're just going to also say like you know this needs to be category four and one of the following reasons for example and you can also automate reverting this also reverse are built right in full supports in this case this require okay says it needs to be a Ottoman otherwise it will reverse when it responds back with a hardwood message we can also allow any messages as well with localized won't change my station which again the end so a toy flow for contract messaging so we have 3d three players in the scenario we have a user this the robot may be a proxy contractor engaged themselves to intermediary and then a token we ask for sending my request I dropped it across and sashes that was something you know this this drops he asks for a by and this amounts but every consummate you know we're not ready yes but we will pay you back when we're ready it's just all Unchained I'm not waiting for events or anything on you know keying it pulling it with the server or staying open when I'm ready proxy hold on to that and then probably guess that that hurts the user sometimes my user it gets gets interesting as it is this done yesterday saying you know it's done yet spend says you know I don't have to go and check luscious perverts preparedness this transaction ever happened and also know sometimes later we come over there is maybe were actually watch the thing and it says ready you know are you still interested and yeah I mean time I kind of much worse come in rates less before that that's a really completed and probably assess the user distancing discussing recently about adding messaging like this you know an inbox or while you were away from the chain to the chibok chain or into wallets rather and then we can then propagate that into that system school or stateless service contracts against Ivan Bishop library code either actually before if you override functions on a library you just guess women absolutely library they say you know it's been all I'll check - no I'm good and then it starts overriding methods that audit you no longer wolves he may have broken something he made a small change like changing the name of the token that's probably fine I see start taking behavior a few notes if you deploy these on chains that people high-value components we're doing things with finance and criticism installers then we've met use as a community verified and checked and then they live on chain and don't get changed so we know that this is the exact code that we expect why not interesting I'm not really play safe out safe and this gives us so much it's intractable because don't feel cheap and a call out is more expensive but for anything more involved that's effectively so here's a simple toy example so we have a token which is just the things that do normally override calls out into a stateless your 20 makes requests well you have you're in the range to do that and then we can check with say here's the number two is the distress were restricted and is saying actually this the person trying to transfer students the bands love to transactions were a few things out into reusable components that neither to even be which will look at annoyance a you know a pricey service let's say it's but you don't have to give us the in each to our contract you can just send that out to another another service provider which is a staple service contract so sometimes it's not the behavior that's deeper than smart contract with the data inside us and calling into that might be valuable not just that you don't have to you know okay let's see users running her purse hoping basis but so that's you have to do that all you worry about is amazement kose once they're good to go so in this development okay it checks upon these halloweeners of thinking a message and it's actually a real-world scenario from so we have prosper or trade each pain Canada and South Korea and they both have different regulatory requirements and you need to be able to match both of them and this requirement sometimes change so you need to be able to keep just call out to a contract rate the independent logic is is kept separately so you call upstream money comes back and says yes you know you're in the meantime they're about to expire don't worry about checking this other service now because we don't mean to check for override they're actually you know they're they're okay and then we each other the other regulator which calls me to do some some database you know we get back yes you know they're in the database probably a more specific error for this use case so doesn't have to probably get the exact same message we can change it as we go and then come back with yes some quick thoughts on making money with this so it's a thick you camps or that people aren't charging for a bunch of calls today you can in people are as presidents don't have any more often especially with I've heard fairly recently that state rent is now not happening but it's not entirely a terrible idea in collecting things off chain or getting things off chain that hard to use very much or I don't know high value so in the money like this we makes sense to some degree where you collect value to prove that you are valuable but even without us we can support the development efforts of high quality good Ottoman and pay for the auditing of these shared smart contracts so that's we have a better oil secure chain overall rate of benefits everybody and welcome to try to be the luminous because we're not anywhere saying ultra mystically please get us audited and put it on chain we're saying we'll get us audited and put it there and we will recuperate that initial investment so the Mississippi Valley all different ways you have permutations rhythm you know like a tomatoes - I'll charge which is mostly what you see today warning violence doesn't change this might be pro contract or prefer per provider even buying a subscription model may have permanent okay for certain number of calls or certain number of blocks let's say it's a girl okay for the next month I have three minutes to get through the user localized feedback parts so this is something that we were talking to if you alternate integrating but know that madam asked has a system which we heard about yesterday this might be something that we can just implement ourselves so Unchained localization improve back one here so we have a localization preferences single table one chain which actually exists and then localization for these 256 codes that's a reasonable number to get translated we have first translations and it's through the concept in English Spanish and pirate and to get more as a zombie have a couple partial translations other languages not the whole booth set yet so if they're going to successful oh you're a Japanese speaker and you want to interact with this contract through a wall that's it's a transaction it does something and returns back so soon and now we're done right this is come back in the response we don't have to pay for the rest of this because is truly a read so we go to the translations contractor there forever essentially look up the TX origin transactional urgent user and look at the role for them which says that they want Japanese they grab the text 411 return the text back up and display it and Eli Loker overflows management really earn in certain are putting strange River we can do a lookup and then reversed so similar flow maybe we send the transaction and then this contract that needs to revert so we're gonna revert with fluoro we hook up the text from out again look at the TX for Jimmy grab the text and probably get it back up and we'll show like that so I as the developer don't have to write all the transitions myself they exist people can register their own and then say you know I would use this translation for all my messaging right if you want etherium totally widely used and accessible to everybody like my check grandmother doesn't speak English we did a quick analysis of why are the reverts rating in on chain and they're predominantly English like like overwhelmingly with a bit of Chinese right so that's to really hold her much and we can absolutely get that get that done yeah probably like that and that's all for me thank you [Applause] you

Automatic transcript — names and jargon may be misspelled.