Mon, Aug 10, 2020 6:31 PM

The Complete Guide To Blockchain Oracles

CJ with a crystal oracle ball

Oracles are services that receive, verify and transmit data obtained in the real world, outside the chain, and send this information to smart contracts. What is a smart contract? 

It is a computing transaction protocol that fulfills the terms of a contract or the so-called contractual terms, such as payment, bond, confidentiality and even enforcement. Smart contracts cannot receive information outside the blockchain. But sometimes information from the outside needs to be documented and kept unchanged it can be fluctuations in price, information about the weather, etc. In this case, information needs a bridge between the external source and the blockchain. Oracle is this bridge. External data comes from software or hardware, which implies different types of oracles.

Types of oracles

Software oracles interact with the internet and transmit data in real time.
Example: data like air temperature, transport timetables, prices of goods. 

Hardware oracles are a solution for obtaining information from the real world.
Example: sensors like barcode scanners and IoT (Internet of Things) devices.

Inbound oracles reflect “if - then” scenarios associated with software oracles and provide information from the outside world.
Example: buying cryptocurrency at a certain price.

Outbound oracles send information from smart contracts to the outside world.
Examples: a smart blocking system that provides access to a product or service as soon as it receives information about a successful payment from the oracle

Centralized oracles are controlled by one legal entity or individual and is the only provider of information for a smart contract.
Example: Provable.

Decentralized oracles increase the reliability of the information provided by the absence of a single source of truth.
Example: iExec.

Human oracles use human input. They are valued for their independent view of the outcome of an event.
Example: Augur’s oracle.

Unmanned oracles use a decentralized way to connect smart contracts to data points available outside the contracts’ own blockchain.
Example: Witnet.

Oracle as a program code is an oracle that exists in software format and 
works with information that is online.
Example: such oracles can provide data on weather, temperature, prices for services or goods, transport schedules, and so on. The oracle receives this data from the websites of companies, processes it and provides it to the smart contract.

Oracular consensus prediction markets such as the aforementioned Augur and Gnosis need oracles to reliably predict events and outcomes. However, using only one source of information, it is impossible to accurately determine its reliability. In this regard, prediction markets use not one but several oracles to predict the consequences of events.

Several companies are working on projects related to the development and implementation of blockchain oracles: Oraclize, ChainLink, BNC (BraveNewCoin).

As the blockchain economy develops, the oracle ecosystem will rapidly evolve as a reliable way to connect the digital world with the real one. It is blockchain oracles that will be able to solve the problems of blockchain communication, as well as provide a wider application of smart contracts in various industries interested in using decentralized networks.

Where can you use oracles?

Oracles open smart contracts for a wide range of uses:

  1. Сollection and recording of election results.
  2. Forecasting the markets when the right conditions are met, the payout can be made.
  3. Carbon Tax carbon emissions can be monitored and if they are too high, companies will be automatically fined.
  4. Supply Chain sensors can be used to tell a smart contract that a product has arrived.

Oracles: problems and safety

Oracles are a blockchain add-on. The basic functionality of the blockchain does not include the ability to recognize documents on the occurrence of an event. This requires a separate program that will take over this function, connecting the real and digital worlds. Before talking about how the reliability of oracles is achieved, it is worth clarifying why it is important.

When we talk about blockchain, we see two main advantages: security and the absence of trust confirmation mechanisms (anonymity). The former is achieved by storing information in a non-centralized way, which makes hacking a network quite problematic. Oracle has the ability to manipulate the outcome of a particular smart contract, which directly links it to risks. The entered data can be deliberately false or incorrect, or the oracle can be attacked. Therefore, it is important to choose the type and provider of the oracle.

Oracle scheme

Let's start with the oracle reliability property. Today, there are two main approaches to achieving the reliability of oracles: the consensus of the oracles and TLSNotary proof. 

The consensus of the oracles approach uses the consensus of multiple independent validators. The main problem of this type is that the system is vulnerable to the Sybil attack. Hacking one or more consensus participants is easier than compromising one large validator, since a large player has much more serious security measures. 

TLSNotary is cryptographic evidence that the data received from the selected source is transferred to the smart contract unchanged. This solution was suggested by The Oraclize company that offers the second approach. The user chooses the source himself, and TLSNotary proves the correct operation of the oracle.

Oracle tlsnotary

At the moment, you can check this evidence on the Internet using a network monitor for Ethereum (at the time of the writing, it is unstable). In the future, it is planned to implement the ability to verify TLSNotary evidence directly by a contract on the Ethereum network.

It is important to note that both approaches have a problem of trusting the source(s) of information: both of them, to some extent, guarantee the honesty of data transfer from the source to the contract, but they do not guarantee the honesty of the source, even if we have chosen it ourselves.

Sources of information

Oracles use a variety of information sources - from meteorological resources providing weather data to Bloomberg information on price fluctuations in the stock market, or data on future events from the Augur prediction market. The main requirements for the oracle are the accuracy and completeness of the information provided. Here, reliability means the power to confirm/check the validity of data, and completeness means the potential to provide data on a wide range of events from the real world. 

Achieving completeness means expanding the range of sources of information, and this entails even greater questions about the reliability of these data. With an increase in the completeness of the information provided by the oracle, the problem of finding reliable sources becomes even more acute.

The most natural source of information is centralized. We are accustomed to this approach in everyday life: we find out the news on our favorite website, the dollar exchange rate on the website of the Central Bank. Most of us blindly believe these centralized sources, and this belief is most often justified, because the reputational costs for such large companies outweigh the potential benefit to be derived from providing you with false information.

There are two "buts" here. The first one is credibility: even when dealing with a trusted centralized source, we are still operating with trust, not knowledge. Second, and more important, is completeness: using a centralized source can only be considered a reliable approach for a narrow range of resonant events.

The first way to get around the disadvantages of a centralized source is to use source consensus. We have already discussed a similar approach above when we talked about the consensus of oracles. As in the case of oracles, this approach improves both the reliability and completeness of the information provided, but its positive effect is limited and has its drawbacks (see previous section).

Another approach to solving the problem of information sources is the indirect method. The idea is to extract information about the event of interest from indirect sources.

For relatively simple tasks, like determining the result of a match from a sufficient sample of sports fan posts, these questions seem solvable. It is assumed that the contract will refer to the node where the calculations are made (extracting the forecast from indirect sources). It is proposed to confirm the reliability of the calculations cryptographically, as it is implemented, for instance, in the Golem project.

Oracle sources of information

To complete the picture of the sources of information, we will touch on the topic of prediction markets such as Augur. The market platform uses the "wisdom of the crowd" to predict future events. Users predict the possible outcome of these events by buying shares of the reward for correctly guessing the result (the winners will divide the prize pool in proportion to the size of their bets). The use of prediction markets greatly increases the completeness of the information provided, because anything can be predicted (if there are enough willing ones), and reliability is provided by the economic motivation of the prediction participants.

However, not everything is as rosy as it might seem at first glance. Firstly, prediction is just the expectation of market participants (there are many examples of events that no one expected to happen). Secondly, in such a model, manipulations of the prediction are possible if the cost of changing the prediction is less than the profit from the wrong operation of the contract.

Oracles: pros and cons

Let’s suppose there’s a lot of falsified data, and the actions of the fraudulent company are revealed. Then the society is faced with a dilemma: to carry out a hard fork and return to the moment in the blockchain when the first fraud was committed, or to leave everything as it is. But in reality, the choice doesn't matter. Any outcome can most likely “kill” technology society will turn its back on it because of the undermining of trust.

Does the described scenario look likely? It sure does. Currently, oracles are created by four private companies. Their number will grow in the future. How can we be sure that at least one of them will not bypass the system for the sake of profit? Is there a high probability of such a development of events? Not really. Quite a few conditions must be observed for this to happen. But according to Murphy's law, if an event has at least some probability of occurrence, it will definitely happen.

Nevertheless, the importance of oracles for smart contract technology can hardly be overestimated. The future and widespread use of decentralized applications directly depend on external data that is not on the blockchain. Oracles serve as a bridge between smart contracts and the outside world, enriching and advancing technology. It is an important and integral part of the blockchain space.