A smart contract can use a range of data sources to trigger its execution. But how does a smart contract find the information required to permit the contract to execute?
That’s where a blockchain oracle steps in.
What Is a Blockchain Oracle?
A blockchain oracle bridges the gap between a smart contract and the external data some smart contracts require to function properly.
The blockchain cannot access data outside of its network. But a smart contract built on top of that blockchain may well require external data to function. (Here’s some more information on how a smart contract works with a blockchain). That is where a blockchain oracle steps in. An oracle, in the context of blockchain, is a third-party service that provides data to a blockchain.
For clarity: the oracle is not the data source. It is a specialized layer that interfaces with external data sources, in turn making that data available to a given blockchain. In a sense, it is a data translation service designed to enable smart contracts to execute. The external data can be almost anything: the temperature, the price of a commodity, a successful transaction, and so on. If the data measurement provided to the oracle meets the conditions of the smart contract, it will execute.
Furthermore, not all smart contracts require a blockchain oracle. Some smart contracts use information available exclusively on the same blockchain network.
Blockchain Oracle Types Explained
Just as there is no single blockchain, there are several different types of blockchain oracles, too. Developers can program an oracle for a specific type of use.
- Software Oracle: A software oracle handles online information, taking data from online sources such as trading sites, company and business sites, news organizations, and so on. Software oracles use web APIs to hook into the required data. Because the reach of the internet is so vast and so many services and businesses use it as a core operational tool, software oracles can be very powerful tools.
- Hardware Oracle: A hardware oracle is typically deployed in real-world situations. For instance, whether a certain vehicle has reached a location at a specified time, allowing the next part of a contract to unlock. Another common use is in supply chain tracking management, confirming data such as time, location, distance traveled, temperature, and more.
- Consensus-Based Oracle: A consensus-based oracle works a little differently to the other oracle types. Instead of relying on a single data source to confirm the execution of a smart contract, consensus-based oracles use multiple data sources on multiple oracles to confirm an event. There’s more on consensus-based oracles and blockchain oracle trust below.
- Inbound Oracle: An inbound oracle provides a smart contract with incoming data that can trigger a certain smart contract event. For instance, if a commodity reaches a certain price, take this action.
- Outbound Oracle: At times, a smart contract needs to communicate with the outside world. That’s where an outbound oracle is handy. The outbound oracle sends qualifying data back to the outside world from the smart contract.
How Can We Trust Blockchain Oracles?
The biggest issue facing smart contracts using a blockchain oracle is trust. Using a centralized third-party blockchain oracle is the opposite of a decentralized trust-less system. Furthermore, the blockchain oracle isn’t part of the blockchain mechanism. Therefore, its actions and its data are not subject to the same consensus mechanisms found on most blockchains, the very mechanism that provides a blockchain with its strongest qualities.
That’s where consensus-based oracles come to the fore. Instead of trusting a single source or a single oracle to deliver consistently accurate data (inaccuracies, failures, and errors do happen, of course), why not use a decentralized oracle to secure the data?
Thankfully, there are several different decentralized oracles offering data validation services.
Prediction markets like Augur and Gnosis use decentralized oracles to fetch data sources for the thousands of markets created on their networks.
In the case of Augur, a user creates a prediction market with a question. For instance, “Will Tottenham win more Premier League points than Arsenal this season?” Other Augur users can purchase shares of the market, short the market, or go long on the outcome. The market creator picks an oracle to find the data to complete the market question. In this case, the oracle is a REP staking user of the Augur platform.
When the event takes place, the chosen oracle has three days to confirm the data the market requires. The market then has seven days to dispute the data. In most cases, the oracle chooses verifiably correct data.
ChainLink is a new decentralized oracle network that uses distributed nodes to retrieve the data a smart contract requires. Instead of using a single source, ChainLink’s distributed nodes form a consensus as to the correct data, which is then sent to the smart contract.
Nodes in the ChainLink Network offer different types of data services. Anyone with a data feed can connect to the ChainLink Network in exchange for ChainLink tokens (LINK). The system also has inbuilt features like reputation tracking, allowing the ChainLink Network to value the accuracy of a data source against others.
Although ChainLink is effectively a middleware, it has shown its decentralized oracle platform to provide accurate and effective data.
Mobius Network started with the Stripe for Blockchain API, an integration tool allowing any cryptocurrency token to integrate into any application. Part of the API allows for the easy connection of existing apps to a smart contract. From there, the development team proceeded with the idea of a Decentralized Data Marketplace, which in turn led to the development of the Mobius Proof of Stake Oracle Protocol (PSOP).
PSOP, which is patent pending, allows Mobius Network users to select a specific oracle to provide and validate data. The list comes from the Decentralized Data Marketplace where oracles compete to provide services, receiving rankings and tier levels for quality and so on. The proof of stake element is “used to incentivize oracles to provide correct data and penalize oracles that provide incorrect data.” In that, the more an oracle can provide accurate and effective data, the more it can earn, the higher rating it will receive on the Decentralized Data Marketplace.
Blockchain Oracles Vital for Smart Contract Development
Blockchain oracles are vital for the ongoing development of smart contracts. As smart contracts become integral to businesses, governments, and financial institutions, trust-less decentralized oracles will increase in importance.
Furthermore, the attention on oracle projects like ChainLink illustrates the fundamental power a decentralized oracle holds. Going a long way to solving the trust issues presented by a single source oracle helps, too. Expect further decentralized blockchain oracle services to come online in the near future, in what is set to become a very competitive data verification and provision marketplace.
Want to know more about blockchains? Check out these TED talks on Bitcoin and blockchain that’ll get you up to speed in no time.