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

Loading player…

Architecture Session: Using Elastic Blockchain Networks as an execution layer for Ethereum

ETHGlobalFri, Oct 9, 2020, 12:00 AM

Architecture Session: Using Elastic Blockchain Networks as an execution layer for Ethereum with Jack O'Holleran from Skale

Transcript

before we get started can I just I'd love to get a sense of who's in the room and I'll try to tailor this towards the audience so how many people here work in crypto okay how many here who are engineers how many here are working outside of crypto and are interested okay who here is doing a startup okay okay anybody else working a bigger company is or doing research or okay good all right good mix that's helpful last question who here is familiar with scale okay we got a few got a few so I'm going to we're hacking we get a lot of questions at the hackathons we've been at eath Denver eath Boston East New York Paris eath Berlin and now eath Waterloo so we've been at a lot of these and and have I think actually the number was wrong yesterday we've had 57 submissions this year one of the common questions is who runs the nodes how do you how do you allocate nodes that work for the different different scales you know for that scale chain how is this decentralized how does the system work and which is relevant if you're using this in hacking at hackathons it's a little different than then what it will be like in the real world when this launches early next year so we have a target launch for early q1 next year where we're gonna see scale operate in the real world so hey that's gone all right so so we'll kick it off I might even if it gets too loud we'll close the doors so one I just want to say thank you it's really nice to be here in Canada by the way how many Canadians do we have all right really awesome place amazingly friendly people I've had a blast thus far and by the way last night one I'm a poutine fan I also like shwarma I had a swarm of poutine amazing all right only in Canada multicultural magic so that was pretty amazing I like to kick off the presentation and this architecture come on in this architecture discussion talking about why like why do we do this what why go to the lengths of decentralizing anything it's there's so much more friction than just using something from the centralised world right even though I have to say that's going down tremendously and as the value to friction gets lower and lower and the value gets higher and the friction gets lower we're gonna see decentralized applications absolutely disrupt their centralized counterparts where middlemen are taking unfair proportions of profit governance data ownership etc so in the early 2000s that's when I was getting started in my tech career this was the mantra optimize add efficiencies and Jeff Bezos is famous for saying this and I think the new saying is your margin is our opportunity and we're creating new business dynamic so that's why we're doing this and that's why we have to decentralize things okay and there's actually a reason around it and meaning so the timing is great it's time to innovate and and I'm excited about it so scale is building an elastic blockchain network we're gonna get into the tech architecture here in a second but what we're trying to enable is oftentimes decentralized networks are not very efficient and they're not very effective or configured to the needs of the developer so if you want to deploy something on Amazon and you're just testing it's very easy to deploy a small instance right it doesn't cost you a lot of money and it's much harder to do that in a decentralized world and especially if you want something that is your own back-end so scale gives each developer their own back-end and we try to do that in a way that's cost-effective for the community it's community owned it's a decentralized network and that's where we're implementing containers and we're not using kubernetes what we have is I'm going to go through this is really a decentralized kubernetes in a way and we'll talk about how the container or frustration works okay cool so a thousand nodes will be able to run 8,000 independent block chains one of the the primary use case and what we care about is really helping etherium scale and doing in a secure cost-effective efficient and high-performance manner okay so that's what we do that's what we spend all our time doing and ultimately we're trying to deliver functionality where you in your individual scale chain that you're going to use for your decentralized application can do two thousand transactions per second if you're using the full getting the large version you can run sub second block times you can execute full state smart contracts you can leverage storage and we'll get into that how you can do storage with the containerized model you can do actually run machine learning models in this as well we're trying to bring architecture to the junior disposal in a size cost functionality and privacy configurable manner okay and let you use the etherium in the etherium ecosystem for your back-end in conjunction with the public main net all right so everybody here I'm sure is pretty familiar with way block chains work the more nodes in the network the more secure the less nodes typically faster and less secure right there's just less nodes that need to carry the same state it's less bloated it costs less to run for the network and but you lose a lot when you have a smaller set of validators so the goal of elastic side chains or an elastic block chain is to be able to randomly move nodes into a set of validators in a way that doesn't compromise security so we you also have to have rotation so if we're able to effectively pull nodes into a small group that end up working for you in a way that's random and also there's an incentive where every node has you know hundreds or hundreds of thousands or millions stake into it and then that's a penalty if they go Byzantine if two-thirds are malicious they can steal the money so we need to make sure for someone to be able to attack each individual chain they've got to have two-thirds of the whole network to probabilistically be able to attack that side shape okay and so what scale uses is BLS threshold signatures and dkg in a combined manner to come up with random numbers so each node is coming up with a random number and then then with threshold signatures each node signs off on their number and then everyone signs up on the total additive number amongst a group and then we've layered BLS twice to use signatures to validate and get a random number instead of having to use a vdf you know expensive hardware we're able to do it in a lightweight fast secure manner and then use distributed key generation to then determine which nodes are working where and then rotate them okay so that's the functionality and that's what that's the goal is so you get your chain and then if those two thirds for them to go bad and they would need to someone would need to like be able to have two thirds or so that when the their nodes get on your chain if they're gonna have Byzantine attacked to have a two-thirds attack they're gonna have to attack the broader group it's pooled security okay that's the architecture so the other piece of this that is not well known is that scale is you know in a strange way and aetherium decentralize application so scale token lives on the etherium a net the scale orchestration engine lives on the etherion main net there's an administration component that lives on the etherium a net and and these things they're also the bounty and the rewards and the stake and the payment for the network all live in the etherium main net and what happens is and I'll get into the architecture in a second but for all of these nodes to work and operate they all have to speak back to the main net and when nodes when payout happens at the end of each month for bounty for validators for for the reward guess what that gets inflated through aetherium and fees get staked into aetherium by DAPs and it gets pushed back from the etherium a net out to the validators so it's designed so that the actual foundational security of the scale network is etherium even though custody is happening on each chain in the scale network so it's a it's a hybrid model and that we really like because when we think of what needs to be incredibly secure we want to make sure that if there's hundreds and hundreds of millions or billions of dollars stake for security and the scale network that's in a very very secure place and it grows the value of aetherium and it and it becomes actually perhaps one of the most complex and value-add set of smart contracts on the etherium a net that ends up running this extensible network does that make sense to everybody okay yeah big picture yeah it's tall in the details which I have to say the code is almost entirely open now on github and we've got a ton of documentation and and a pretty extensive white paper and we blog about this a lot if you want to go really deep in and by the way we like going deep yeah this is like I only have 20 more minutes so it's like almost a teaser phase we're gonna get you information and make it really easy for you to come reach out and learn more and join the discord and get involved in and contribute so okay so high level that's great but then how does this actually have come to fruition so what we have by the way is that loud for anybody else it's okay I might I'm hearing it okay so each node we leverage docker within each node so if you run a scale node this is what your operating and sorry if this is a little pixelated but every node has a node core and though basically you're giving resources that run the network this node core is what's sinking back and forth and speaking to the smart contracts on the etherium main net okay so it has a component for orchestration and it has a component for auditing and it has a component for administration and I'm gonna get into in kind of a choppy white word session how those things work okay but it also has 128 virtual sub nodes so each one of these and and who here I imagine most people are very familiar with docker containers yeah yep yep okay so each one of these is its own node in itself in a way right and if I could if I want a small node and I'm just like playing around and actually a small a small chain can do 20 transactions per second which is pretty good right if you look at that over the course of an hour or a day or a week it's a lot of transactions and but I just can pay for a very small increment and it's very cost effective and I'm getting you know maybe sixteen single virtual sub note virtualized sub nodes as a developer or I may want a medium version or I may say hey I've got a lot of storage I need two thousand transactions per second I'm gonna pay a lot more money and get more resources of the network okay so that's really that's what's happening at the architectural level and then what we're trying to do then the network then is able to allow you to deploy the right size at the right cost with privacy and different features all configurable to your needs so you could configure to for virtual machine like we'll have you awesome support eventually you can configure to privacy so each node is outfitted with SGX so you can turn private transactions on and off because pls threshold signatures are used to do the signing and the the messaging between chains and so in order to store the keys privately right now we live in a world where you need to use SGX and so there's an X Y X component on each each node that ends up allowing you to also make transactions private or not private ok so this is what we're trying to deploy for and and really create this elastic model where you can use the etherium main net and your own back-end in this designed cost-effective very efficient way that's gasless so gasless what does that mean so when you get your scale chain and I'm going to talk about this when we go through economics in a minute your scale chain is your scale chain that will essentially not charge you your users per transaction you're buying the chain or renting it aniss a small or a pass model as like platform-as-a-service for a six month or twelve month or two year increment and then you pay in scale tokens and then those tokens then each month are allocated back out to validators to pay for the service now you think okay there's no gas like does that open up DDoS like we're gonna have denial of service attacks so what you actually do is you can integrate this almost fake gas that you that gets given to the users where they're still leveraging a gas and then if there's too many of these transactions at one given time then obviously it has the same protective measure you can also do other things like applying a proof-of-work measure like a CloudFlare but the gas what we don't want to do is create more friction per and pain per use because when you penalize your users to use a system they end up using it less right so instead you buy the asset for a period of time like Yoda with Amazon and then you use it as much as you want and if you use it too much you just get throttled because you don't have enough space right so that's the payment model which works very nicely in in conjunction with the etherium main net okay and then you're only paying gas on the theorem a net once transactions have to settle back on the main June settle so it's up to your design so one thing and I'll get to this in a second but you can have web three connectable systems and you could just make it so that any time the user exits then settlement happens you may for different reasons want to try to design it so you settle every day or every ten minutes or every hour because you're effectively getting a lot more cost savings because you'd have there's a batch component and you're you know maybe it's more secure so really it's I think we're going to see a lot of different permutations of how people design settlement but one of the most common ways is just making a web 3 connector that when the user wants to leave the sidechain effectively settles burns a cloned asset moves it back ok so because of this containerized model right we saw the this space in the system you can and what we've done is we've modified EVM to be a call and store function so that if they're in virtual machine will let you use storage in the scale chain so you can run a website a game a decentralized application we we actually built this incidentally because we thought it might be cool and valuable for people that have maybe a decentralized social network like let's say you had a nudist social network and someone put a picture of a clothed person you could automatically sensor that clothed human ok right so there's different ways that groups who are self-organizing for purposes may want to manage your group we also thought hey it's valuable for fraud detection or price prediction and you know if Oracle sending information in and you know it's pushing up against a pre trade model it can actually deny that the execution of the contract or the escrow so that also is a cool thing that you get with skill storage it was lets us use scale ml which is machine learning capabilities brought within the the smart contract yeah you know what so the developer who is who's designing for this is going to like do training outside and it's gonna bring that model in and then hopefully it's open source so people can look at it and say alright we know that the model is good and here's the supporting data because you can't train within the smart contract what you're doing you're not actually doing machine learning you're doing is taking like a machine learning model and it's almost acting as like you know it's pushing up against a data point against the model and saying okay actually jack has never been to like kazakhstan and it doesn't usually spend $10,000 on this thing right like same thing my credit card company does so you could take these you know which to be honest these models are fairly commodity what's valuable is being able to integrate them within use cases at the right time to add more security or like I said for decentralized networks that as a group want to all come together say hey we you know this is a cat website we don't want pictures of dogs on the website and you know and it that's another like funny example but there's a lot of examples where as we these things grow and they become less there's not a middleman there's not a rent taker it's a group we do still want to self and collaboratively enforce and use the centralized governance to come up with sets of rules that are going to help our entities perform well and that's a that's a good use case with for image recognition yeah great question so will I'm gonna do some white boarding that's perfect question as a segue so again let's say I've got my like you know nudist colony like community like we like we want a scale chain alright and what I do is I come over and I have to buy scale tokens I just it's a very simple like you know swap a widget where I swap eath and scale and then what happens is I end up staking that in this like you know over here actually but I stay it gets staked and let's say I take one year worth and every month in the beginning the month 1/12 is going to go you know from here into this pool to be ready to be distributed that's that's one piece I get a different second piece is I need to we talked about the space I'm renting how do I make sure that the space I'm renting is like the people are good they're not bad actors or not gonna try to steal my money they're not gonna try to you know manipulate my algorithm right me yeah exactly so so what we have to do is each node is staking in also to the etherium main net and at the start it's like it's going to be roughly a hundred thousand USD equivalent and scale and over time that's gonna hopefully go up but go down it's you know it's a decentralized entity right so they're staking in and so if they are bad and they are gonna try to do bad things here then they're going to lose their money that's one two is as you pull yeah what happens is each node worked there's something that looks at availability here and then I mentioned the the orchestration component this in every single node speaks back to this and it says okay these ones are gonna work for you this month and then these ones end up running this chain right or maybe not even an entire node but a component of a node right are going to work for you and then next month this one's not going to work for you but then the system says that one will and the next month you know that ones added and this one's removed and so they're constantly constantly being shuffled and they also are not just shuffling but they're also monitoring each other so consistently throughout the day each node is randomly being assigned 24 other nodes to look at all right and so they're all looking at each other and what they're doing is they're producing a score and they create this it's it's like kind of enterprise-e in a geeky way it's like the SLA algorithm it's a service level agreement algorithm that looks across things for behavior are they doing the right things but also performance is there the right uptime is how does latency look there's a series of metrics that these all look for and what they do is they produce a score and then algorithmically we find a median and we remove outliers and these algorithms and the score for each node you also get a score and it's all coming back here and what happens is is this node if it has the right score because every node is looking at other nodes and I'm also getting scored as a node if I it's 1 or 0 its binary if I'm good if I met the requirements then I get a participate in the pool that month ok and so what we as a community do is we need to look at the code we need to keep improving the code we need to say hey this is potential new attack we didn't think how these people here in this group could be affected negatively and we keep maintaining the codes so that as we monitor each other from a node perspective we're able to you know it continued to have good behavior across each note and then every month what happens is then this both the fees the fees from the different gaps they get paid in we saw it come here and then every month the etherium network is inflating more scale through a smart contract creates more scale and it goes here and then that's paid back out across the whole network and there's also delegate errs right there's people that work with our partners at consensus and other places that get access to tokens and then they work with validators to put tokens into the network to secure the network so the goal is to have tens of thousands of actual holders that have incentive motivation for the network to perform well and hundreds or thousands of validators that work for delegate errs and have their own stake built-in who also want the network to work well okay it's random so so what happens is so so in this smart contract and in the orchestration engine BLS threshold signatures and in a and this is all open source now and distributed key generation we have a way where each node comes up with a random number and what happens is I have and I was five they all come up the random number and then then the sum and each one signs off in the number and then it's all summed together and then through cryptographic techniques we realize that the total is two hundred and seventy six and then that's used in a way to then say this node in this Center and this node are going to work for you over here using BLS that's a highly simplistic version of how it works stan and oleg and our team who have PhDs can go much deeper and that's maybe a good follow-on topic the great question the value you said the bounty pool so once a month there's a there's a delegation protocol that's built that's being finalized right now and will be open source soon the delegation protocol takes into consideration all of this math and then it it it does some computation to say who is 1 and 0 and there's also a component for length of time if you're if you're staked in 4 3 6 or 12 months you actually get a greater percentage of this too so people that say I'll commit my money to the network because I want the network to be stronger and more sustainable get a little more return ok and so what happens is the smart contract and the node course speak and then the math happens and then through the delegation it's actually paid back to each node and then it automatically goes to the wallets of individuals who are staking in the network so one of our partners consents or there's quote we have 10 validators or who are going to be supporting supporting delegate errs that make it super easy where no one has to do any math or management of the token it's in protocol seamless and and you know hey this is complicated stuff we've got a team of 20 engineers but we're excited to get more collaboration on this code and support because we like what it does for the etherium community and really like I said scale is you know in a strange way adapt it's like a kubernetes DEP almost right it's the doubt yeah it just does different things and yeah yeah you you can't now right now there's only one line for SLA and it's uh it's it's not it's not as tough as an enterprise SLA like maybe you need that like 97% up tightness out of 99.99 eventually though it's a really good question because we think that just like we saw with cloud you grow up the ladder and I think eventually enterprises are obviously starting now but I think they're going to become more open to more open to open networks and when they do they need to have configuration options and so they can pay more for different types of validators they can even have hybrid models eventually where you know maybe consensus is going to run a node and say this is consensus and IBM might run with says IBM and if you pay here you may pay more to have 50% Authority and 50% open which still keeps an open network because but it also prevents any entity from stealing from the network or an enterprise could run 50% of their own nodes and 50% open and they can't steal from their users their users can't steal from no one could steal from them so these configuration options were Christine who runs solutions engineering where we're keeping a list of these and eventually we'll get those live but v1 is just going to be really about you know DAP support of who's building on a theorem today and from a decentralized perspective yeah there's a really good question yeah I'm sorry sorry ok yeah yes thank you sorry thanks for don't want to go over we're outside and we're gonna yeah thanks

Automatic transcript — names and jargon may be misspelled.