What are Oracles?
Blockchains and smart contracts cannot receive data from sources outside of their network. However, many applications on the blockchain need to receive reliable information from the outside world.
This article will look into the oracles, why they are important for the blockchain to work, and problems that may be associated with them.
Oracles are services that allow smart contracts to receive information from outside of the blockchain.
The oracles themselves are not data sources; they only provide the blockchain with an accurate authoritative source of information. The scope of their application is pervasive: from sports betting to providing a price of coins. To request data from outside of the specific blockchain, you need to activate a smart contract and spend network resources. Some oracles are not only able to transfer information to smart contracts but also send it back to external sources.
Types of oracles
Oracles can be divided according to sources of information, degree of decentralization, and “direction”:
- Software oracles. Software oracles process data from the Internet — for example, the cost of products and goods, flight delays, cryptocurrency rates. The oracle extracts the necessary data from online sources and puts it in a smart contract.
- Hardware oracles. Receiving some information requires you to interact with physical sources, such as sensors, to figure out the temperature outdoors, read fingerprints or the availability of goods in the warehouse.
- Human oracles. Sometimes an expert must additionally check information coming from an external source.
- Centralized oracles. Centralized oracles take information from one provider or group of providers controlled by one entity.
- Decentralized oracles. These oracles are the opposite of the centralized ones. In the case of decentralized oracles, a smart contract requests information from several sources at once in order to confirm the reliability and accuracy of the data.
- Inbound oracles. They receive information from the Internet and transmit it to the blockchain.
- Outbound oracles. They transmit information from the blockchain to the outside world. This type of service is used when checking a payment status.
It is best to understand how oracles work using an example, such as betting on an event. If you bet on the victory of team 1 in the Champions League final match, while your friend bets on team 2. To make the wager, you block your funds using a smart contract. But since the smart contract cannot interact with the off-chain data source, you connect an oracle that will provide all the necessary information, in this case, about the winner of the Champions League final. After the match, the oracle sends a request to a trusted source of information, receives information about the winner, passes it to the smart contract, and, as a result, the winner receives funds to his account.
Oracles are also popular on the decentralized derivatives exchanges and lending services to loan assets. In this case, price aggregation sites, such as coinmarketcap, cryptorank, or some exchanges, such as Binance or Coinbase, can act as a source of information.
Since the operation of smart contracts depends on the data provided by oracles, an attack on the system through this data is the most dangerous and probable scenario. This is often referred to as the “oracle’s underlying problem.”
Unfortunately, oracles are not part of the security mechanisms of public blockchains, because they are in no way connected with the consensus of the blockchain network and often are a very vulnerable third party.
A reliable mechanism that simplifies communication between smart contracts and the outside world is vital for society to adopt blockchain technology globally. Without oracles, smart contracts are forced to rely only on the information that already exists on the network, which significantly limits their capabilities.