DAPPCON 2018: Realitio, The Crowd-Sourced Oracle - Edmund Edgar (Reality Keys)
DappCon 2018 · July 2018 · 25:20
Edmund Edgar of Reality Keys presents Realitio at DappCon 2018, a crowd-sourced oracle that lets smart contracts settle questions using open, dispute-driven reporting instead of a single trusted data feed. The talk covers how the system resolves disagreements and situates Realitio among the oracle designs smart contracts rely on for real-world data.
Speakers
Topics
From DappCon 2018, hosted by Dappcon Berlin.
Transcript
so yeah we we started making reality keys back in I think it was about 2013 this was I think at the time the first smart contract Oracle out there and we found a couple of things that surprised us one was that we thought that a lot of the dates of people wanted we could just grab off websites and that we just needed to trap to translate web feeds into something that the blockchain can read but we found that in fact a lot of the questions that people needed they didn't really have good API store another thing we found that we expected that I mean the canonical case for this stuff was kind of prediction markets but we found that in fact there's a long
tail of really interesting data that you want to have on the blockchain for stuff like ok I've done my ico I've raised some money have I met this milestone I shouldn't be able to to actually spend that money until I start hating my milestones um so let me just back up a little bit about the Oracle problem in general before I talk about what we've built or do I need to point this next any yes yes sir okay okay we're good
so yeah the two main problems in the inn with that kind of comprise the Oracle problem the first is how do you get anyone on the blockchain to tell you the truth and this is the interesting part and the crazy hard part this is what augur has made an awesome attempt to do [Music] we have some also some interesting proposals to do that but today I want to talk mainly about what we've built that you can immediately build on as soon as release on maintenance at the end of the month and that mainly focuses on the second problem which is how to make it fast and cheap and socially scalable and what we found is if we if we can make it fast and cheap and socially scalable that makes it much easier to solve the hard problem so this is what we were trying to build we wanted to be able to
handle any question with a publicly available answer pretty much so any question that your contract wants to know the answer to it should just be able to ask our contract and we should be able to answer you we're going to make it fast ones make it cheap where there's something expensive going on like dispute resolution we wanted lies and idiots to fund that we don't want honest sensible people to fund that we want to keep the the gas cost low and we didn't want to use any funny tokens for this we want to just use the thing with the ether so that if you're if you've got a contract calling our contract to get some information you don't need to worry about you know buying really tio tokens or something so this is what we've built this is our DAP it's currently live on rinkeby
it'll be going on live on main they're scheduled for the end of this month it's based on this fairly simple economic game so what happens is that anybody can ask a question and if they want to they can set up a reward that's payable for that question they don't have to sometimes you don't need to but if you want to you can when you answer a question you post a bond and posting that bonds and selling that answer sets a clock ticking and until it times out and it takes your answer as the final answer what we then do is anybody come along and they can change the answer but when they change the answer they have to double the bond so we're going to escalate pretty quickly double the
doubling the bond will also reset the clock so it's then gonna tick down again until either nobody answers or you're probably thinking what happens if somebody comes along with some huge ether stash it just puts a load of money on some obviously wrong answer we obviously don't want that to be the final answer and we don't want that to click the bones of the people who have given the the good answers so what we do there is we have this backstop which is our arbitrator contract and I'll talk a bit in a second about natural mechanisms that we can use to power this arbitrator contract but it's designed so that you can just plug it in and switch it out and use whatever is working for you so anybody can pay this contract they have to send what we think is going to be a
fairly hefty fee certainly thousands of dollars potentially tens of thousands of dollars to request arbitration now we don't want somebody honest to really have to shoulder this cost but what they can do is if they just keep on putting up bigger bonds and some liar keeps up putting on bigger bonds you can wait until their bond is high enough that correcting the final answer will allow you to claim that one from them and you'll be able to make a profit so you pay the arbitrator that freezes the question and then the arbitrator sends their final answer now anybody can make an arbitrator contact contracts and I'll tell you a little bit about the options here unfortunately they're all terrible this is kind of the state of the auricle
problem right now is that all we have is either trusted parties or theorists it's all sort of complex game theoretical stuff that may not work that that's the truth of the situation all girls shipped and it's awesome we don't know if it works yet but so here's what we keep what we can use we can use a trusted party and obviously we don't like using trusted parties it feels kind of icky but for a lot of use cases this is actually going to be the best option secondly of the various crypto economic things that we can try there are shelling games the kind of thing that klaris is working on and I heard a rumor that Clarence are going to have at least some of their stuff shipped at the end of this month too and so it might be possible to make a little
Clarence connector that would allow Claire also to arbitration subjective up Chrissie is the thing that I'd really like to talk about today and I don't have time but I spoke about this at Def Con last year and at the end of the presentation I'll just put up a link so that you can see that our doubt talk if you're interested and finally you can use augur like a parasite if you read the augur white paper there's something rather striking which is this um parasitic markets that's that's markets or um uses of augur that don't actually trade on or gah and don't actually issue shares on or go but just use it or get as an information source those markets have the potential to threaten the long-term viability of
augur and should be liam and clear posed is is what it says in the white paper but there's no actual mechanism there to vehemently oppose the these parasitic markets and the the reason why the orchid developers are worried about these markets is that augur is set up with the security assumption that people won't have more money riding on bits on Olga than the total token value of their rep token and if that assumption is violated then in theory it becomes insecure so they work quite hard to actually price people out of their system if it looks like there are too many open bets and too much open
interest but if you start using augur just to grab random facts to power your contracts and your contracts have some some money attached to them they can't control that and it's putting this security burden on augur but it's not actually creating any value for their token holders so there's this kind of weird situation where we can do this we can build this stuff it'll potentially work really well but it's a kind of a free rider problem maybe a tragedy of the Commons it may destroy Orca and the guy who wrote the truth coin white paper that always based on thinks that this whole thing is not viable because of parasites but you know I mean one person's free rider problem is somebody else is free rider opportunity so you
may well think well you know we can use it it's right there it'll work great so let's do it so so let's just look at a few different choices we have here for arbitration we can use reality Oh with a trusted orb arbitrator obviously we hate that but it will sometimes work it's not trustless but it'll be dead cheap to ask a question not a lot of gas can resolve very quickly if that's what you need you can do it just with ether and it should be ounce at the end of this month it doesn't do anything to all get an mTOR talker or you can go straight to auger is your data source so if you're not trading on your markets you're a parasite of the auger system it's trustless which is awesome it's a little bit expensive to just to create a question because in or get created a
question means creating a market which destroys its own contract it's you know 2.5 million gas to do that bits and the other bits are also quite slow are quite expensive it takes a while to resolve it's designed for accuracy and not for um not to speed you have to put in some of their rep token as well as the ether token but it's already live in it and it's great but doing this as I say potentially destroys their system or you can do this you can use reality oh but you can use orga as your arbitrator and the great thing about this is it's just as trust this just as secure as using your code directly it's much cheaper to ask a question you can adjust it to the speed that you need you only need to feed in ether it'll need a little
connector contract to do this if anyone wants it to do this like I don't know if you should do this or not but if anyone wants to I'll help them so so you know it's very simple to get going but as I say it's bad for girl finally there's the that is the design that we're working on subjective accuracy which I'll give you a link to at the end this is a I think a really interesting nice trustless solution you'll have all the features of reality own in terms of low cost and speed but the downside is it it'll use the weirdest token that you've ever come across in your life so do please if you're interested read listen to the the video at the end of the talk so okay let me get down to actually using the thing so the simplest thing that you can do is
just go to our web UI put in your question and that'll give you the idea of that question and you could use that question ID to set up your contract so if it's a bet you would say you're going to set up a contract that says if this ID goes this resolves to this answer then you get the money and if this answer then he gets the money so it's a very simple call you say get final answer passing that question ID and we will either gives you that final answer as I write 32 or we will just throw an error if it's not yet resolved you may want to ask the question yourself from your contract or from your JavaScript code you can do that
something like this what we're doing here is we're putting in a template ID which I'll talk a little bit about in a second the text of your question the arbitrator that you've chosen the timeout period that's how long you'll have after posting an answer before the clock runs out and it finalized on that and then a couple more parameters I won't bother you with sometimes you have a question that will kind of boil down to lots of potential questions so if I want to know if my office is burnt down my office didn't burn down yesterday and it didn't burn down the day before but maybe it burned down today and if you're making say an insurance contract so on a house my office burnt down then you don't care all those times that it
didn't burn down you only care about the time that it did burn down so what you can do do there is you can just let somebody else put that question into the reality of system and then say say to your contract look here's this question idea which proves that the reality office has burned down so you should pay me my my my my money so I'll just say a little bit about how the questions are formatted this is stuff that the contract doesn't know anything about this is just what the the DAP knows about so there's a lump of JSON there it lives on the event logs of the rock chain we to avoid using too much gas asking these repeated questions
we separate it into these two parts you've got a template which is a reusable part of this question and then you've got the parameters so for a simple boolean question we just have a very simple template like this with it just has a title in the category if you want to do let's say a flight insurance application then you're asking the same question repeatedly probably so you might want to say was fly whatever flight number on date whatever date delay by in three hours and you want to ask that over and over again for different flights and different dates so you'd make your own template that like that and then you can just pass in the the parameters when you use it and so again you'll have this very low cost gas gas cost when you ask the actual questions so let me say a little bit
about things that'll potentially not work well with this system this assumes that the blockchain is available and the if you sent put in a wrong answer somebody can get to the blockchain and change that to a correct answer now what's particularly bad about this is that the person who is trying to trick the system the person who's trying to get a lie past the system controls the timing right so potentially if they know there's some very badly designed IC o---- starting at midnight what they can do is they can come in and put their answer in right before midnight and then the people trying to correct that answer have then got to fight against all this traffic to get the correct answer in so all we all we can really do there is that we've we've done whatever we can to
make the cost of correcting an answer extremely cheap in terms of gas it's only about 50,000 gas and you just have to hope that the the blockchain journey stays up and this is also true for a lot of these kind of second layer systems that are also true for think think things like plasma and all these other systems that depend on challenges getting to the blockchain that you need the blockchain to be up and working and if it's not then that availability problem that blockchain house turns into a security flaw problem and for your application another problem we have is ambiguous answers with a lot of different options so the way that you challenge an answer is by putting in the correct answer but if you got to like ten answers and there's all attempts and chance of any
of them incorrect then you don't really want to challenge an answer by putting in another answer so what moats what much better with questions that have actually resolved themselves and they don't have a lot of possible answers for any other kind of trick trick see questions and questions with information hidden him in between rounds so for example you might put in a question that everyone is going to think the answer is a and then you let them put bonds on the idea that the answer is a you put up some bonds on it on the idea that the answer is B and then you publish your devastatingly effective medium post which explains when in fact the answer is B and that would allow you of course assuming the arbitrator would
also if if asked would rule in your favor that will that will allow you to take these bonds of these person who was trying to be honest and trying to do the right thing and actually this problem is bad for us and it's even worse for Olga because Olga as their final dispute have this very disruptive process that actually literally stops you resolving the existing markets and stops you creating new markets so this is another place where you can see the the the parasites that used reality Oh would actually in a way be a lot better than for from the point of view of the end user than that the actual native markets on Olga because if Olga gets into the situation where everything stopped the reality of markets that are only using it as a backstop or actually still working and so it's a slightly weird
system with situation with them parasitism so okay so that's what we've built I've put a little bit more information up here and I've put my talk from last year at Def Con about subject of oxy which I hope if you haven't seen it you you will have a chance to read it's absolutely fascinating topic and we'll get working on that once this thing is how often stabilized okay I hope this will be useful and I hope you can build stuff if you need any help jump on this Paul channel that's link there and we can now see what you can do if you you you