Blockchain Oracles — Part I of II

(Featured Image Source: Decentralised Oracles: a comprehensive overview)

In this article, we are going to explain why we need blockchain oracles and the general oracle problem and its use cases. Then we describe the terminology around blockchain oracles and how they work.
Last but not least, we present examples of different blockchain oracle networks and provide a list of links for additional reading.

Why do we need blockchain oracles?

Smart contracts rely on deterministic triggers to execute their code. These triggers can originate from a user account/wallet (e.g. by sending funds to the contract) or from another smart contract (via so called traces or internal transactions). The code can never proactively transact on its own.

This results in a need for validated external information for the code to be reliably triggered and executed. Validated in this case means that the information is accurate and does not depend on a centralized sourcing process, thereby avoiding one single point of failure. This is very important, because the whole ecosystem of blockchain revolves around the concept of immutability and trustless interaction through decentralization. As decentralized systems are only decentralized to the point of their weakest link, connecting an oracle with a single point of failure to the blockchain would arguably cause complete loss of decentralization.

What is the blockchain oracle problem?

Practical example of the oracle problem in decentralized finance (DeFi)

You could, for example, use part of the borrowed ETH to buy another asset listed on the DEX and the bZx protocol. Meanwhile, you would use the rest of your loan to pump the price of the asset (this is possible if the trading volume is low enough and the size of your loan high enough), then post it as collateral into the bZx protocol to receive a new ETH loan, which is then worth more due to the artificially increased price. Finally you pay back the first loan with the newly acquired one and take home the difference as profit. This has happened in the past and got the “hackers” a profit of roughly 600.000$ (learn details in this medium article). Now the question is: how can we ensure that this behavior is impossible?

Use case examples of the oracle problem

  • Insurances regularly lose millions in profit through fraudulent reports. If the payouts are tied to objective real-world events such as wind speed for a hurricane insurance, or flight delays, they can be validated and reported to the blockchain by oracles. Check out Etherisc, who has been the first team working on blockchain insurance use cases.
  • Or consider another example: FOAM provides a decentralized location service that can serve as an oracle for proof of location (e.g. shipment of in a supply chain) to trigger payments, instead of relying on GPS as a single point of failure.
  • Decentralized prediction markets like Augur open up endless possibilities for betting on literally anything. These markets also rely on oracles as a bridge from the real world to the blockchain to be legitimately settled.

These mentions only capture a small subset of all possible future applications of blockchain oracles but are illustrative enough to point out the great significance of the underlying challenge often called “the oracle problem”.

Image Source: Blockchain Oracle — simply explained

What is a blockchain oracle?

BlockchainHub defines blockchain oracles as “[…] services that send and verify real world occurrences and submit this information to smart contracts, triggering state changes on the blockchain.” Note that “real-world occurrences” can also be blockchain events that reside on a different blockchain than the consuming smart contract.

Oracles bridge the on-chain blockchain world with the off-chain world by interfacing external data providers. They may also implement distinct measures of validation to ensure reliability of oracle operators / network participants.

Blockchain oracle terminology

To address this issue, a brief description of the different parties involved follows:

  • “Oracle network provider” is one of the terms that lies behind the word oracle. In this case the platform or infrastructure provider that hosts various nodes and validates the information reported by them is meant.
  • “Oracle node” or simply “node” is the term to describe an entity that reports the off-chain data to the oracle network. The node is run by its oracle node operator. As in the previous example, often the term oracle is used interchangeably.

The plain term oracle seems most suitable for the latter node entity that queries the external source and publishes the data by writing it onto the blockchain, thereby executing the two major points that solve the oracle problem.

How do blockchain oracles work?

Writing the data on-chain is straightforward: once the information is received by the oracle smart contract, it will be made publicly available via a function call. Technicalities such as the update frequency or data types are use-case-specific and can therefore vary significantly.

But the important part is: how can one ensure that the data written on the blockchain is legitimate?

There are various ways of implementing validation of the information that is reported by oracle node operators as participants of an oracle network. Most of the time oracle network providers opt for a mix of measures that prevent inaccurate data from being written on-chain. But validation does not solely lay in the hands of oracle network providers. Node operators and consumers of oracle information can also implement ways to increase the accuracy of the data they provide/receive. The following paragraph describes the main instances of such validation measures.

Reputation and Payments
If an oracle node operator does deliver good results constantly, their reputation increases. This can be tied to larger payments for the provision of data and serves as one of the basic forms of incentives in oracle networks.

Multiple data sources
A simple method to reduce the risk of wrong information is for node operators to use an average over aggregated results of multiple data sources. That way only if the majority of data sources or the node operator itself were compromised, false data could be written on-chain.

Multiple oracles
An oracle network, or a consumer of oracle information can decide to rely on multiple oracles to reduce the risk of erroneous data or node outages. It is far less likely to have the majority of oracles be malicious or unresponsive. Although if all oracles were to rely on the same or highly overlapping data sources, this form of hedging would provide insignificant benefits.

Staking / Slashing
Contrary to the common use of the word, staking in this case does not mean earning interest on provided liquidity. It means that oracle node operators are required to put tokens at stake to be lost (slashed) in case of malicious behavior. This serves as a negative incentive and is arguably one of the most promising mechanisms of trust in oracle node operators.

Trusted execution environments (TEEs)
Put very simply, TEEs allow applications to be executed in a separate part of the main processor of a computer. This allows for protection against subversion by other processes (integrity). Other parts of the operating system will not be able to read its data, code or state (confidentiality) while the application itself is still able to read and write memory outside of its separate part. Running oracle services in TEEs can therefore add an additional layer of security minimizing the risk of corruption. However, state of the art TEEs still come with vulnerabilities (for reference please see Source_1 and Source_2) and should thus also be considered only as an additional source of security rather than a stand-alone principle.

As a consumer of oracle information, it is vital to accurately assess the risk that can be taken by choosing either one or multiple oracles as sources of truth — and balance it against the costs and efforts of operation.

Examples of blockchain oracle networks and providers

Chainlink

Around Chainlink’s services, a thriving ecosystem of oracle related organizations has emerged. One concrete example is oracle node performance made visible through on-chain analysis (Chainlink Oracle Reputation). Other entities provide Chainlink nodes-as-a-service (https://www.linkpool.io/) or an Oracle market (https://market.link/). On the market, node operators compete for jobs by offering different levels of security guarantees, functionalities, and off-chain data connections.

Chainlink is actively supporting the community with a grant program.

Chainlink oracle services connect real-world data sources with blockchains like Bitcoin and Ethereum

Witnet

Witnet blockchain oracle data request and validation process

Provable

Do you want to learn more about blockchain oracles?

Our oracle node at Anyblock Analytics

Part II — Chainlink Price Feed Oracle Process and more!

Freddy Zwanzger — Co-Founder of Anyblock

Interested or questions?

Follow us:
Twitter, LinkedIn,
Medium, YouTube

Originally published at https://www.anyblockanalytics.com on August 19, 2020.

Anyblock Analytics is a German blockchain solution provider. We offer consulting, tools and data to integrate business processes with blockchain.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store