What are blockchain oracles?

RPA
Robotic Process Automation (RPA)
28th May 2022
shortcuts
10 Handy iPhone Shortcuts to Automate Everyday Tasks
7th June 2022
RPA
Robotic Process Automation (RPA)
28th May 2022
shortcuts
10 Handy iPhone Shortcuts to Automate Everyday Tasks
7th June 2022

Blockchain oracles, also called blockchain middleware, are services that connect blockchains to external (off-chain) third-party clients and services.

Oracles act as intermediaries between blockchains and external data sources by providing avenues for exchange between blockchains and third-party services and vice-versa.

On smart contract blockchains, hybrid smart contracts (smart contracts that use oracles) use decentralized oracle networks (DONs) which examine, verify, and validate resources from external services for use on blockchains.

Blockchains, by design, do not have data, as they are mere data structures and often need data from external sources to function — the data from the external source must be accurate and trustworthy.

Decentralized Oracle Networks (DONs) — using various oracle decision models — compute, manipulate, and analyze data from numerous sources to ensure a high degree of data accuracy and no single point of failure.

Oracles can also be used as interoperability solutions since oracles like Chainlink and Band Protocol serve multiple blockchains.

How blockchain oracles work

Oracles use various tools to collate data. The tools could be APIs, SDKs, IoT sensors, or other sources; this data is sent as a signed message on the blockchain.

Smart contracts access the data via the oracle, which stores the data in smart contract storage for accessibility.

Types of blockchain oracles

There are many types of oracles that are used today. Here’s a look at each one:

Software oracles

Software oracles are oracles connected to the Internet. These software oracles use databases, web scrapers, APIs, and more to fetch data.

They are the most widely used form of the oracle because of their versatility. An example of a software oracle would be an oracle feeding the Ethereum blockchain with data from YouTube using YouTube’s API.

Hardware oracles

Hardware oracles connect to hardware and computer peripherals to retrieve data for use. They are trustworthy when compared to software oracles because they are harder to compromise. Hardware oracles use IoT sensors and RFID tags to fetch data from sources.

Hardware oracles are helpful for supply chain, weather, and other physical, real-world scenarios. An example of a hardware oracle would be the geolocation of package delivery.

Inbound oracles

Inbound oracles perform the task of supplying data from external sources into the blockchain.

These inbound oracles would use hardware oracles, software oracles, or both to fetch external data used in the blockchain.

An oracle that scrapes Web 2.0 websites for data is an example of an inbound oracle.

Outbound oracles

Outbound oracles disburse data from a blockchain to an external party. The party could be another blockchain for interoperability purposes or an external database. A smart contract on the blockchain would serve as the oracle.

Software, like Web3Py and Web3Js, uses oracles to query the blockchain and relay data to Web 2.0 services. An example of outbound oracles would be smart contracts that check the circulating supply of a cryptocurrency token.

Consensus-based oracles

Consensus-based oracles use multiple oracles and a consensus algorithm to derive factual data for smart contracts — they help ensure that data passed onto the blockchain is accurate and trustworthy.

A consensus-based oracle would, for example, scrape up to five news websites to verify that a piece of information is true before passing it onto the blockchain.

Compute-enabled oracles

Compute-enabled oracles are used for computations that cannot be carried out on-chain due to various reasons like block constraints and cost of computation. These compute-enabled oracles verify that the data is accurate before the computation.

Compute-enabled oracles are mostly used by Layer2 solutions like ZK Rollups (zero-knowledge rollups) to gather data off-chain (before submitting on-chain) and are one of the features that distinguish ZK Rollups from Optimistic rollups.

Cross-chain oracles

Cross-chain oracles bridge data across various blockchains, thereby enabling interoperability between blockchains. These could be agnostic (blockchain-independent) protocols like the Band Protocol, which allows for data and value transfers across blockchains.

A cross-chain oracle like Chainlink can be used to bridge data from Ethereum to Cardano.

Deterministic oracles

Deterministic oracles are oracles built on trusted data sources. These oracles use algorithms that consider variables like reputation scores to derive data. If a source is 98% correct, for example, there’s a high probability that it is accurate and can be trusted.

An oracle that collates data feeds from government agencies, for example, can be trusted and used as a deterministic oracle.

  • Ethereum: Chainlink, Band Protocol, iExec, UMA, Orai
  • Solana: Chainlink, DIA, Pyth, Switchboard, Gravity
  • Cardano: Charlie3, API3, Orcfax, PIGY Oracle, Chainlink
  • Terra: Chainlink,
  • Tron: Wink, Bridge Oracle
  • Cosmos: Band Protocol

Use cases of blockchain oracles

Finance

Decentralized finance applications (DeFi apps) can use inbound oracles to obtain prices of assets and tangible public goods for their application use-cases.

Third-party applications like centralized cryptocurrency exchanges can also use outbound oracles to fetch and track cryptocurrency data.

Digital identity

Digital identity solutions can use oracles to authenticate a user’s provided identity data, such as certificates and documents, from an issuer.

Digital identity solutions can also use oracles to collate and update a user’s data to keep their identity in sync with their actions.

Supply chain

Since a supply chain on a blockchain needs to interact with real-world data, they need oracles. Supply chain smart contracts can use hardware and software oracles to track the state of package delivery in logistics operations.

Oracles are important to almost all applications of smart contracts, as these contracts eventually have to interact with trusted and verified real-world data.

Conclusion

Oracles are essential to the development of blockchain and Web3 since can serve as the infrastructure that can aid blockchain and other distributed ledger technologies in accessing data to be used in many daily operations across virtually all industries.

Blockchain