Oracles allow the decentralized Web3 ecosystem access to existing data sources and legacy systems. They also enable advanced computations. The creation of hybrid smart contracts is possible thanks to decentralized Oracle networks (DONs). This allows for the combination of on-chain code with off-chain infrastructure to support advanced, decentralized applications (dApps) that respond to real-world events and interact with existing systems.
Let’s say Alice and Bob wish to place a wager on the outcome of a sporting match. Alice places $20 on team A, while Bob places $20 on team B. The $40 total is held in escrow by smart contracts. How does the smart contract decide whether to release funds to Alice and Bob after the game is over? It requires an oracle mechanism that can fetch exact match outcomes off-chain and then deliver them to the blockchain in a safe and reliable way.
How it solves the Oracle Problem?
The Blockchain Oracle Problem highlights a fundamental limitation to smart contracts: they cannot inherently interact and exchange data with systems or systems outside of their native blockchain environment. External resources are considered “off-chain,” whereas data stored on the blockchain’s blockchain is considered to be on-chain. Blockchains are purposely isolated from other systems to gain their most valuable properties, such as strong consensus on user transaction validity, prevention of double spending attacks, mitigation of network downtime, and strong consensus about the validity of all transactions. To securely interoperate with other systems using a blockchain, you need an additional piece of infrastructure called an “oracle.” This is used to connect the two environments.
The oracle problem must be solved because most smart contracts, such as DeFi, require knowledge of real-world data. Oracles allow for the expansion of the kinds of digital agreements blockchains can support. They provide a universal gateway to off-chain resources and preserve the security properties of blockchains. Combining oracles with smart contracts can benefit major industries, including asset prices, weather information for insurers, randomness for games, IoT sensors to supply chains, government ID verification, and more.
The outcome of smart contracts is directly determined by the data sent to blockchains by oracles. Therefore, it is crucial that the oracle mechanism works correctly if an agreement is to be executed as planned.
Decentralized Oracles
A blockchain oracle mechanism that uses a centralized entity for data delivery to a smart contract introduces a single point of failure, negating the purpose of a decentralized Blockchain application. The smart contract won’t have the required data to execute if the one oracle is offline.
Worse, if one oracle is corrupted, then data on-chain could be extremely incorrect, which can lead to smart contracts with very bad outcomes. This is often referred to as “garbage out, garbage in” because bad inputs can lead to poor outputs. A smart contract outcome based on faulty cannot be reversed because they are immutable and automated, also allowing for permanent loss of user funds. Smart contract applications cannot use centralized oracles.
To truly overcome the Oracle problem, decentralized oracles are required to stop data manipulation, inaccuracy, and downtime. A decentralized Oracle Network (or DON) is a network that combines multiple independent operators and reliable data sources to achieve end-to-end centralization.
Different types of Blockchain Oracles
Due to the wide variety of off-chain resources, there are many types and sizes of blockchain oracles. Hybrid smart contracts require different types of computation and external data. They also need different delivery mechanisms and levels of security. Each type of Oracle involves a combination of fetching and validating, computing upon, and delivering data to a destination.
Input Oracles
An “input oracle” is the most well-known type of oracle. It fetches data off-chain and transfers it onto a blockchain network for smart-contract consumption. They provide DeFi smart contract access to financial market data.
Output Oracles
Output oracles, which are the opposite of input oracles, allow smart contracts send commands to offchain systems to trigger them to perform certain actions. This could include telling a bank network to make a payment or telling a storage provider that the data is stored. Or pinging an IoT device to unlock the car’s door after the on-chain rental payment has been made.
Cross-Chain Oracles
Cross-chain oracles are another type of oracle that can read and write between different blockchains. Cross-chain oracles allow interoperability to move data and assets across blockchains. For example, cross-chain oracles can use data from one blockchain to trigger another action or bridge assets across-chain so that they can be used on any other blockchain.
Compute-Enabled Oracles
Smart contract applications are increasingly using “compute-enabled Oracles,” which make use of secure off-chain computing to provide decentralized services that are impossible to do on-chain.Â
Use cases of Blockchain Oracle
Oracles are used by smart contract developers to create more advanced, decentralized applications for a wider variety of blockchain use cases. There are many possibilities. Below are the most popular use cases.
Decentralized Finance (DeFi)
Large parts of the Decentralized Finance (DeFi), ecosystem require oracles for financial data access to assets and markets. Decentralized money markets use price oracles to assess users’ borrowing capacities and determine if they are liquidated. Similar to synthetic asset platforms, price oracles are used to assign tokens’ value to real-world assets. Automated Market Makers (AMMs), use price oracles in order to concentrate liquidity at the current price to increase capital efficiency.
Gaming and Dynamic NFTs
Oracles allow non-financial uses of smart contracts, such as dynamic NFTS–Non-Fungible Tokens, which can change in appearance and value based on external factors like weather or time of day. Compute oracles can also be used to generate verifiable randomness, which projects use to assign random traits to NFTs and to select lucky winners in high-demand NFT drops. On-chain gaming apps also use verifiable randomness to provide more exciting and unpredictable gameplay experiences, such as random loot boxes appearing or random matchmaking during tournaments.
Insurance
Insurance smart contract uses input oracles for verifying the occurrences of insurable incidents during claims processing. This opens up access to physical sensors and web APIs as well as satellite imagery and legal data. Output oracles are also able to provide smart insurance contracts that allow for payouts using traditional payment networks or other blockchains.
Enterprise
Cross-chain Oracles provide enterprises with a secure blockchain middleware that allows for them to connect to any blockchain network. Enterprise systems are able to read/write to any Blockchain and can perform complex logic about how assets and data should be distributed across multiple chains as well as with counterparts using the same oracle network. This allows institutions to join high-demand blockchains and create support for smart contracts desired by their users quickly without spending time or development resources to integrate with each one.
Sustainability
Hybrid smart contracts are improving environmental sustainability by providing better incentives for green practices. Advanced verification techniques allow them to verify the true impact of green initiatives. Oracles are essential in supplying smart contract data from sensor readings and satellite imagery. Advanced ML computations then allow smart contracts that can dispense rewards for people who reforest or engage in conscious consumption. Oracles also support many new forms of carbon credits to offset the effects of climate change.
Conclusion
Oracles expand the capabilities of blockchain networks, providing access to all external resources necessary to harness advanced hybrid smart contract use case beyond tokenization. Just like the Internet revolutionized the information exchange, Oracle-powered hybrid smart contract are changing the way society enforces and exchanges value.