Learning crypto?
Our new handy guide simplifies it all. ‘Crypto Categories Unveiled’
Download here
Oracles help bring real-world data on-chain, expanding the utility of blockchain-based applications and services. 
What are oracles?

To understand the need for oracles in blockchain, it’s necessary to comprehend the concept of determinism, a computer science term that describes a rules-based system with no randomness. A blockchain, such as Ethereum, that can execute programmable code is a deterministic system known as a state machine. A state machine takes an input, uses it to reach an output, updates its state accordingly, and repeats the cycle.

A blockchain network is made up of a decentralized group of participants called nodes. Network rules can vary, but generally, a majority of nodes must reach consensus on processed transactions and the overall state of the blockchain. In this decentralized environment, all inputs must be read and understood by all participants in the same way to produce a consistent output.

This strict adherence to systemic rules means that a blockchain like Ethereum is described as deterministic. It will only compute data that are knowable to all participants by being available on-chain, such as account balances or the state of smart contract execution.

However, blockchain’s determinism creates an inherent limitation for smart contracts that rely on off-chain data, such as crypto prices relative to fiat or the outcome of particular events, such as the final score of a football match.

Oracles are data feeds that bring this off-chain data on-chain so it can be used in the execution of smart contracts without breaking blockchain consensus. Oracles unlock a vast array of smart contract use cases that rely on off-chain data.

History of oracles

The word oracle has origins in ancient Latin and has many meanings in modern English, including in computing. In blockchain, the term has a specific definition referring to a feed of information from off-chain sources packaged for processing on-chain in smart contracts.

The oracle problem

The deterministic and decentralized nature of blockchain environments means that bringing off-chain data on-chain introduces a potential point of centralization and vulnerability.

For example, oracles are often used to feed price information into decentralized financial applications. If someone could find a way to manipulate the price data to their advantage, the network would have no way of knowing this has happened and would verify transactions based on false information.

Since blockchains can secure billions of dollars in value, such risks could have costly implications.

This trust problem is known as the “oracle problem,” and it’s one of the most fundamental challenges in realizing the potential of smart contracts. To successfully pass the oracle test, an oracle must be able to guarantee that data was obtained from authentic sources, and that it hasn’t been changed before being processed on-chain.

As blockchains operate 24/7 without interruption, oracles should also be able to guarantee that the data feed is always available on request.

How oracles work

Public blockchains and decentralized applications (dapps) rely almost exclusively on decentralized oracles. Oracles that depend on a single centralized data feed generally don’t pass the oracle test, as a single entity can’t also independently verify the authenticity and integrity of the data they provide.

A decentralized oracle service uses a network of nodes to source data from a variety of off-chain oracle services, including trading platforms for price data or news terminals for event outcomes. The node network then compares the data sources to check their veracity and discard any outliers that may skew the data.

Decentralized oracle networks also use crypto-based incentives to ensure that nodes are rewarded for providing clean, accurate data and penalized if they’re found to be providing unreliable data.

The process starts when a smart contract generates a request to the oracle network for off-chain data. The network responds by pulling available data from sources that have established themselves as reliable and consolidating the data into a single aggregated answer to the query. The response is then returned to the original smart contract.

Less commonly, some oracles are also used as outbound services, transferring on-chain data to off-chain sources. One example could be transmitting the number of minted tokens to online web monitoring services.

Use cases of oracles

Although oracles can theoretically provide any conceivable type of off-chain data, their usage generally falls into three main categories.

Financial data

The thriving landscape of decentralized finance (DeFi) applications wouldn’t exist without the availability of reliable financial information sourced by oracle services. Price oracles track the value of cryptocurrencies relative to fiat currencies across exchanges and the global capital markets for data about assets such as gold or commodities so they can be used in a wide array of DeFi dapps.

Event outcomes

Blockchain-based prediction market platforms such as Augur, which allow speculation on the outcome of events like state elections or sports tournaments, rely on oracle data to feed reliable outcomes.

Similarly, insurance applications such as Arbol rely on decentralized weather oracles to provide information about meteorological events to calculate accurate premiums on climate risk insurance.

Random number generation

Random number generation (RNG) is another type of data commonly provided by oracle services, as true randomness is at odds with the determinism of a blockchain environment. While a blockchain network can generate some degree of randomness, dice games and lottery-type dapps like PoolTogether rely on the ability to generate sequences or select participants with a high degree of randomness.

Decentralized oracles generate random numbers off-chain using a cryptographic algorithm called a Verifiable Random Function. This uses a public/private key pair to generate a random number and a cryptographic proof that the number is random. The number and proof are then submitted to the blockchain for use in a smart contract.

Examples of oracle providers

Chainlink is the oracle provider with the most extensive coverage in terms of supported blockchains and uptake by dapps. Chainlink provides data to Ethereum, Polygon, Avalanche, BNB Chain, Arbitrum, and many more blockchains. Its price feeds are used by many of the largest DeFi dapps, including Aave, Synthetix, and Compound.

Band Protocol is an oracle service built using Cosmos’ InterBlockchain Communication (IBC) protocol, meaning it can send data to any IBC-enabled blockchain. It's integrated with Celo, a payment protocol, and the Injective Protocol, a decentralized exchange platform.

UMA (Universal Market Access) is an advanced type of oracle called an “optimistic oracle,” designed to provide human intervention in the event of a dispute between static data points provided by standard oracle providers. UMA is predominantly targeted at developers.

Oracles essentials

  • Oracles are a way of bringing off-chain data on-chain for use in smart contracts.
  • Decentralized oracles such as Chainlink and Band Protocol overcome the key challenge that oracle data must be authenticated and unchanged before being sent on-chain.
  • Oracles unlock a wide array of use cases for smart contracts, for example, by providing price data to DeFi dapps, or event outcomes to prediction markets.

Ready to start your crypto journey?

Get started