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

Loading player…

Running EVM Solidity on SKALE by Chadwick Strange of SKALE

ETHGlobalFri, Oct 9, 2020, 12:00 AM

Chadwick Strange, VP of Product Management at SKALE Labs, gives a talk at ETHBoston about scaling EVM. ETHBoston was an ethereum focused hackathon that took place Sep. 6-8, 2019 at Northwest Building, Harvard Campus. ETHBoston was a hackathon organized by ETHGlobal and a team of hackers, developers and enthusiasts interested in building and creating in the ethereum ecosystem. The ethereum focused hackathon took place for 3 days at Northwest Building, Harvard Campus in Cambridge, MA. For more information visit eth.boston and ethglobal.co

Transcript

all right I'll get started so you might have heard the presentations yesterday again with scale we're trying to really want to unlock the potential for a theory one unlock the design constraints out there you have chain your body a lot of extra skill I really believe and so we've attempted at scale to build an infrastructure as hard to do complex but for the doctor Delbert is very simple we wanted to take you know similar to a nebulous model and you are pulling an application you need computer sets you need performance scalability AWS can provide you with those features you can select different servers and teaching micro and three large you can add in relational databases and as you scalar platform need extra features so why can't we have this in terms of adaptive L duck development that we're doing with a 3d solidity scale is here to provide that we're here to sort of replace us as certain distance education so today I'm gonna walk through a little bit about the scale of the structure because I think a lot of questions one of the conditions yesterday it's like okay well how do you achieve this I want to give you a little taste of how we're able to achieve this sort of AWS like micro marketplace for you symbolize applications and then I'll walk into a use case for file storage specifically and I'll go into a new product release of releasing this weekend is cut off the precedence called scale of nom and this is a way to combine training machine learning models with smart contracts which we think is going to provide a whole new interesting business model for applications for deaf developers out there so by way of introduction my name is Chadwick stranger on the product at scale scale is a platform where we provide scale change for deaf developers and employed they're splitting the axon to and it's also made the other side of popcorn we have validators improvement state network for providing computing power to the notice both sides intercepts and all the configuration layers for these skill elastic block chains as well as provide all the software for all the validators providing computing power to the network and the integration between which is actually very interesting it's a scale managers system which is a set of smart contracts that orchestrates entire business logic and security model around the skilled networking and this seven smart contracts lives on the in theory main men so why should you use skill again we've always said that scale our vision our mission is provide open and decentralized technology for deaf developers believe in the world of decentralized business models so we're decentralized and there's a few dimensions of utilization first on art consensus mechanism is probably as far as I know one of the first fully these synchronous models this means that messages sent back to perform back in between different nodes there's no assumption around the timing of those messages being received a lot of other consensus protocols are partially synchronous or maybe fully synchronous and they require assumptions around message delivery guarantees so what this means is that there's a network split there if there's a sub Network split between North America or the validator sets in North America and Asia that split will not create the consensus crash it actually creates a consensus once that network is to be established so this is modeled around a synchronicity we are a leader that's a protocol so unlike some other protocols where a single validator is actually an elected to propose law to be committed to the chain that's heartily a little bit civilized at that leader the Byzantine with scale is fully leaderless all validator nodes for participating in posting a blog do so in parallel and in the synchronicity to commit those blocks to change we have a multi tendency model I'll talk a little more about this around the new architecture so every node that supplies computing power to the network doesn't just provide computing power for a single scale change they can provide computing power up to 128 individual scale changes we're also visiting fault tolerant so given that a number of nodes that supply computing power occurs kill Cheney less than a third of them go Byzantine and here success your operation of yours it'll block chain will continuously we use Els professional signatures which is arguably a form of a sort of Byzantine cryptography that provides security assumptions around data availability we have plenty more that's open source in next couple weeks and all of our technology is under the umbrella of the new foundation the network of deception lies economics this is a non-profit foundation that is securing the sort of long-term view the scale network and the performance and business viability of the skilled network so what is the skill Network again it's a proof of state network that is supplied by many nodes or validators we're providing the computing powers to the network so this is a permissionless network where all the nodes are operating together orchestrated by the skill manager which sits on Imperium and all of the incentives the economic incentives are driven by a scale token so network valid leaders earn scale tokens in terms of inflationary and bounty rewards and they state skill tokens as part of the group of state security model and there's a unique monitoring algorithm so such that every node is watching every other node so there's an accountability every single node in this network is measuring and pinging brand instead of other nodes in the network and neither you things like vacancy uptime apartments other quality statistics such that if they know becomes on the performant or has a lot of downtime or has a lot of bandwidth issues that they partially decreased bounty rewards over time so in this way the network is holding everyone accountable for good performance in good operation so when you select a scale change you're basically interacting with these scale manager system theory in the contract and you're requesting this scale sidechain and the manager selects a subset of notes at random so this could be actually you set it up the default of 16 notes so 16 notes will supply your production ready scale sidechain those notes are selected at random and they divide all the computing power that you need for your network so this is done by random note selections that's right now and these nodes are rotated randomly there's a rotation algorithm that swaps out nodes over the network over time in this way if their property to change for maybe two years say you're operating a very expensive time in the static 40 I spot this out order as a preventative measure or any collusion that might occur over time and yet the consensus mechanism that operates on all these nodes and you can deploy your smart contracts between messaging storage scale ml these service layers are deployed on these skill chains so be slightly scale changes for the stockings you can select a service layer that you want braylee is very similar to an EWS small according to what you need for your death so how does it work so the node 100 about a thousand skill nodes can run up to 8,000 independent skill chains again it's ill chains come in different sizes I can see two micro and three large we have a small medium and large type of skill chains which provide your doubt with a certain amount of memory and storage layer so if you need sort of a lightweight half that doesn't require a lot of storage it's like a small skill chain but if you need an app that has a ton of storage and needs the upper bound of transaction per foot you can select a higher category for your needs so each node actually has an allocation layer that can be split up and divided in and so each allocation layer can provide a separate side chain so if you select a small every you know every sixty knows a very small portion of that node to your skill side shape and this is done through dr. containerization again you can create a much larger change you want to access more performance and storage power and so on and so forth so why should you use skip the thing we have in mind is we wanted to make it as easy as possible for theory developers to use scale so we're fully compatible edia we've done this by taking again a lot of inspiration and a lot of great hard work from etherium to taking Alan we made some slight modifications to our client we call it scale D and this is also fully open source why else to do scale well really effing fast okay and you'll see this I think you've demonstrated as Christine's example yesterday where you can really improve the UX performance of your app no longer do you have block confirmation times you have almost immediate sub-second finality so now you can build Dax such as like like marketing a walls for blogs and whatnot instead of having to wait you can actually transact commit money to a paywall and completely accesses access to the site within seconds so we think this is really gonna drive a whole new way of making your desk still more like apps and you can write more powerful applications no longer constraints on certain simplified or reducing the amount of gas we do have gas on our platform but it's actually done as a medium agent for the DDoS attacks but effectively gas price is zero so now you didn't include very interesting execution layers or complicated computations within your smart contracts why else well we have many bridges to in theory so the abridges that support Eve here see 20 years he's 721 and messaging state it's transferred between their huge hands and skill chance this provides a whole new sort of design pattern for gap developers to basically use the proof of work chain as a secure you later to secure all their thief GRC 20 years to 7:21 assets and then provide all the scaling of the structure on the skill chain but we've also seen the opposite a lot of the ERC 2721 apps they actually want to deploy those their applications onto skip or most of their attacks on to scale itself they have a minting function it's like a mint incredible amount of tokens and how people use these tokens but then if the user wants to actually exchange this token onto our marketplace they can transfer those tokens that mean that the first time and then exchange it on an exchange why else should he use skip well we've integrated file storage so there's a lot of there's a few other file storage services out there like ipfs but for any doubt that's looking to scale or provide a lot of extra features a lot of people need file storage so we also build file storage into scale instead of having to use ipfs if a one-stop solution and MPM library where you can use these centralized storage with your scale at any point and you can use this as a standalone application he says the lifestyle storage or you can integrate this through your app and then I've touched on this before why else do you scale security model we have branding this rotation and incentives that provide the same team fault tolerance and the ability that we've implemented as many features as possible form a conclusion over time and just a reminder we have six bounties that you Boston so build something that an awesome we want to see it awesome UX Piper quit or generative high throughput microtransactions or high computation again like many people hackathons are probably not going to play adapt that's gonna require 20,000 transactions per second than the confines of the weekends but there's many other things he can do or simulate those type transactions through clicks or use computation or use file storage or reduce the fast finality for you guys so what is it like working the skin let's try this out we switch my screen so here is here is where you can register if Boston maybe some of you argue question your scale change so let's just see what this looks like so I'm entering my name so here we go I'm giving these end points that I can use to deploy mine I'll deploy my end point so I can use HTTP HTTPS WebSockets and whatnot and I have full access documentation a scale positive to give tokens and a block Explorer so let's start off pull this together let's go over to this app and I'm working on so here's a file storage application that I'm working with right now so I'm using a party use from the Indian library and the documentation that's available understand how sweet upload files download files so on and so forth so let's see how we can do this I've all the files here as a component or all the community component I've read the documentation so I know that I need to create an environment file that's an account private key information and an endpoint to start deployment so my skill chain so here we go I have the basic react at this sort of file storage functionality I want to build a way that I can upload files on to my skill chain so get it are you requested a skill chain for the permission to me this has been selected out of a network providing this sort of decentralized asynchronous file storage player and I'm using file storage which allows me to upload files and basically separate this file and the small pieces and to this model upload these chunks directly and write that into EVM into the blocks onto the scale chain itself so let's get started here and let's choose a file let's say I want to do some images so maybe I'm image I love cat pictures and different animal pictures so let's start uploading I try to make sure the dock so on and so forth so I can upload smaller files and I'll be staying upload larger bottles not terabytes but possibly up to hundreds of megabytes so you do mp3's movies does anyone see maybe some issues that could come out of this uploading files onto a scale chain so one of the things maybe you've heard of this before is something called blockchain poisoning so blockchain poisoning is where people can upload abusive or violent information onto the blockchain because of the immutable nature of the blockchain the network participants could be liable especially under different regimes like GPR but not so how can we use a file storage player where we can actually protect the image contents that are uploaded maybe there's a way that we can filter these contents maybe there's a way that we can have a thomas contract that sits as a sort of century magister image that actually rejects it so this is something that we've developed for a while but haven't been able to release to find a window to release it in or releasing it this weekend it's called scale now that's a win by the different terrorist tensorflow models with smart contracts so again the tensorflow models usually require a very heavy h5 file which is the train model and this huge file needs to be stored onto the blockchain and we use a service layer function that we deploy on tour at endpoints which which actually functions of the predict function so we're actually port propagating over a train model and getting the result that requires a lot of gas and this is something that you can do very easily on the scale and without walking you through because we only have 10 minutes left the entire process to create something from scratch I'm just going to take you for like high-level steps of how you can do this with scale amount let me jump back to the presentation so the first thing I want to do is I want to select a tensor MIMO model and so I'm aware of a model called resonant which is a image recognition model resident 15 the first thing I do is I going to tend to put my identified model that I wish to use I load the model and I save it as an H 5 file and I can upload this you can file storage onto a skill chain and provide that for access on spiking point the next thing I need to do is I neither write a pre-processing script I need to take five I'm uploading translate that into a matrix and then be able to basically process that file in America so there's a lot of street boilerplate your processing scripts and you'll have to define one that works for your model for your input data but this is an example of a very simplified one from pulling in to the Charis across the state moving on image moves across the input point and numpy and basically making an array to process this input into a matrix and as I said before I'm uploading this large h5 file using the file storage onto a scale endpoint and I'm also writing this pre-processing script and also uploading this as well then what I need to do is any terrain create an additional I need to write started a validate study contracts and I can show you a little bit of what that is so this is one example of where it's a validate function that's basically pulling in bottles and then running this SML or scale no that's pre deployed every skill and point that requests for features and with skill now I'm running the perfect function over that Beachbody file and iam quit then I'm using this feature called double-double so those of you who are familiar with machine learning scripts or machine learning data using floating points floating points are not compatible with solidity but this function gets around it in sort of a unique creative way right and split that floating point in distance all integers then I'm ready conditional so ResNet can connect with a waiting model one of them for example is called imagenet so here's an example of the image classifications of using image net 1000 so here are the indices or different trained inputs and these are sort of all animals or creatures so maybe I don't I want to make sure that whatever files for the service layer I'm using people don't upload any images of cats I hate cats but one maker here I'm gonna like since they're all cats make sure they're not on there so I'm gonna go through here and select an index so here you go to 81 to 87 these are roughly some cats and mediax in this whatever it need so I wrote this conditional that's going to return false or true whether the internet classification falls within in this index so let me show you an example of this in action on an already deployed script so again here's another cost or end point where I Abbas this is the end point that I'm using it's deployed out already uploaded some images as you can see here I'm uploaded an mp4 file 17 megabytes and again this is being uploaded it's hitting the validator contract it's using the predict function and take that image converting it to be processing script running into the conditional determine whether you live in this backwards standard American black bear there we go Bob Alan it's uploaded now let's choose a cat [Music] so this is a very this is one very simplified application or you know solving blockchain poisoning what we think there's you know they're kind of different tensorflow models so you can get really creative all other thing that we're working on actually this aside project in Berlin was actually taking a generative adversarial model become Bunyan is the scale amount so now this is a whole new like palette that you can use those dock developers look through the Karis consider a library choose a model choose a wing factor and then write a simple validation script to two combined machine learning models with smart contracts so what can you do with this there are some other examples well these are just a few that we've thought perhaps fraud detection if you has some multi-city wallet that's combining the scale amount that is using some sort of protection layer that's looking for transactions or different wallet addresses that are coming into your contract and maybe you've traded in such a way that there's a repeated transaction or different different sequence of events you can actually reject that transaction from coming into the multi-state wallet we've shown image detection is resident you can use auto encoder files if you want to make sure that someone who's someone needs to actually upload a written signature as an image form as a way to contract it again preventing poisoning or other issues and indecent flaws compromise fashion so thanks for joining if you want to learn more we have developers at scale.com that goes through a lot about documentation and go to our github at skill network to look at our open source consensus mechanism our special signature library our skill deep plan you can join our discord that's filled out chat you can reach out to me on Twitter if you have any other questions but we're out of time right now but have you talked to anyone outside this room afterwards [Applause]

Automatic transcript — names and jargon may be misspelled.