The Oracle Problem: Why Blockchains Need a Bridge to the Outside World

From immutability, resilience, decentralisation, and peer-to-peer transactions, blockchain technology has many benefits. But it has one significant limitation: its network is similar to a computer with no internet connection.

Blockchains are designed to be isolated walled gardens to maintain security and consensus. They are excellent at tracking data that is native to their own ledger, such as an ETH transaction or an ERC-20 token balance on Ethereum. However, they are completely blind to the outside world. A blockchain can't natively know the price of Bitcoin in US dollars, the winner of the 2024 US Presidential Election, or the current temperature in Cape Town.

This isolation presents a major hurdle for the utility of smart contracts. For these digital agreements to execute based on real-world events, they need a reliable way to ingest external information. This is where blockchain oracles come in. Oracles act as the vital middleware or bridge that connects the on-chain environment to off-chain real-world data.

In this article, we'll explore what oracles are, the different types available, and how they solve the connectivity problem. Let's get started!

What Are Blockchain Oracles?

A blockchain oracle is a third-party service that fetches, verifies, and delivers external data to smart contracts. It is important to clarify that the oracle is not usually the data source itself, like a stock exchange or a weather station. Instead, it functions as a layer that queries these sources, authenticates the information, and transmits it to the blockchain in a format that smart contracts can understand.

Oracles act as a bridge between two distinct spaces: the blockchain and the off-chain world, which includes legacy systems, APIs, real-time events, and even other chains. This bridge is essential because smart contracts are deterministic, meaning they execute automatically based on if/then logic.

Consider a simple betting scenario between Alice and Bob regarding a sports match. They lock their funds into a smart contract, agreeing that the winner takes all. The smart contract holds the money securely, but it has no way of knowing which team actually won the game. It needs an oracle to query a trusted sports API, verify the score, and tell the contract who the winner is, so it can release the funds. Beyond simple bets, this connectivity is critical for complex applications, such as DeFi price feeds for lending protocols, insurance contracts that payout based on weather data, and supply chain tracking that relies on IoT sensor readings.

What Are the Different Types of Oracles?

Oracles come in various forms, each designed to handle specific types of data and delivery methods. Examples of such include:

  • Software Oracles connect to online digital sources to extract data. They pull information from websites, servers, and databases via APIs. These are the most common types of oracles, used extensively to provide real-time financial data, such as exchange rates, crypto prices, and stock market indices, to the blockchain.

  • Hardware Oracles bridge the gap between the digital and physical worlds. They interact with physical devices like IoT sensors, RFID tags, or barcode scanners to translate real-world events into digital values. For example, a hardware oracle in a supply chain could verify if a shipment has arrived at a specific GPS location, or sensors could report flood levels to a parametric insurance contract.

  • Inbound and Outbound Oracles are defined by the direction of data flow. An inbound oracle brings off-chain data to the blockchain, such as a price feed for a DeFi dApp. Conversely, an outbound oracle allows a smart contract to send commands to the outside world. An example of this would be a smart contract triggering a traditional bank payment or unlocking a smart lock once a crypto transaction is confirmed.

  • Centralised and Decentralised Oracles differ in their trust models. A centralised oracle is controlled by a single entity, which serves as the sole provider of data. While efficient, this introduces a single point of failure. Decentralised oracles, on the other hand, rely on a network of independent nodes to provide data, a concept we will explore in the next section regarding the Oracle Problem.

The Oracle Problem: How Decentralised Oracles Provide an Efficient Alternative?

The Oracle Problem describes a fundamental security paradox in blockchain development. While a blockchain itself is decentralised and secure, connecting it to a single, centralised oracle introduces a single point of failure.

If a smart contract controls millions of dollars but relies on one data provider, the entire system is only as secure as that one provider. If the centralised oracle goes offline, the smart contract halts. Worse, if the oracle is hacked or corrupted, it can feed "garbage" data to the contract. Since smart contracts execute automatically, "garbage in" leads to "garbage out," potentially resulting in irreversible financial losses or market manipulation.

To solve this, the industry has adopted Decentralised Oracle Networks (DONs). These networks mitigate risk by avoiding reliance on a single source of truth. Instead, they aggregate data from multiple independent nodes and data sources. Before data is transmitted on-chain, the network must reach a consensus on its accuracy. For instance, to determine the price of Ethereum, the network might take the median value reported by 20 different sources, filtering out any outliers or manipulated data points.

Leading solutions in this space include Chainlink, Band Protocol, API3, and Pyth Network. Pyth, for example, specialises in high-speed financial data by sourcing directly from first-party providers like exchanges and market makers. To ensure security, these networks often employ reputation systems and staking mechanisms, where nodes are financially penalised (slashed) if they provide incorrect data. Additionally, cryptographic proofs are used to verify the authenticity and origin of the data being reported.

Blockchain Oracles in Action

Oracles are currently the unsung heroes powering some of the most innovative sectors in crypto.

In DeFi, price feeds are essential. Lending protocols like Aave or Compound rely on oracles to track the value of user collateral. If the price of an asset drops below a certain threshold, the oracle updates the smart contract, which then triggers a liquidation to protect the protocol's solvency.

In the insurance sector, oracles are enabling parametric insurance. For example, a farmer could purchase a decentralised insurance policy against drought. If a weather oracle like Arbol reports that rainfall has dropped below a set level for the season, the smart contract pays out the farmer automatically, removing the need for a claims adjuster.

Oracles also enable fairness in gaming. Since blockchains can't generate true random numbers, developers use oracles like Chainlink VRF (Verifiable Random Function) to provide provably fair randomness. This is used to determine lottery winners or the rarity of traits in an NFT drop.

Furthermore, protocols like the Cross-Chain Interoperability Protocol (CCIP) act as transport layers, allowing data and tokens to move securely between different blockchains, such as Ethereum and Solana.

The Future of Smart Contract Connectivity

Oracles have established themselves as the backbone of the Web3 ecosystem, enabling utility that goes far beyond simple token transfers.

As the industry matures, we are seeing the emergence of privacy-preserving oracles that utilise zero-knowledge (zk) proofs to verify data without revealing the underlying information, as well as AI-powered oracles capable of processing complex data sets. Additionally, the rapid growth of real-world asset (RWA) tokenisation is heavily dependent on oracles to provide accurate off-chain valuation data for assets like gold, real estate, and treasury bills.

Ready to explore the infrastructure powering blockchains with external data? Create an account on VALR to trade top oracle tokens like Chainlink (LINK), API3, Band Protocol (BAND), and Pyth Network (PYTH) today!

Risk Disclosure

Trading or investing in crypto assets is risky and may result in the loss of capital as the value may fluctuate. VALR (Pty) Ltd is a licensed financial services provider (FSP #53308).

Disclaimer: Views expressed in this article are the personal views of the author and should not form the basis for making investment decisions, nor be construed as a recommendation or advice to engage in investment transactions.

Next
Next

What Are Decentralised Identifiers? A Guide to Web3 Identity