BUIDL ASIA 2019 (Day 2) : Presentation by Christine Perry

BUIDL Asia 2019 · July 2019 · 19:34

Christine Perry, VP of solutions engineering at SKALE Labs, shows how elastic sidechains can make dApps feel like ordinary apps. She explains the cost, storage and speed limits of transacting directly on Ethereum, then describes running smart contracts and file storage on a SKALE chain replicated across its nodes, with a developer workflow demo.

Speakers

Topics

From BUIDL Asia 2019, hosted by Kryptoplanet.

Transcript

they even my penance Caleb's a vice-president idea solutions engineering in Christian Perry m'kay so making dabs feel like apps using elastic side chains to run smart contracts and store data in sheet erosion AG Kissimmee de ter que para dentro de su casa Mita day chrome combos Rodriguez Sumida alright hello everyone let's give us a try

ano sao Hazza Hazza i get it right so the reason i open with those two words is because one those were the two phrases that Erica taught me and she successfully taught me how to say those so hoping I got the pronunciation right what I was trying to say to you was hello let's go let's go in Korean now I'm here to talk to you about scaling ethereum basically we're trying to make decentralized applications fill more like applications and the best way that we found to do that is through using layer 2 solutions like Alessa classic side-chains so let's jump right into the problem and we're going to do things a little bit

differently because it's going to be half a presentation and half a demo showing you the pain points actually showing you a possible solution but the scalability problem is something that I'm sure all of us have probably seen with interacting with the blockchain we get really excited about using the blockchain and the possibilities and it seems like a game-changer but the moment you tried to send any transaction the first thing you realize is that it's slow and it's costly so that's a scalability problem that layer 2 solutions that build side channels and plasma and and side chains are trying to solve so that two-part issue transaction costs and storage costs is something that's

very prevalent today so on average it's about 10 cents USD or more to send a transaction and 10 cents USD or more to store 256 bytes of data if that's not bad enough speed is also an issue so when you're looking to run transactions or store things on the blockchain you immediately realize that you have to wait quite a long while before you actually get a response back and it's crazy to think that that's the best we can do so what are some of the solutions well some of the solutions that we've seen used today take crypto kitties for example is offloading computations to a centralized

server well we're here to kind of expand blockchain and that feels as if is kind of not staying true to the decentralisation efforts that we're trying to push forward now when it comes to storage what are the solutions there well we have IP FS or a foul coin which is another tool you'll have to use to be able to store data directly on the blockchain we can wait for eath to dot oh this I'm sure everyone is really excited about because it holds a lot of promises for speeding up and decreasing the cost of transactions on the blockchain or you can lose a layer to solutions such as scale and other layers of solutions out there that connect back

to etherium the goal of layer two that I want to make sure we drive home is that it's not looking to replace the layer 1 solutions instead is looking to complement it speed up the transactions take the computation off of the main net and place it in the area where it makes sense to run and have it run faster so what does this look like well the scale network how does it work essentially we're all familiar with aetherium where we have decentralized nodes that are operating to process transactions layer 2 solutions work in a very similar way it's going to be a decentralized network but the difference is instead of having

one blockchain where you're sharing it with other dots what we do is we group together a small subset of those nodes to create a side chain that specifically dedicated to just your application now what that means is that it runs faster but we also add in layers of security through consensus to make sure that you don't have double spend or people are trying to steal your money that you are potentially storing on the side chain as well now to take this a bit further when we have our side chain again we're not looking to get rid atheria in fact we're looking to

complement it so if we see this side-by-side what you'll see is that if you wanted to use a side chain you could use the exact same tool set that you've already used for getting up and running with etherium so that web 3 connector that you have going to the theorem you can send that to the scale network as well now for developers in the room how many developers do we have out here do you have any there we go one at least two three four okay so there's quite a few well the idea here is that developers still want to be able to link back to the main that and with a side chain we offer that capability but when you want to deploy your smart contracts again that computation that you've written into

code you can speed it up by deploying those smart contracts directly to a side chain when you deploy to a side chain what that means is that you're no longer constricted restricted by the slowness in a transaction costs of etherium in fact on the side chain for scale what we have is a zero gasp cost for end-users now let's say that you're playing a game rock-paper-scissors and you're just making a move you don't necessarily want to pay a gas fee for just selecting a move and playing the game maybe you want to play a gas feed towards again when you're looking to exit on the money you've probably won from that game now what that means though is that we're still going to need some links to the

etherium in order to exit those tokens back to that end user and with sidechain layer two solutions we enhance the usability for users by making that bridge or protocol possible where we're able to send tokens from the sidechain back to the etherium to release back to the end user so again I said I was going to do things a bit differently I don't want to bore you completely with just slides so we're going to do a bit of a demo and while they're switching over that let's bring it up over here and let me show you what this looks like so again let's say that we have a table it's connected to the rinky network as

you can see that I have it connected to and that a mask here and we're gonna play a game that is linked to a smart contract that I have to Floyd rink B so anyone in the crowd want to play with me which smooth should we pick scissors all right good move so what you're seeing is a very familiar flow that users are faced with today they have met amass downloaded which is something they had to actively go and pursue they're seeing a gas cost because they're paying for a transaction for just simply playing a game and when I confirm that we're now faced with the very similar dilemma of

now we have to wait so in my head I'm saying huzzah huzzah let's go because this should really be a lot faster than it is right now so we're gonna wait a little bit longer because it shouldn't take that much longer to process it on rinkeby but if I were a user using a normal application this is not the experience that I would expect I would expect to just see the transaction come back so this is going to take a while now there we go you won congratulations let's see how we can speed this up using a layer 2 solution now again one of the things I want to drive home is that we see

scalability as a usability problem as well at scale labs and so when it comes to usability for dot developers we also want to make sure that it's easy to get up and running for making a switch from aetherium to a side chain so if we take a look at the documentation I'm gonna go to the getting started guides we've simplified it to a three step process but the main thing you need to know here is that again you can use the same tools and the only thing that you have to switch is the endpoint that you are sending your smart contracts to so we have a few developers in the room so I'm going to show you what this looks like in code and go through that pretty quickly so we can bring it back to you the real problem the fan split speeding this up

so to show you how simple it is to transition from etherium to a side chain for faster processing time I'm going to go ahead and copy the exact same configurations that I've used to deploy to Rigby and a local test net this is an endpoint that I have just for demo purposes and I'm going to copy the exact same code that I use for deploying trink be make some small changes so now reference that scale endpoint and that's it ease of use for the dot developer as you can see there's not much hurdles that they have

to go through in order to make a switch to get faster usability now what does this look like as far as deploying I'm gonna go ahead and copy this out and let's go ahead and deploy to scale so again for those not familiar with truffle truffle is an easy-to-use tool that allows developers to deploy their smart contracts to etherium to any of the test nets and you can also use that exact same tool to again use a layer to side chain solutions such as scale now one of the things that developers will probably see in the room is that this is running a lot faster than if you were deploying to rink B if I would deploy the same three smart contracts to rink B

what that looks like is it takes at least 15 minutes for it to process and what you just seen here is it processed in less than a minute so I'm going to go ahead and restart my game and let's go ahead and make some changes here so you start to use that side chain so I'm gonna come back here to rock paper scissors in meta mask again the end user is going to have to determine they want to switch to a new network and we're gonna switch to that scale Network now let's try this again anybody else want to pick a new move rock rock okay let's pick rock now I want to make sure that you see a few different changes

here we're using scale which means for the end user for basic transactions you don't need to charge gas it just doesn't make sense so instead gas cost of free instead what you're doing as you we're taking it more like an AWS Amazon model you rent space on the side chain and your end users are not restricted by having to incur the unnecessary cost for just running your dad so if I confirm this one of the things we'll see is that like before I didn't have to fill time by trying to talk while rinkeby was bringing back an actual result instead what you saw is the step now feels like a normal application so if I were to then develop

my depth my tap using a side chain I can expect a very similar experience for my end users that they expect with using Facebook using Amazon using any other product out there today that is centralized but let's take this a bit further because I didn't want to just talk to you about scalability I wanted to talk about usability and when I think about usability it means not creating friction for your end users so me having the user download another tool to use my DAP such as meta mask that creates friction if they don't know what a blockchain is that creates friction so how can we get around this well when we're thinking about usability we want to make sure that we're using the right

tool set so if I come back to the documentation what we do is SKL as if we've really drive home that it's really beneficial to take advantage of API base wallets now I know that there are a few out there I'm just going to use one for the sake of this demo and where to go is going to use Portus now Portus has a really cool feature that's called trust my app which means that when I click on a basic transaction that doesn't have a cost the user doesn't have to verify it it simply goes through using their wallet because they determined that this app is safe now similar to what I showed you with getting up and run with just using scale it's very similar here with Portis if you want to

integrate scale with Portis again all you need to replace is that end point that you would receive from us when you replace that end point what this looks like in practice is now you can create a login button a login button that has been brought in into the application it's not part of the browser the user doesn't have to download anything instead they can simply use your application without worrying about the fact that it's on a blockchain so once I go and sign in here what you'll see is Portis created a wallet for me and they create an easy normal authentication process as simply just an email and password so it's

making the user feel as if they're dealing with a normal application out there that still decentralized so let's go through and play this game again to see what that looks like now one last time anyone else want to pick a move paper perfect okay so remember how I said for zero cost transactions it doesn't make sense to have the user confirm that well what you just saw is that by using an API based wallet the user didn't have to instead I could simply play the game using the blockchain and so usability has already gone through the roof by just making two

simple changes between your application one using a layer 2 solution and then two using an API based wallet now one of the things I talked about was that on a layer 2 solution is not just about speeding up smart contracts lowering costs but also about modularity now if you want to use another tool such as ipfs or foul coin for storing data you could but what if that was all wrapped into the same tool where in addition to deploying your smart contracts you could also upload assets files maybe even your entire application written and front-end code HTML and CSS with scale that's possible

so what that looks like here again bringing it back to the documentation we've created a process where you would be able to upload download delete your files just as if you're building with a normal NPM package or or library so we've created these really easy-to-use tools or methods and it's all open source so it's not a black box you have full control for making changes that need to meet the needs of your application but again getting up and running with scale we're trying to make it not just easy for the end user but usability to us also means making it

really easy for the top developer so let's see what this looks like in practice now again similar to the rock-paper-scissors game where I had a smart contract and I deployed it to rinkeby and scale without storage once you get a scale in point you already have access to file storage so you can start to upload your files just as if you're dealing with Amazon s3 where you can upload files and use it within your application so this is connected to file storage and I want to show you what this would look like so let's say we want it to host those images for rock-paper-scissors I will be able to link in to that file storage which is

going to use that upload feature upload all of those bytes and save them onto my scale chain now if you have a scale chain that has 16 or 32 nodes what that means is that we're replicating that across all the different nodes within the network now bear with me just a sec hopefully I still have this turned on and looks like I need to restarted and let's do this again so while that's loading let's show you what this looks like in code again so similar to the endpoint you won't have to do much to

get up and running with foul storage instead all you have to do is pass your scale chain endpoint directly to the file storage client and just start using it within your application so when we go back to our application here and we decide to upload a file what will happen is again it'll use our upload feature and upload it to our application which means that we can then interact with it directly here within our app and let's make sure it's working all right no luck today we'll blame it

on the Internet but that's what I want to talk to you about today scalability and usability with scale so if you're interested in trying out a scale chain join our discord we'll give you a scale and point that you can play around with and start to test out within your applications that you're building and if you want to learn more about any of our other features that we have join us tomorrow we're going to be doing a deeper dive into the product and then to the tech talking more about our consensus and validators process as well so please join us thank you and if you have any questions let me know [Applause]

you