aragon / nest

A grants program to support the development of the ecosystem
https://aragon.org/project/grants
Creative Commons Zero v1.0 Universal
140 stars 78 forks source link

Pythia: a Decentralized Market for Oracles adjudicated by the Aragon Court System #38

Closed gititGoro closed 6 years ago

gititGoro commented 6 years ago

Aragon Nest Proposal: Decentralized Market for Datafeed Oracles Adjudicated by Aragon Court System

Abstract

Ethereum Oracles traditionally are a point of centralization, undermining the trustless and censorship-resistant nature of the blockchain. The offchain and often human-driven nature of oracles also limits contract design. Ideally, a smart contract should be able to dip into a stream of constantly updated data in order to execute based on external conditions. For instance, an insurance contract that can release funds when a change in financial markets occurs without direct human oversight. I believe I've found a solution in the form of a decentralized oracle market, regulated by carefully constructed game theory. The solution will both provide a necessary boost to the Ethereum ecosystem and provide a solid, continuous use case for the Aragon Court System.

How it works demonstrated by an example use case

Suppose you wish to construct a smart contract that accepts ether deposits but only releases ether for withdrawal when the USD Ether price is above $5000. The first step is to establish a feed of USD ether prices. To do so, you register your desired data feed with a special smart contract that holds important criteria for would be oracles:

{
FeedName: ETHUSD, 
Description: Ether price in US dollars, 
Precision: 2, 
RegularityPer100blocks: 90, 
marginOfError: 0.1
}

The feed above will get a unique ID. You can now design your smart contract to reference the unique FeedID requesting the latest data by calling a function on the feed contract that accepts FeedID as the first parameter. You then issue a bounty that will be paid to whoever is willing and able to supply the data. The bounty will have a reward denominated in Eth or an ERC20 token. The bounty also specifies the starting block for when the feed should commence and the number of blocks the feed should last. Anyone can bid for the bounty and they don't have to provide any proof or reputation. The proceeds from the auction act as the deposit against which the winning oracle will be held liable if they provide false data. Bidding is done through an auction contract. Each bid displaces the previous bid. For instance, oracle1 spots a bounty for Eth/USD price and bids 1 eth. The 1 eth is locked. oracle2 places 2eth for the same bounty. Oracle1's deposit is now released for withdrawal and oracle2's eth is locked. Auctioning for top spot carries on for some period (probably a week) after which bidding ends. The winning oracle must now supply the data feed into a "live feed" smart contract, starting from the initial block for the duration as specified by the feed criteria. The bid amount that this oracle placed will now be staked (skin in the game) for the duration of the feed and some time after (to allow for disputes). From here, the winner of the above auction will be referred to as the chosen oracle.

After the bounty period ends, there is a week in which any user can contest the results supplied by the chosen oracle. If the feed is contested, the plaintiff places a deposit equal in size to the deposit placed by the chosen oracle. At this point, the Aragon Court System is activated. The judges will deliberate over whether the data was accurate to within the required margin of error and if it was delivered with the correct frequency. If so, the plaintiff will lose the deposit as per the court system rules and the defendant oracle will be able to withdraw both their deposit and the bounty amount. Else, the bounty is returned to the creator and the oracle's deposit is transferred to the plaintiff.

Caveats:

  1. The type of data best suited to this system is a continuous stream of numeric data such as financial market data and perhaps is not best suited for all scenarios.
  2. Accuracy can only be guaranteed with the existence of an active 'citizenry' monitoring and punishing bad actor oracles. There are post release plans to broaden the active ecosystem but that is beyond the scope of this proposal. As the ecosystem grows, the bounty rewards are likely to increase which will naturally create incentives for strict monitoring.
  3. Scale: A continuous onchain stream might bloat the main chain. A potential future upgrade will be to move this onto a side chain as demonstrated by the Loom Network or perhaps if the native protocol permits, post Casper. However, this isn't a concern until the number of active feeds exceeds 100.

Deliverables

1. An ether only version with a simplified court system, live on a test net.
2. An ERC20 aware version on a test net that plugs into the Aragon Court System.
3. A live and mature web of contracts on the main net.
4. A decent front end single page app that provides an easy to navigate workflow for users who have metamask but who don't want to think of anything under the hood. Specifically, would be oracles should not need any knowledge of Ethereum beyond being able to use a wallet.
Bonus: 
5. A sufficiently generic set of legal primitives to allow users to "bring their own legal system", allowing Aragon to act as an "International Court" of last resort. This would help with Aragon's desire to foster a Cambrian Explosion of legal systems.

Grant size

Funding: $7k per month for 12 months paid in Ether.

Success reward: Up to $50k in ANT, given out when all non bonus deliverables are ready.

Application requirements

Development timeline

The development timeline will be the following one in regards to each deliverable:

  1. Sep 2018
  2. December 2018
  3. Feb 2019
  4. Feb 2019 (4 would run concurrently with 3)
  5. (Bonus, optional) some time in 2019. I'm hoping at this point to pull in open source contributors attracted by the ideal of orthogonal legal primitives.

Proof that I have a good grasp of cryptoeconomics

I would refer you to my medium blog where I have a number of pieces illustrating my grasp of cryptoeconomics and ability to project complex scenarios. I will list a few examples below:

  1. https://medium.com/social-evolution/blockchains-will-save-us-from-a-i-ec366be62a95
  2. https://medium.com/social-evolution/a-minimum-viable-disc-how-to-make-a-ubi-in-the-age-of-blockchain-8ef1bd984be7
  3. https://medium.com/social-evolution/the-economics-of-lightning-network-fees-76f0926da82
  4. https://medium.com/@justingoro/a-blockchain-solution-for-international-amazon-deliveries-3616690717ac
gititGoro commented 6 years ago

I've added a detailed white paper to the original proposal. For ease of reference, it can be found at this link: https://github.com/gititGoro/Pythia/blob/judiciary/documentation/whitepaper.pdf

mariapao commented 6 years ago

Closing this issue as well.