The conventional meaning of an ‘oracle’ is one that dates back thousands of years ago. In simple terms, an oracle is a person or organization that provides others with insightful information or prophetic predictions about the future. Traditionally, divine information was said to be given to these seers by the gods themselves. Alternatively, the oracle could be the priest or priestess acting as a sort of medium. Through them, wise advice and/or prophecies from a divine power were conveyed.
Essentially, oracles are a powerful source of information. Given the background, it’s surprising to learn that oracles are a common tool in blockchain technology. This article will go into detail about what they are and what exactly their purpose in relation to blockchain is.
What is a blockchain oracle?
The general function of a blockchain oracle is similar to those that exist in mythology. They were the source of information that was beyond peoples’ comprehension. In the same vein, blockchains don’t have direct access to information residing outside the chain. Because of this, there’s no discernible method of validation for the conditions that smart contracts draw from.
Oracles provide the data that is necessary for triggering smart contracts to execute upon the meeting of the original terms. The association of these conditions with smart contracts can be a variety of things. These include temperature, the completion of payment, changes in price, and numerous others.
Basically, oracles are what allow smart contracts to interact with external data.
This data derives from one of two wares: software (big-data application) and hardware (Internet-of-Things). As previously mentioned, the conditions can be any data, however, the smart contract doesn’t wait for external data to go into the system. Instead, the contract needs to be enforced, meaning one must spend network resources for calling external data. This consequently activates network transaction costs. When it comes to Ethereum, this is ‘gas.’
Communication without oracles
Decentralized applications (DApps) are unable to communicate with the world without the use of an oracle. The reason for this comes from the essential differences in formats.
Blockchain is basically a reflection of a series of events that occur one after another in a sequence. As a whole, it is a series of transactions. Accessing external information requires data points that aren’t sequential, thus it’s impossible for blockchain to utilize it. This particular aspect gives blockchain immutability, however, it also greatly reduces its flexibility.
The off-chain world is different in that it is not deterministic like blockchain. In this case, there is no documentation of the events in the specific order of their occurrence. This, in turn, conjures up problems concerning the overall transparency. The generation and understanding of data can happen at any time, providing an increase in flexibility. At the same time, though, it increases the difficulty in blockchain communication.
This distinction in the foundations makes the two of them incompatible by default. It is only with an oracle’s presence that two-way communication between them is possible.
Different types of oracles
There are an array of oracle types that exist:
- Software Oracles: These handle information data that stems from online sources. These include temperature, goods and commodity prices, delays of flights or trains, and several others. Software oracles obtain information and place it in the smart contract.
- Hardware Oracles: There are a number of smart contracts that need information directly from the physical, outside world. An example of this is a car crossing a barrier where sensors detect the vehicle and send the data to a contract. Alternatively, RFID (Radio Frequency Identification) sensors within the supply chain industry.
- Inbound Oracles: These provide data stemming from the outside world.
- Outbound Oracles: These provide smart contracts that possess the ability to send data out into the world. An example of this is a smart lock, which acquires a payment on its blockchain address. Moreover, it has to automatically unlock.
- Consensus-based Oracles: These receive data from human consensus and prediction markets such as Gnosis and Augur. There is a lot of risk and instability behind employing only one source of information. So, to mitigate market manipulation, prediction markets enable a rating system for oracles. A blend of diverse oracles provides additional security. An example of this method is having three oracles out of five that determine the outcome of a specific event.
Challenges & Obstacles
The primary challenge with oracles is that people have to have faith in the external sources of information. This is regardless if they derive from a website or a sensor. Generally speaking, oracles are third-party services that do not have a place in the blockchain consensus mechanism. So, they aren’t subject to the latent security mechanisms that this public framework provides. It’s easy for someone to replicate attacks of the “man-in-the-middle” variety between oracles and contracts.
The healthy and stable assertion of the ‘second layer’ is incredibly crucial. There are several computing techniques that can help solve these issues. Be that as it may, this particular topic is in need of more attention than it is currently getting. The reason being that secure oracles are essentially a bottleneck when it comes to smart contract security. Should there be no adequate oracle security, it will be an effective delay in the widespread implementation of smart contracts.