What are Oracles?: The Complete Guide to How Blockchain Oracles Work

DATE PUBLISHED: FEB 13, 2023
21 MIN
DATE UPDATED: OCT 3, 2023

Start Trading on 3Commas Today

Get full access to all 3Commas trading tools with free trial period

Smart contracts have a vast range of applications beyond just cryptocurrency transactions. To fully unlock their potential, smart contracts need to interact with data and information that exist outside of the blockchain.

Oracles act as a bridge between the blockchain and external data sources. This article aims to provide a comprehensive overview of blockchain oracles, their functions, and different examples.

What are Oracles?

Oracles are secure systems that rely on cryptographic primitives to provide maximum transparency and verifiable security. They serve as the bridge between blockchain ecosystems and external data sources, filling in the gap left by smart contracts, which are unable to perform this function.

Blockchain oracles get data from web APIs or other sources outside of the blockchain and send it to the blockchain.

Public blockchains maintain a public record of the blockchain ledger's history and transactions. Transactions are confirmed in blocks through consensus mechanisms among node participants. The use of smart contracts allows for efficient, trust-free transaction execution and recording in the public ledger.

What are Oracles?: Why Blockchain Oracles Exist?

Blockchain oracles are needed for smart contracts to be useful in the real world for things like gaming, insurance, borrowing, and lending.

All nodes in a blockchain system must validate transactions. To do this, they must all achieve the same results. If they do not, the transaction will be rejected. In other words, every input into a blockchain should always result in the same output.

This is straightforward for a static transaction with no variables. Person X has $20 in their wallet, while Person Y has $30. If person X sends $10 to person B, the blockchain can easily validate this transaction because it is static and lacks variability, allowing all nodes to validate that $10 (a fixed amount) was sent to person B.

X's wallet balance falls by $10, while Y's wallet balance rises by $10. When validated, this transaction always yields the same result.

We'll run into issues if we add a variable component. Assume that person X wishes to send $10 in Ethereum to person Y. The amount of Ethereum transferred in this transaction is determined by the ETH/USD variable. To obtain this information, an API is required.

However, because the value of ETH/USD fluctuates in milliseconds, a node attempting to validate this transaction will not obtain the same result as another node. The transaction cannot be validated in this case. This is where blockchain oracles can help.

An oracle receives data from an external source, such as an API or a combination of sources, and stores it in the blockchain. Since the data in the blockchain is immutable, every node that checks this transaction will get the same results.

What are Oracles?: How to Solve the Oracle Problem

The oracle problem has been a persistent challenge in the blockchain and smart contract industries for a long time. The design of blockchains lacks the necessary security and functionality for effective communication with external data sources.

Blockchain oracles pose a threat to the blockchain's promise of immutability. Data obtained from oracles becomes permanent and unalterable only after it has been recorded on the decentralized ledger. This raises the question of who authenticates the data provided to the chain.

The origin of blockchain oracles in centralized locations that require third-party permissionis a threat. This is a conflict between the authenticity of Oracle data and traditional blockchain trust assumptions. This is commonly referred to as the "Oracle Problem."

In a nutshell, the "oracle problem" refers to the conflict between security, authenticity, and trust in third-party oracles for the trustless execution of smart contracts. Oracle retains significant control over how smart contracts are executed because the data they provide determines how the contracts execute.

As a result, data feeds from third-party sources have a big effect on how smart contracts are carried out. This takes away the fact that smart contracts are trustless and part of a decentralized network.

Blockchain oracles, unfortunately, lack the ability to offer trustless verification in the process of linking physical assets to the blockchain. Assume you are transferring ownership of your car to your friend Matthew. In this case, the smart contract should confirm that you have indeed transferred your car to Matthew.

The smart contract must rely on a third party to perform physical verification. A degree of trust is placed in the third party to perform the verification. This is where the fundamental issue with oracles arises.

A trusted, decentralized oracle could be the answer to the oracle problem.

What are Oracles: Decentralized Oracles

Although blockchain oracles have greatly aided and contributed to the tokenization of physical assets, the oracle problem limits their growth and applications. To fix this problem, oracles must be as reliable and safe as blockchain.

A decentralized oracle is the best way to solve this problem. Using a decentralized network of nodes, a decentralized oracle gets real-world data from sources outside of the blockchain and sends it to smart contracts on the blockchain.

These decentralized oracles are analogous to public libraries with multiple information sources. Using multiple sources of information reduces counterparty risk. One of the key advantages of decentralized oracles is that they address the issues of reliability and trust by implementing a system of penalties for oracles that provide inaccurate information.

What are Oracles?: Types of Blockchain Oracles

Blockchain oracles come in different shapes and sizes due to the extensive range of off-chain resources. Hybrid smart contracts need different kinds of data and computation from the outside world. They also need different ways to deliver information and different levels of security.

In general, each type of oracle involves some combination of getting data, validating it, doing calculations on it, and sending it somewhere.

Here are the main types of oracles:

Input Oracles

Input oracles collect data from the real world (off-chain) and deliver it to a blockchain network for smart contract consumption. Chainlink Price Feeds, which give DeFi smart contracts on-chain access to financial market data, are run by these oracles.

Output Oracles

Output oracles allow smart contracts to send commands to off-chain systems that cause them to perform specific actions. This can include telling a banking network to make a payment, telling a storage provider to save the provided data, or telling an IoT system to unlock a car door once the on-chain rental payment is received.

Cross-Chain Oracles

Cross-chain oracles can read and write data between different blockchains. They make it possible to move data and assets between blockchains. For example, you could use data from one blockchain to trigger an action on another, or you could connect assets from different blockchains so they can be used outside of the blockchain where they were issued.

Compute-Enabled Oracles

Compute-enabled oracles use secure off-chain computation to provide decentralized services that are impractical to do on-chain due to legal, technical, or financial constraints. They are a new type of oracle that is becoming more widely used by smart contract applications.

By using Chainlink Automation, smart contracts can be executed based on specific trigger events. Additionally, by incorporating zero-knowledge proofs, data can be kept confidential. Moreover, implementing a verifiable randomness function in smart contracts ensures that the source of randomness cannot be altered and can be demonstrated to be impartial.

What are Oracles?: Oracle Reputation Based on On-Chain Performance Data

When choosing an Oracle service provider, it is important to consider its reputation due to the multitude of services offered by Oracle. Users and developers can both evaluate different blockchain oracle systems based on what they think is important.

The reputation of a crypto oracle is reinforced by the fact that they sign and submit their data to a tamper-proof public blockchain ledger. This lets their past performance be evaluated and shown to users through easy-to-use dashboards like reputation.link and market.link.

Reputation frameworks offer transparency into the accuracy and reliability of each Oracle network and its node operators. This information gives users the power to choose the right crypto oracle for their smart contract needs.

Oracle service providers can also use their reputation in the business world outside of the blockchain to give users more confidence in their reliability.

What are Oracles?: Use Cases of Blockchain Oracle

Decentralized Finance

Oracles can retrieve financial data, like market prices for various assets, for use in DeFi smart contracts. They are used to compute the user's borrowing capacity and level of collateralization. AAVE, for example, uses price feed oracles to obtain asset prices for use in smart contracts.

Dynamic NFTs and Gaming

Oracles also allow non-financial use cases for smart contracts. Examples include dynamic NFTs that can change in appearance, value, or distribution based on external events such as the time of day or the weather.

Also, compute oracles are used to make randomness that can be checked. Projects then use this randomness to give NFTs random traits or to pick random winners in high-demand NFT drops.

On-chain gaming apps also use randomness that can be checked to make games more interesting and unpredictable. Examples include random loot boxes or random matchmaking during a tournament.

Insurance

Oracles can be used to obtain information such as weather forecasts and flight delays for use in insurance products. For instance, Ethersic offers flight delay and crop insurance. Oracle is used to obtain information about weather and flight status, which is then used for the validation of claim payments.

Enterprise

Enterprises can connect their backend systems to any blockchain network using cross-chain oracles, which provide secure blockchain middleware. So, enterprise systems can read and write to any blockchain and use complex logic to figure out how to deploy assets and data across chains and with counterparties using the same Oracle network.

Hence, institutions can quickly join blockchains that are popular with their partners and add support for smart contract services that their users want without having to spend time and development resources to integrate with each blockchain.

Sustainability

Hybrid smart contracts improve environmental sustainability by giving people better reasons to take part in green practices by using advanced verification techniques to find out what the real effects of green initiatives are.

Oracles are important tools that smart contracts use to get environmental data from sensor readings, satellite images, and advanced machine learning computations. Smart contracts can then reward people who plant trees or consume in a way that is good for the environment.

Oracles also support lots of new kinds of carbon credits that can help reduce the effects of climate change.

What are Oracles?: Advantages of Blockchain Oracles

Blockchain oracles provide numerous benefits regardless of how they are used. Here are a few of the main reasons why blockchain oracles are gaining popularity:

Oracles Boost Blockchain Functionality

The primary advantage of a blockchain oracle is that it connects the blockchain to the outside world. Blockchain oracles provide blockchains with the external data they require to perform more complex tasks.

Instead of being restricted to a single network, an oracle enables it to interact with external data. As a result, you can use blockchain for everyday activities such as buying, selling, investing, and betting.

All of this added functionality is the primary reason why so many people are beginning to use oracles. They make it simple to use blockchains for everything from retirement savings to developing NFTs and dApps.

They Offer Variable Parameters With a Plethora of Applications

Oracles are infinitely adaptable because they come in different styles. You can program a crypto oracle to do almost anything you want. An oracle can repeat itself or act once, depending on your needs. The crypto oracle can either passively report or take actions on the blockchain on your behalf.

This adaptability is a big reason why oracles are so popular. You can use them in different situations and easily customize them to meet your specific requirements.  Unlike many other blockchain tools, even the most detailed, specific oracle is relatively easy to set up.

They Save Time and Effort

Oracles have the significant advantage of not requiring you to manually make transactions on the blockchain. You can let crypto oracles handle things for you instead of sitting around and performing various tasks at the appropriate times.

Once configured, an oracle can execute smart contracts in response to an external trigger. They are thus essentially a form of automation. They can't handle complex, nuanced situations, but they can handle simple transactions without your constant supervision.

You can program a crypto oracle to buy tokens when a cryptocurrency falls below a certain price or instruct the blockchain to generate a new NFT for each user in a game.

What are Oracles?: Examples of Blockchain Oracle Projects

Blockchain oracles are a new idea, but they're already making waves. They have been involved in several exciting projects in the few years since their introduction.

Some top blockchain oracle projects include:

Augur

Augur is an Ethereum-based market prediction platform. It's essentially a decentralized betting platform that allows users to create markets for any idea. People can place bets on the concept and instantly receive money if they are correct.

Augur is often used to make political and sports predictions, and oracles make sure that users get their money on time.

Wrapped Bitcoin

Wrapped Bitcoin is an ERC-20 token that corresponds to bitcoin one-to-one. It works with Chainlink to audit its assets regularly, using an oracle to check BitGo custody wallets for WBTC tokens and then updating the chain if there are any deviations. This safeguards user funds and prevents depreciation.

API3

API3 is a DAO-governed project aimed at improving dApp development. It allows users to create APIs for dApps. These APIs (blockchain-based) are simpler to use and more cost-effective to scale.

API3 is a hugely influential project. Its trustless applications possess the capability to effectively engage with web-based APIs, enabling them to contribute to the advancement of a broad spectrum of Decentralized Finance (DeFi) projects.

Band Protocol

Band Protocol is a new platform focusing on cross-chain data integration. Oracles are used in the project to help bring external data to various blockchains. Its most intriguing feature is cross-chain connections, which use oracles to send data between different blockchains.

The Band Protocol has been particularly useful in the development of smartphone-based DeFi platforms.

Agoric

Agoric is an intriguing startup that piqued the interest of venture capitalists in late 2021. This blockchain is unique in that it incorporates JavaScript, one of the most important programming languages.

Agoric allows users to create JavaScript-based smart contracts for different flexible and accessible contracts.

Conclusion

In the rapidly expanding universe of blockchain and cryptocurrency, blockchain oracles have emerged as vital intermediaries bridging the gap between on-chain and off-chain worlds. They enable smart contracts—self-executing contracts with the terms of the agreement directly written into lines of code—to interact with data outside of the blockchain. This capacity to fetch external data is not merely a technical enhancement but a fundamental necessity for blockchain's wider applicability in various sectors from finance to sustainability.

The concept of an oracle extends beyond a mere data fetcher. They can be visualized as agents that authenticate, process, and transmit essential off-chain data to smart contracts. Their introduction has expanded blockchain's horizons from simple, static transactions to dynamic, variable-based transactions that can adapt to fluctuating external parameters, such as the real-time conversion rate of Ethereum.

However, the year 2023 brings with it a heightened understanding of the challenges faced by oracles. The principle of blockchain is founded upon decentralization and trust. In stark contrast, a centralized oracle becomes a single point of potential failure, and therefore, a point of vulnerability. Decentralized oracles have been posited as the solution, with their structure mimicking the blockchain's own, gathering data from multiple sources to minimize risks associated with single-point failures.

Another critical evolution in the realm of blockchain oracles is the diversity in types. Input oracles, output oracles, cross-chain oracles, and compute-enabled oracles are not just classifications but represent the expanding capabilities and applications of oracles. From triggering financial operations based on market data to enabling games with unpredictable outcomes, the use cases have multiplied manifold.

As with any technological advancement, the efficacy and reliability of oracles are of paramount importance. The introduction of oracle reputation systems, where past performances can be audited and analyzed, offers a layer of transparency and confidence for users and developers. In a world where trust is digitized and decentralized, such measures are invaluable.

Prominent projects like Augur, Wrapped Bitcoin, API3, Band Protocol, and Agoric further attest to the significance of oracles in the current blockchain ecosystem. Each, in its unique way, showcases how oracles can be tailored to serve specific purposes, be it market predictions, asset auditing, dApp development, or cross-chain data integrations.

Yet, as we embrace the plethora of opportunities oracles offer, we must also exercise caution. They bring along inherent risks. Being vigilant about the sources of our data, recognizing the vulnerabilities, and actively seeking decentralized solutions are steps in the right direction.

To encapsulate, oracles in 2023 are no longer an accessory to the blockchain but rather a necessity. Their continued evolution, coupled with an informed and cautious approach, promises a future where the chasm between the digital and the physical world seamlessly narrows.

What are Oracles?: FAQ

  • Oracles gather, verify, and transmit external data (i.e., data stored off-chain) to smart contracts running on the blockchain. Oracles can not only "pull" off-chain data and broadcast it on Ethereum, but they can also "push" information from the blockchain to external systems.

  • he Oracle software facilitates the retrieval of data from digital sources like servers, websites, and databases. On the other hand, hardware oracles extract data from the physical world. Oracle software can give you information about things like price changes, exchange rates, and flights in real-time.

  • Chainlink is by far the most popular name in the crypto oracle space. Chainlink (which was founded in 2017 by Sergey Nazarov) is the largest tokenized crypto oracle solution in terms of market capitalization. Chainlink is a multi-chain oracle network that provides reliable, tamper-proof inputs and outputs for smart contracts.

  • Yes, they are. Oracles are data feeds that bring data from off-chain data sources and place it on the blockchain (on-chain) for smart contracts to use. This is necessary because smart contracts on Ethereum can't access information outside of the blockchain network.