What are blockchain oracles and why are they important?

Written by

in

Blockchains can securely record transactions and execute smart contracts according to predefined rules. However, they have one important limitation: they cannot independently access information from the outside world.

Imagine a smart contract that needs the current price of Bitcoin before allowing a user to borrow cryptocurrency. It cannot simply visit a website and collect the latest price on its own.

This is where blockchain oracles become important.

Oracles connect blockchain applications with external information. As a result, smart contracts can use data that does not originate on their own blockchain network.

But how do they work, and why do decentralised applications depend on them? Let’s understand step by step.

What is a blockchain oracle?

A blockchain oracle is a service or system that provides external information to a blockchain application or smart contract.

Such information can come from websites, APIs, databases, financial markets, weather services or physical devices.

For example, a decentralised finance (DeFi) application may need the latest ETH price to calculate the value of a user’s collateral. In this case, an oracle can provide that price to the smart contract.

Similarly, an insurance application may use weather information to determine whether a predefined condition has occurred.

In simple terms, an oracle acts as a connection between a blockchain and information outside it.

Rather than storing every piece of external information on the blockchain, an oracle delivers selected data for a smart contract to use.

Why do blockchains need oracles?

Blockchains operate through shared network rules. Therefore, participants need to verify transactions and the resulting state of the network.

However, information from outside the blockchain creates a challenge.

For example, Ethereum cannot independently confirm the current price of gold, the result of a cricket match or the temperature in a particular city.

This limitation is closely related to the oracle problem.

The oracle problem refers to the challenge of securely bringing external information into a blockchain while maintaining the reliability and trust that blockchain applications require.

If a smart contract receives incorrect information, it may execute an action based on that information. Consequently, oracles need to consider data accuracy, security, availability and the possibility of manipulation.

How do blockchain oracles work?

The exact process depends on the oracle design. However, a typical workflow includes the following steps.

1. A smart contract requests external information

First, a decentralised application may need specific information before executing an action.

For instance, a DeFi lending platform may request the latest ETH market price to calculate a borrower’s collateral value.

2. The oracle collects the information

Next, the oracle obtains the requested information from one or more external sources.

These sources may include market data providers, APIs, websites or other data systems.

3. The oracle processes and delivers the data

After collecting the information, the oracle may check, aggregate or validate the data, depending on its design.

For example, a system may compare prices from multiple sources before delivering a result. This can help reduce dependence on a single data provider.

4. The blockchain receives the information

Once the oracle processes the data, it makes the information available to the smart contract through an on-chain transaction or another supported mechanism.

5. The smart contract uses the information

Finally, the contract can execute its programmed rules using the information it receives.

A lending application, for example, may use the updated ETH price to check whether a user’s collateral meets its requirements.

Therefore, the smart contract follows its programmed conditions. It does not independently know whether the external information is correct.

What are the different types of blockchain oracles?

Oracles can be classified according to the type of information they provide and how they interact with blockchain networks.

1. Software oracles

Software oracles provide digital information from online sources.

Common examples include:

  • Cryptocurrency prices.
  • Foreign exchange rates.
  • Stock market information.
  • Sports results.
  • Financial and economic data.

A DeFi application, for instance, may use a software oracle to receive ETH price information from external market data sources.

2. Hardware oracles

Unlike software oracles, hardware oracles connect blockchain applications with information collected from physical devices.

These devices may include sensors, GPS systems and other connected equipment.

For example, a supply chain application may use temperature sensor data to monitor whether goods have remained within a required temperature range during transportation.

3. Inbound oracles

Inbound oracles bring external information into a blockchain network.

A smart contract may, for example, receive the latest cryptocurrency price through an oracle before calculating collateral requirements.

4. Outbound oracles

Outbound oracles work in the opposite direction. They send information or trigger actions outside the blockchain based on an on-chain event.

For example, a smart contract may trigger an external notification or request an action through a connected system.

However, the external system must still be able to receive and process that request.

5. Centralised oracles

A centralised oracle depends on a single provider or source to deliver information.

This approach may be simpler to operate. However, it creates a single point of failure or manipulation.

If the provider becomes unavailable or supplies incorrect information, the connected smart contract may receive unreliable data.

6. Decentralised oracles

Decentralised oracles use multiple independent data providers, nodes or sources to reduce dependence on a single provider.

For example, they may collect information from different sources and use aggregation methods to determine the result.

Although this approach can improve reliability, it does not automatically eliminate every risk. Data providers, node operators and aggregation mechanisms can still face security or manipulation problems.

Real-world examples of blockchain oracles

Oracles support several types of blockchain applications. Let’s look at some common examples.

1. Decentralised finance (DeFi)

DeFi platforms often need external market prices to calculate collateral values, lending limits and liquidation conditions.

For example, a lending protocol may use an ETH price feed to determine whether a user’s collateral remains sufficient.

Without reliable price information, the platform may calculate these values incorrectly. As a result, users and the protocol may face unexpected losses.

2. Decentralised insurance

Smart contracts can use external information to support insurance-related processes.

For example, a weather-based insurance application may use rainfall data to determine whether a predefined condition has been met.

Once the application receives the required information, the smart contract can follow its programmed payout rules.

3. Supply chain management

Businesses can use oracles to connect blockchain applications with external tracking systems.

GPS information or sensor readings, for instance, may help record product movement and storage conditions.

This helps businesses monitor supply chain events. However, the reliability of these records still depends on the accuracy and security of the original devices and data sources.

4. Blockchain gaming

Some blockchain games use external information to support game mechanics.

For example, an application may use an external random number service to determine the outcome of a game event.

A properly designed randomness oracle can help provide results that are difficult to predict or manipulate in advance.

What are the benefits of blockchain oracles?

Blockchain oracles make it possible for smart contracts to work with information beyond their own networks. In addition, they support several useful features.

Access to real-world information: Smart contracts can use market prices, weather reports, sports results and other external data.

More useful applications: By connecting external information with blockchain networks, oracles help developers build advanced DeFi services, insurance systems, supply chain solutions and blockchain games.

Automation: Smart contracts can respond to external conditions without requiring someone to manually initiate every action.

Data aggregation: Some oracle systems combine information from multiple sources. Consequently, applications can reduce their dependence on a single data provider.

Greater connectivity: Oracles help connect blockchain networks with existing digital systems and real-world information sources.

What are the risks of blockchain oracles?

Although oracles expand blockchain functionality, they also introduce important risks. Therefore, users and developers should understand their limitations.

1. Incorrect data

An oracle may provide inaccurate or outdated information. Consequently, a smart contract may execute an action using the wrong data.

2. Data manipulation

If an attacker influences an oracle or its data sources, the attacker may affect the information delivered to a smart contract.

This can create serious problems for applications that depend on accurate market prices.

3. Centralisation

An oracle that relies on one provider creates a single point of failure. If that provider becomes unavailable or compromised, the application may stop working correctly.

4. Network downtime

An oracle service may experience technical problems or delays. As a result, smart contracts may not receive updated information when they need it.

5. Smart contract vulnerabilities

Even if an oracle provides accurate data, the smart contract using that information may contain security weaknesses.

Therefore, both the oracle system and the connected smart contract need appropriate security checks.

What is the difference between a blockchain oracle and a blockchain bridge?

These terms may sound similar because both connect different systems. However, they serve different purposes.

FeatureBlockchain oracleBlockchain bridge
Main purposeProvides external information to blockchain applicationsEnables communication or asset movement between blockchain networks
Typical useDelivering cryptocurrency prices to smart contractsMoving tokens between supported networks
ConnectsBlockchain applications with external data sources or systemsDifferent blockchain networks
ExampleProviding ETH price information to a DeFi protocolTransferring a token from Ethereum to another network

In simple terms, an oracle brings external information into blockchain applications, whereas a bridge helps connect separate blockchain networks.

Popular blockchain oracle networks

Several projects provide oracle infrastructure for blockchain applications. Here are three examples.

<Entity value=”Chainlink” category=”software” disambig=”Decentralised oracle network for blockchain applications”/>: Provides oracle services that help smart contracts access external data, including market information and other off-chain resources.

<Entity value=”Pyth Network” category=”software” disambig=”Blockchain oracle network focused on financial market data”/>: Provides financial market data to blockchain applications through its oracle infrastructure.

<Entity value=”Band Protocol” category=”software” disambig=”Cross-chain decentralised oracle network”/>: Provides oracle infrastructure designed to connect smart contracts with external data across supported blockchain networks.

Although these projects serve similar purposes, they use different technical designs and data delivery methods. Their availability, supported networks and services can also vary.

Frequently asked questions

Can a blockchain work without an oracle?

Yes. A blockchain can process transactions and execute smart contracts using information already available within its network. However, applications that need external information may require an oracle or another data integration method.

Are blockchain oracles decentralised?

Not always. Some oracles depend on a single provider, while others use multiple independent nodes and data sources. Therefore, the level of decentralisation depends on the system’s design.

Are blockchain oracles completely secure?

No. Oracles can face data manipulation, downtime, software vulnerabilities and other risks. Although using multiple sources can reduce certain risks, it cannot guarantee complete security.

Do oracles store data on the blockchain?

Not necessarily. Oracles generally retrieve or process external information and make selected results available to smart contracts. However, the amount of information recorded on-chain depends on the implementation.

Are blockchain oracles and APIs the same?

No. An API allows software systems to communicate and exchange information. A blockchain oracle can use APIs as data sources, but it also provides mechanisms to deliver external information to blockchain applications.

Disclaimer: This article is for educational purposes only. It does not constitute financial, investment or technical advice. Always review the security, data sources and reliability of blockchain applications before using them.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *