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

Loading player…

Swap, Swear and Swindle Swarm Incentivisation - Viktor Trón and Dr. Aron Fischer

DevconMon, Oct 9, 2017, 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/2/swap-swear-and-swindle-swarm-incentivisation Swap, Swear and Swindle. Swarm Incentivisation A robust peer-to-peer content storage and retrieval system requires a careful balance between the needs of the service providers and those of the consumers. The Swarm network is uniquely able to address these needs due to the new opportunities ethereum offers in the form of micro payments and smart-contract governed incentive schemes. In this talk we want to introduce the swarm incentive system. It is built around three pillars which we call Swap, Swear and Swindle. The Swap system accounts for bandwidth usage and compensates nodes for serving up content. The dynamics of this system suggest that popular content will automatically become more widely distributed and faster to access. Micropayments are handled by a custom chequebook smart contract and we are actively looking to integrate full payment channels as well. The Swear contracts deal with long term storage, allowing nodes to sell access to their storage capacity while allowing others to reliably store their content on swarm for extended periods of time. Finally, the Swindle contracts constitute a litigation engine to resolve disputes. The properties of Swindle make it a natural candidate to be a state-channel judge contract and we will present our research into off-chain state-channels for proofs-of-custody, recurring payments as well as litigation and conflict resolution. Swarm thus touches upon multiple strands of research currently happening in and around the ethereum ecosystem and unifies them in a coherent narrative that we hope to convey in this talk. Speaker(s): Viktor Trón, Aron Fischer Skill level: Advanced Track: Developer Infrastructure Keywords: demo, incentive, content, delivery, storage, rooting, node, payment, channels, swap, escrow, litigation, insured 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 2 was held in Shanghai, China on Sep 19 - 21, 2016. 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

[Music] well while we're waiting for the slides to load we're going to be talking about swarm which many of you probably know is just vaguely is just sort of the content storage part of the holy theorem Trinity of the blockchain and whisper and swarm swarm is actually going to be a lot more than that we can do directed message routing we can use it for communication and content publication content delivery and today we're going to be talking about the there we go we're going to be talking about the incentive structure built into swarm to make it a good content delivery network and content storage network yeah that's the Holy Trinity all right so content delivery I'll be talking about Victor we'll talk about content storage because they have different use cases there's different different incentive structure built into it so first of all let's say you're using swarm and you're just trying to get data out which is what anyone using adapt would do if the dab stores its data on the swarm in swarm everything has an ID I know it has an ID data has an ID which all share the same address space so if these are some swarm nodes you're one of them you'd have an address and if you try to get some piece of data you would get that data's address and that location that's where you're gonna look for the data now what does that mean everything is peer-to-peer so everything is stored when up here so what it means we look at the node that is closest to that address space and that's the node that's supposed to be storing the data so that's or we're going to have to retrieve it and the retrieval process is what gets the data to you and instead of talking to that node you're going to just be talking to the peers you're already connected to so this is how it will work this is the retriever here's the data address and this is the closest node and that orange chunk down there that's the data we're interested in the way that the routing works in swarm we have a bunch of peers we're connected to there will always be one that is closer to the data than you are you're going to send it a request it's going to forward the request to nodes that are closer and it'll continue on this way until the request hits the closest node and the data is passed back note to note until the retriever has the data so that's that's the method for delivering data so how do we account for it how do we do the incentives the swarm accounting protocol is the protocol that accounts for all the data delivered data requested and it's a peer-to-peer accounting system it has to be in this context so if your node and you're connected to appear all you can really keep track of is how much data you've given the node and how much data you've requested from the node and the difference if that becomes too lopsided that means you owe the other node some payment or the other node owes you we cannot pay for every chunk of data that's just too many transactions too much blockchain bloat we can't even pay in batches so we really really need to limit the number of transactions for this to be viable and what we're doing in swap me is a checkbook smart contract checkbook works just like your checkbook in a bank you write checks and at any time your counterparty can take that check and cash it of course if you cashed every single check that would still be a lot of transactions so the way this is designed is you can just keep collecting checks from your peer and whenever you feel like it's getting too much you want to make sure this transaction will go through you cash it in on the blockchain but you only ever need to cache the last check receive their cumulative so that is a way to really reduce the number of transactions and if this sounds like a payment channel it's sort of is soon we will have payment channels we're working with the rating guys to implement payment channels I'll just want to highlight the difference both payment channels and checkbook move transactions off chain the checkbook has a very low barrier to entry because if I have a checkbook contract deployed I can start paying every one of you and you can all use my cheques and send them to the checkbook contract in order to cash in the cheque whereas in payment channels everyone would have to have joined the Pacini payment channel network the downside is a cheque can bounce I can write millions of cheques but my checkbook doesn't have required balance so that's the trade-off but we find it's a it's a good way to get people on board to get things started but as I said payment channels are coming too so what does this get us swarm with the swap accounting system allows us to program the incentives of every node so we're assuming every node is profit maximizing rational actor and one of the effects of the way we've designed so far is that as a content delivery network the swarm will be automatically scaling so if you remember in our retrieval there's no trying to retrieve there's the data there are a bunch of nodes involved that orange chunk was being passed along as a response to the requests the nodes in the middle along the sequence they didn't really make a profit they had in the swap on one side they had to pay on the other side they got paid they're just sort of passing it along the node that had the date I got paid and the one that wanted the date I had to pay now the nodes along the way they can cache the data they can keep it or they can delete it it's up to them but they have an interest to keep popular stuff because if another node comes along and wants to access the same data and then a retrieval request hits a node that had it cached that node can now deliver it and earn the profit so popular data you're likely to cash in fact you're likely to fill up your space with anything that goes through you on the off chance that you can sell it so that way you maximize your profit but the on the flipside if you look at the network as a whole it means that popular content will automatically be widely distributed and latency and bandwidth latency will reduce bandwidth will increase certainly so that's what I mean by auto scaling and it's one of those features when if you can program everyone's incentives you can get really nice emergent behavior on the swarm overall and that might be great for popular content but if I've unpopular content that I need stored for a long time we're gonna need a different system and I'll hand over to Victor for that can you hear me and Mike ok fantastic so if you don't mind I stay seated because I'm bit and stable on my my feet at the moment so the storage inside this talk has two parts and two authors it's quite lovely so storage incentives are pretty different animal from from the bandwidth incentives it's because they are not immediately SATA level it's not it's not a good that you immediately have and you can pay for its it's something that you is basically a promise so wide swap guarantees the emergent behavior like half the operation of the swamp which means low latency retrieval of content it really only works for popular content because although the swarm has maximum utilization at all points when an unpopular content is uploaded and you have a lot more popular content coming in you'll be inclined to delete the stuff that's not requested often and this is exactly how the algorithm should work and her rational agent should behave so what do we do with it well we have to somehow make sure that those content that I really want to keep for a longer term it's not not going to get deleted by the time I need it so what we do where we pay to know it's like to store us to store my content like basically by that promise well it's it sounds like okay so if you want your baby to be taken care of like you pay the babysitter that's that's not a very big invention but the problem is that first of all you don't know who the babysitter will be and second of all you might not you might not want to completely trust the babysitter and you want to check on a check on the baby and sometimes so what what do you do how do you do that sorry I'm going the wrong way so the basic idea is that basically commit a particular amount of payment that it's that is needed for for storing that that chunk or that piece of content for a while and but you you you you release it periodically in installments in response to certain proof that that you're content exists so in the baby's case you basically call the babysitter every day for the week that they are there and you want to check like whether they are okay so this is this particular type of constructs they could proof of course to the constructs which make sure that you can you can actually have a very good level of security in telling your content is stored by by a store without actually having to retrieve the full set this this is this constructor analyze them and a suggestion of like which one to use this is written in the orange so once again these these payments for the storage are really still installments and they can be integrated in the payment channel logic how well as physically escrow release conditions what this means is that you can have an automated process which [Music] which can make sure that that the proof of custody is valid and if if that verification can be done then then the release of the of the installment can can be conditional on that which means that smart contracts are idea to increment this this kind of logic so we call the the the logic that determines whether in a particular incentive scheme like promises is kept is called the judge contract and this whole you know pattern of refusing the smart contract as a as a judge is gonna come in in in various forms in in a lot of incentive systems so so far we we can make sure that the babysitter is not getting paid if our baby goes missing are you happy well I'm a habit in two months so I think we need in this case some sort of punitive measure added to that so we're holding them the positive reward as an incentive is nice it's almost necessary but it's not sufficient and therefore we we need to introduce this by punishments so how do we do that so first of all we need a component where I expect the nodes to be registered in order to to make sure that they have something on the line they have something it's to stake so if they make a mistake then they lose their stake in this case we called security deposit and this this component of the system is called as where contract double meaning it means that you swear to to keep to the rules of the game and you stand to lose your deposit and therefore your reputation and and participation at least with that identity for a while in case you found to misbehave so how do you get the receipts so so this one we already talked about the retrieval process basically the same routing mechanism is used for for this process called singing thinking make sure that the content finds the appropriate address that it should be stored at so you have the owner who puts up like upload the chunk or a piece of data to the network then it has to has to arrive at the chunks address and basically have to be stored by the node that's closest to that address how does it get there well as IRA mentioned there's always a node that's closer to the to the any address than you this is the property of the Camellia network this particular network topology that makes sure that this is the case then you pass the talk to that fear which is directly connected to you and that peer does the same so through a series of relay nodes and through a process so forwarding the the chunk ends up and the closest node so what what what happens when where we are want to ensure the storage like well it's very simple we just enrich this process with the reverse basically a reverse process whereby on each swap transaction where the peer forwards the chunk they get a receipt back and with that receipt what can we do well the word for every peer that you can use the receipt to to sue against losing the chunk so if you if you have the receipt then you can start the litigation process this is gonna be the next component that we talked about so the litigation process is in in very short it means that it makes sure that if you if you if you date in the data is lost then then the food store it's the litigation is does is done by challenge which means that whoever who'd valid receipt for a chunk and they don't find that the child they are allowed to to launch a process of litigation which basically means sue on the blockchain it's it's sending a particular transaction to this to the swindle contract that that handles the swarm incentive system and once once you get to this stage the the only way that appear can defend themselves against against this Challenge is like basically two ways like one is to show the channel that here you premiere you go so like your baby is actually here like please please believe me it's okay they are not fast or they actually do some finger-pointing they essentially it means they're shifting the blame to the next node which so it was the previous slide so the next note that that they forwarded it to so these these local interactions in the end make sure that the litigation leads to a correct result and at the same time give the give the very interesting property of the system that the storage promised contract is immediately settled when when the load approves the content which spear why because once once he wants your pier gives you the receipt you can always at the later point litigate with that receipt and you don't need to know who the actual story was so it's like it's like going through a series of agents work for a babysitter you'll actually don't know who the aunty babysitter is and who takes care of you okay so this this pattern make sure that you have immediate settlement and the correct accountability of the store simultaneously the system and this generic pattern for with programmable incentives which we kind of playfully called sports parents window good luck for the Chinese translation with this this is this is a physical captures this whole idea that you have local interactions on the one hand you have protection against the deposit with a security deposit and the registration and you have provable verifiable wait to tell whether something whether whether you misbehaved so it's in this case like it's basically expecting your value for custody you don't have that the judge can say that you didn't fulfil your promise and therefore the punishment is there so there's a lot of details about this system obviously you might have a lot of questions immediately arising which relates maybe to the complex you know economic setting in which like the whole system applies these rules like what kind of emergent properties can occur and whether they are in line with the intended operation of this network so some of these are discussed in more telling the truth orange papers that we released in a bizarre kind of draft versions and we still would like to have some more thorough peer review although a lot of people ready that we would like to have somewhere in the just to just to quickly use my one minute maybe you want to hear a little bit about the status of this one because I'm not sure I was very prepared to to say that in the in the in the first panel so the the most important bit that I I left that was that there's the test that I'm running in which we can actually check on on the the largest below like relatively larger scale operation of this network and this is this is starting on Microsoft edge worked out it's going to have my father has not operated by us but once the public is is welcome to join then we can grow it up to like you know thousands of nodes if you guys contribute and with welcome developers to continue today and just to conclude like a few links that you can visit and I would really happy to put with all those names up on the board who contributed to this fantastic project and I'm very enthusiastic about so you will hear a little bit more about the next stage plans in my second talk which I give in an hour thank you very much [Applause] [Music]

Automatic transcript — names and jargon may be misspelled.