# 1protocol – Virtual Ethereum Workers

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2018-10-07
- Duration: 18:13
- Watch: https://streameth.org/watch/yt-9F-zMjPWnPY
- YouTube: https://www.youtube.com/watch?v=9F-zMjPWnPY

## 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/3/1protocol-virtual-ethereum-workers

1protocol is a platform that enables users with idle tokens and machines with idle computing power to collaboratively perform work for staking protocols on Ethereum such as Casper. Using 1protocol, users can trustlessly earn interest on their token holdings and machines can perform work for staking protocols without putting up stake.

Speaker(s): Axel Ericsson, Zack Lawrence
Skill level: Intermediate
Track: Developer Infrastructure


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 3 was held in Cancún, Mexico on Nov 1 - 4, 2017
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

so hi everyone my name is axel Erickson and today my co-founder is AK Lauren tonight are gonna be talking about what we're building over at one protocol so who we are we were both studying at Stanford University Computer Science and Mathematics respectively and chose to do a theory on protocol development full time in the beginning of this year and that is not a decision that I regret so for those of you who haven't heard about one protocol or haven't heard about the concepts of virtual workers the short version of this speech is essentially that instead of signing machines up directly as validators in Casper or as solvers in Troubadour more generally as workers in staking protocols we can actually sign up smart contracts as these workers in these staking protocols and in doing so we can actually solve some fundamental problems inherent in all staking protocols and we can also introduce some new exciting properties so to get to that we're gonna start by introducing a useful model that we can use to think about protocols like aetherium true--but and foul coin and then we're gonna explore different ways that we can ensure correctness in these protocols and what we're gonna find is that using staking in the general sense is a very cheap way of ensuring correctness however there is a fundamental problem with slapping staking onto onto a market protocol so we're going to introduce that and then zach is going to introduce our solution which are of course virtual workers we're gonna give you a sneak peek for what virtual workers may look like on protocols like Casper true bit and even Radin and then we're gonna finish off by introducing you to the idea of the one protocol which is of course what we're working towards so to begin we think they had a nice and easy way to think about protocols like like if your iam and and true bit it's simply that they are marketplaces for some digital service and in marketplaces of course you have a set of sellers and you have a set of buyers and with the buyers do is that they form Jah along with payments and they send them to the sellers and what the sellers are expected to do is to return some service and perhaps the protocol that fits this model best is true--but where of course you have a set of task givers which are either you know it curiam accounts or smart contracts themselves that want to do some option computation what they do is that they create what would what are called tasks in in the true--but system along with payments and they send those two to the solvers on the other side but of course execute the programs so we can imagine that the service being mediated across true--but the market protocol is quite literally off tuning computation like we would expect but this this model extends to etherium itself so in etherium we can imagine that the buyers of the service for all the people that hold private keys and sewing transactions tasks that they send to the sellers are literally the signed aetherium transactions that they broadcast across the network and then the miners are of course the machines that plug in on the selling side to provide the service but what is the service in in market in the market protocol or theorem well it's quite literally having your transaction included in the etherium state okay simple enough there is however a fundamental difference between you know these market protocols and how we imagine a normal market to work and this is of course that they're both open and anonymous and what we mean by this is that anyone should be able to plug in as the seller in one of these protocols and when they do we don't know who they are simultaneously the users expect the protocol to reliably deliver the service and the users really don't want to have to care about who they actually got much get matched up with on the other side and if we think about it this is of course the expected behavior in aetherium one anyone can join as a miner and two when you as a user sign your theorem transactions and send them away you never actually want to have to you never want to have to worry about which miner actually picks it up so the question is how can we achieve this well in the general case the short answer is that we use financial incentives so we can imagine that for any worker that plugs in as a as a seller to provide some service there's essentially two categories of strategies that they can employ and the first category is the first strategy is the correct strategy which is when the seller simply delivers what the user expects them to he performs according to the protocol this would be analogous to running the standard implementation of some mining software and then the second strategy isn't is the incorrect strategy which is any other one so this could be either that the the miner accidentally faults meaning that the software breaks down mid execution or that he deliberately does something that he shouldn't do think selfish mining attacks and there of course expected returns to both these strategies and using this notation we can ask well what's the cost of incorrectness to the miner that chooses to cheat well the cost of incorrectness is of course going to be the opportunity cost of the of correctness which is the payment that he doesn't get because he doesn't perform correctly and from the cost of incorrectness we're gonna subtract what he actually does make when when he chooses an incorrect strategy so in order to ensure correctness all that we're really trying to do is just trying to maximize this difference so how can we do that well there's really only two options so we can start with trying to maximize the opportunity cost of correctness the problem with this is that we're effectively saying that the price in the correct case should be higher right which means everybody pays this is analogous to block rewards and consensus protocols and it might seem fine because it achieves what we're trying to do but in a system like aetherium for example these costs can go crazy after after a while so with three new ethers being issued in every new block and one new block every 13 seconds all that during users are actually cumulatively planned paying about 5.5 million dollars today to increase the opportunity cost of correctness on a theorem so a fun calculation to do is to simply take the number of ether that you have and divide it by 18 and then you'll find out how much you're paying every day to increase this opportunity cost in dollars but there is of course a second thing that we can do and we can try to minimize the payout of being incorrect and if we're able to implement this correctly what we achieve is that we increase costs only for the actors that choose that strategy and this is of course what's taking tries to achieve we make it a part of the requirement to be a selling machine to put up massive security deposit when you join that you'll always lose loose if you cheat according to the rules of the protocol so when implemented correctly we can actually make this expected return something correctness negative which of course is going to maximize the cost of an correctness and the idea there is that for any incorrect strategy that a malicious miner can confined either accidentally or deliberately he's always going to lose money if he chooses that path so so what we found essentially is that staking in the general sense is a very cheap way of of ensuring correctness and this is of course why so many protocols have have you stake in different ways to ensure correctness and we have you know often computation protocols decentralized file storage marketplaces consensus protocols etc there is however a fundamental problem that's not talked about that much that is inherent to all staking protocols and if you think about it what we've done is that we've essentially taken a worker and we've changed what it needs to do so instead of just performing a task and delivering some some useful service we've also said that this worker needs to put up a massive or a stake so what we've effectively done is that we've limited the supply of viable workers which in the short term means higher prices for the same security or lower security for the same price and this in the long term creates a big big macro inefficiency in any protocol that chooses the strategy and I think this is all very you know up there and theoretical but I think the pragmatic way to think about it is simply that which of the people that we would ideally want to run Kaspar validators also have $100,000,000 in ether to stick and the answer is not that many so this is the problem and to present the solution is Zach thank you so the solution is actually to divide the labor using smart contracts so more specifically you can imagine using smart contracts which we term virtual workers to allow two parties one a capitalist who's providing some tokens another party the operator who's providing the computational resources to work collaboratively for these different staking protocols that axel was talking about and then use the virtual worker contract to share in the returns so let's take a quick look at the actual logic that we imagine to be contained in these smart contracts so the first role of the smart contract would be in restricting how this operator can use the borrowed capital so you can imagine in a virtual worker for Casper the logic would ensure that the operator can only use the capital to sign up as a validator in Casper and validate blocks now second also important point in logic is to ensure that the operator doesn't destroy any of the capital that is actually borrowing so you can imagine in the case of Casper you wouldn't want no the operator to destroy the capital and that to protect against that you would use a virtual worker logic to incentivize machines to be moderating this upper operator and reporting before he destroys any of the capital and then finally you would just use the virtual worker to handle division of the rewards so you can imagine the virtual worker would allow the operator in capitals to negotiate some sort of rate which they would use to split the rewards so now we'd like to present a few of the virtual workers that we've been designing I have one protocol so starting with Casper so as most of you probably already know aetherium is planning transition from its current proof of work base consensus mechanism to a proof of stake basic consensus mechanism and one of the upcoming hard forks and essentially all that means is that miners are going to have to supply a stake in order to perform work for the consensus in other words its theorem is becoming a stake in protocol so we have two ideas for how to create a virtual worker for Casper in the first one operator produces blocks and also supplies a small stake which is lost if he loses any of the capitalists money and then you have the capitalist as before just supplies tokens in this case ether so the other model we have which actually applies to many different staking protocols not only Casper is the producer signer model so in this case we actually further divide the role of operator into producer which produces the blocks and proposes blocks to be signed and signer which actually decides which of these proposed blocks to sign and then broadcast to the network so this makes a lot of sense in protocols where the the computation being performed is very expensive and it would make sense in Casper if the cost of running a full miner becomes prohibitively expensive so a lot of players can't participate so the the second virtual worker we wanted to present is our virtual worker for true--but so for those that don't know true--but is a protocol on aetherium which allows users to hire a solver to solve a computational task notably these solvers have to supply a security deposit which is slashed if the task is performed incorrectly and also these solvers are chosen to put salt tasks based on the size of their security deposits so in the case of our virtual worker again the operator supplies a small stake which is slash if he performs incorrectly and then this operator leverages the tokens it borrows from the token holder in order to increase his chances of being selected for tasks and also to be able to take on many different jobs and now in this virtual worker there's also logic which incentivizes different workers to monitor the operator and replace him if he fails to perform a task correctly so the final virtual worker we want to presented was one for Raiden so for those who don't know Raiden is a implementation of eight channels on top of etherium essentially if Alice wants to send capital to Bob or ether to Bob they can create a payment channel and send an unlimited number of transactions amongst each other off chain and then close this channel only actually needing to interact with the etherion blockchain to open and close the channel for many use cases that's good but for some it's not it's actually too much to have to communicate with aetherium twice so you can imagine if axel is communicating with BBC and BBC's charging axel for every webpage he visits you know Axel's not gonna want to have to wait several blocks to begin visiting websites and BBC it's not going to want to have to wait several blocks in order to receive confirmation of the payment so so Raiden does have a solution to this it's in the form of mediated transfers so you can imagine if acts already has a payment channel open with a mediator who's also connected to BBC then Axl can pay the mediator to forward a payment to BBC for Axl the caveat here is that the mediator has to have enough tokens already in the channel with BBC in order to handle the requests from Axl so you can imagine some ideal mediator could be connected to all the major recipients like live Pier BBC New York Times etc and then users Axl Bob and Zack etc wouldn't even need to ever connect to these vendors directly instead they would connect to the mediator and send all of their payments directly through the mediator now the caveat with this is the mediator is gonna have to have a lot of tokens to be able to Hannah that you can imagine potentially millions of dollars worth of tokens flowing through this mediator means it has to have millions of dollars of tokens and all of these channels so we think that's a perfect opportunity for a virtual worker and so as before we use the operator token holder model or token holders put tokens into this virtual work contract and the operator handles the job of being this ideal mediator and they split the rewards yeah so this is just a preview of a couple of the protocols we're building virtual workers for and we're playing designed virtual workers for for many more upcoming staking protocols but the ultimate aim of what we're doing is is actually to create marketplace for capitalists and operators to match up be placed into virtual workers and then start working for arbitrary staking protocols so we want to create this shared platform for a couple of reasons the first one being that there's a huge benefit for virtual workers to be all in the same platform in that many of these virtual workers rely on a deep you know liquid pool of workers which can come in and replace their operator if he acts maliciously and also some of these virtual workers rely on operators which are monitoring their operators ensuring that they don't lose any of the capital and then additionally we just want to make it as seamless as possible for any capitalists or operator to find a protocol which can give them the highest returns and as soon as it stops giving the highest returns switch to some new protocol so at this point in the explanation people usually start asking me ok so how you know how higher my returns gonna be on tokens if I put them into the system and then my response to that is that you know potential returns are always a function of risk and you know there's risk associated right now with owning crypto tokens it's also risk associated with interacting with one of these virtual workers and so the returns are gonna be positively correlated with that and so it's hard to say exactly so you know moving forward you can imagine rather than having you know individual users plugging in as capitalists or an operator instead having smart contracts plugging in you know in the case of multiple capitalists plugging in via smart contract we term that a fun pool and you could further imagine these fun pools tokenizing participation in other words issuing shares which then the participants can go to exchanges on making it even easier for people to start interacting with the system and finally with what we're building with the one protocol we see that right now there's a lot of idle capital out there tons of people have you know millions if not billions of dollars in cold storage and ether and whether or not it's you know your ether and coal storage or your old smartphone in the drawer that you haven't seen in years we think that if there's an easy seamless way for people to start getting returns on that capital by plugging into the digital ecosystem that could make the whole digital economy a lot faster so thank you guys so much for your attention so we're currently hiring so feel free to reach out and if you guys have any questions you know feel free to reach out to us via our website thank you [Applause] [Music]
