An oracle is a third party service that relays information from the outside world to smart contracts. It acts as the bridge between the on-chain (blockchain) and the off-chain (outside world). Even though smart contracts help in enforcing contracts, it will be quite limited if it only depends on the data from the blockchain network.
The oracle is not the source of data in itself. Instead, it only relays the available data. It analyses the data for verification before deciding if it’s good enough or accurate for the blockchain network. Most of the data relayed by oracles come in the form of temperature from a sensor, election results and price information.
The oracle works such that it invokes the smart contract and spends some network resources. Some of the oracles can also relay information back to the outside world. An example of how an oracle works is on the election results. Let’s say one party says that the Liberal coalition will have the most seats in parliament while the other party vouches for the Labor party to take the day. The people involved in the agreement will draft their contract on the smart contract then give out their stakes in the form of money. The smart contract will then rely on the oracle to relay the election results for it to award the winner of the bet.
Without the information from the oracle, there is no way the smart contract would know the party with most seats after the elections, hence it would not be able to enforce the agreement. Smart oracles rely on the oracles for most other information to enforce their roles.
Types of blockchain oracles
There are various types of oracles based on different factors such as the source of information, the direction of information and trust. With these options, here are some of the types of blockchain oracles;
Software oracles
These are oracles that depend on online sources to get the information they relay to the smart contracts. Some of their information sources include online databases, websites, and any other source of data available online.
Given that smart contracts operate entirely online, the software oracles find it easy to relay the information. They, therefore, are the most popular types of oracles.
Hardware oracles
These are the oracles that relay information from the physical world to smart contracts. They depend on information from various physical sources like barcode scanners, thermometers and any other data recording machine.
The hardware oracles collect information from the physical world then translates it into a language understandable by the smart contracts. After which smart contracts can enforce the agreements on the network.
Human oracles
This involves individuals with specific knowledge relaying the information to the smart contracts. The system depends on cryptography to avoid scammers and identify theft.
Centralised and decentralised oracles
The centralised oracles are the ones that rely on a single source of information. They are, however, not popular due to the susceptibility to hacking as they have a single point of attack. The decentralised oracles work like the blockchain network as they rely on multiple sources of information. They are more secure as there is no single point of attack. Even if one source of information fails, the system will still operate as the other sources remain active.
Contract-specific oracles
These are oracles designed for a single smart contract. They are quite limiting and are also deemed expensive to design and maintain.
Bottom line
The oracles are what makes the smart contracts tick. The smart contracts would be quite limited on their use cases without the oracles. Already, several companies and applications rely on smart contracts for agreements. This is only possible with the smart oracles in place.