How to use Reality.eth + Kleros as an oracle

When you want your app to get data from a subjective oracle

In use cases where a subjective oracle is required to give an answer on-chain about the occurrence of an event (e.g.: Prediction Markets, DAO Governance, etc...), your application might want to use the combination of Reality.eth bond escalation mechanism with Kleros arbitration services to have a decentralized and fair source of truth.

Learn more about this use case

Architecture

High-level architecture overview of an app using Reality.eth + Kleros as an oracle
  • Your app requiring a subjective oracle

    This is your smart contract that will only interact directly with Reality.eth contract.

  • Reality.eth

    Bond escalation mechanism contract where anyone can submit a question with a required minimum bond to submit answers. It is possible to request arbitration by a 3rd party at any point after a first answer is submitted.

    Documentation - Github

  • Reality.eth < > Kleros Arbitrator proxy

    Contract acting as a proxy between Reality.eth and Kleros Court contract. It acts as a Reality.eth arbitrator by creating corresponding disputes in Kleros Courts and submitting the final ruling as an answer in the proper format. This contract is configured with a number of initial votes required and a specific sub-court where the dispute will be raised (ex: 5 initial votes by jurors in Blockchain > Technical court). You can use one already used by other apps or ask the cooperative Kleros team to deploy a new one fit for your needs.

    Github

  • Kleros

    Kleros Court contract that will adjudicate on the dispute by drawing jurors and publishing a final ruling about the case.

Requirements

To use this service, you just need to ensure that:

  • your smart contract is compatible with the Reality.eth contract interface (check their documentation and repo)

    • If your contract is in development, Cooperative Kleros team can support you in making it compatible.

    • If your contract is already live, Cooperative Kleros team can support you in building a connector for it.

  • you submit the address of the Reality.eth<>Kleros arbitrator proxy you want to use as arbitratorwhen you ask a question. The arbitrator proxy will be set up with an initaial number of votes to be requested and a specific subcourt in whichcases will be raised. The Cooperative Kleros team can help select the right arbitrator for your use case or deploy a new one for you.

function askQuestion ( uint256 template_id, string question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce ) external payable returns ( bytes32 );

Reality.eth <> Kleros Arbitrator Proxy deployments

  • (Current version) Mainnet - to be deployed soon

  • (Current version) Kovan

  • (Old version without appeals) Mainnet

    • 500 votes in general Court

  • (Old version without appeals) Kovan

Sequence Diagram