and their use cases
The Ethereum blockchain and most blockchains are deterministic. This means that if we were to re-mint the blocks the result would remain the same. If you include non-deterministic actions, there is a high chance that the source is hacked or simply broken and the result of the blocks will be different.
This is why oracles are services that provide contracts with external information. They serve as a bridge between the blockchain and the outside world
Blockchain oracles, allow smart contracts to execute based on real world variables.
Oracles enable the decentralized Web 3.0 ecosystem to access existing data sources. Decentralized oracle networks (DONs) enable the creation of hybrid SCs, where code is on the blockchain and off-chain infrastructure are combined to interact with dApps that react to real world events. The best known are Chain Link, Band, or Kylin Network which is coming to Polkadot.
The oracle problem:
The oracle problem is the combination of these two elements:
- Blockchains alone cannot access external data.
- Using centralized oracles is a major security risk.
The oracle problem highlights a limitation to smart contracts: they cannot interact with data and systems existing outside of their respective blockchain. Resources external to the blockchain are considered “off-chain”, while data already stored on the blockchain is considered “on-chain”.
It is because of this valuable isolation that blockchains have their main advantages, security enhanced by the prevention of double-spending attacks. The double spending is a type of attack that would allow to use the same cryptos several times, spending them several times, for which various protection mechanisms have been put in place including the validation system Proof Of Stake(Pos). The isolation of blockchain and its decentralization also allows the mitigation of network downtime thanks to a high number of validators.
Interoperability with off-chain systems and data from a blockchain requires an additional element, called an “oracle”, to bridge the two environments.
Since the data provided by oracles to blockchains directly determines the outcomes of smart contracts, it is critically important that the oracle mechanism is correct if the agreement is to execute exactly as intended.
Centralized and decentralized Oracles:
A centralized oracle is controlled by a single entity and is the sole provider of information for the smart contract. Using a single source of information can be risky and the outputs of the contract depend entirely on the entity that controls the oracle. The main problem with centralized oracles is the existence of a single point of failure, which is a point in a computer system on which the rest of the system depends and on which a failure results in the complete shutdown of the system. This makes contracts less resistant to vulnerabilities and attacks.
Decentralized oracles increase the reliability of information provided to smart contracts by relying on multiple sources of truth. Smart contracts will query multiple oracles to determine the validity and accuracy of the data which is why decentralized oracles can also be called consensus oracles.
While decentralized oracles aim to achieve the state of “trustlessness”, a trustless system means that the participants involved do not need to know or trust each other for the system to work. In a trustless environment, there is no single entity with authority over the system, and consensus is reached without the participants having to trust anything other than the system itself.
It is important to note that, like trustless blockchains, decentralized oracles do not eliminate trust altogether, but distribute it among many participants.
II/ What are the different types of blockchain oracles?
Blockchain oracles can be classified according to a number of different qualities:
1/Does the data source come from software or hardware?
2/Input or output?
3/Is the data centralized or decentralized?
The same oracle can belong to several categories. For example, an oracle that sources information from a company’s Web site is a centralized inbound software oracle.
Software and hardware oracles:
Software oracles interact with online sources of information and feed them to the blockchain. This information can come from online databases, servers, websites essentially, any data source on the web.
The fact that software oracles are connected to the Internet allows them to not only provide information to smart contracts, but also to transmit that information in real time. This makes them one of the most common types of blockchain oracles.
Some smart contracts need information from the real world, hardware oracles are designed to get this information and make it available to them. This information can be relayed by electronic sensors, barcode scanners, and other information reading devices.
A hardware oracle essentially “translates” real-world events into numerical values that can be understood by smart contracts.
To learn more about the different use cases I suggest you read the Binance academy article below.
Incoming and outgoing oracles:
Incoming and outgoing oracles:
Incoming oracles transmit information from external sources like the one that indicates the temperature measured by a sensor. The opposite are “outbound oracles”, which allow smart contracts to send commands to off-chain systems to perform certain actions. This could be informing a banking network to make a payment, or sending a message to a system to unlock a car door once the on-chain rental payment is made.
Cross-chain oracles are a newer type of oracle that can read and write information between different blockchains. Cross-chain oracles allow interoperability for moving data and assets between blockchains, such as using data from one blockchain to trigger an action on another or bridging cross-chain assets so they can be used outside of the native blockchain on which they were issued.
III/ Oracle Blockchain Use Cases
Developers use oracles to build more advanced decentralized Dapp applications with a wide range of use cases. While there are a potentially infinite number of possibilities, here are some of the most commonly adopted cases.
Decentralized Finance (DeFi)
Much of the decentralized finance (DeFi) ecosystem requires oracles to access crypto asset data. For example, lending and borrowing platforms use price oracles to determine users’ borrowing capacity and check whether positions are undercollateralized and subject to liquidation.
NFTs and GameFi
Oracles provide uses for dynamic non-fungible tokens (NFTs), whose appearance, value, or distribution can change based on external events such as time of day or weather. Computational oracles are also used to generate a verifiable randomness that projects then use to assign random features to NFTs. On-chain gaming applications also use randomness for random loot or random match making during a tournament.
Insurance smart contracts use input oracles to verify the occurrence of events that are insured during claims processing. Output oracles can also provide insurance contracts with a way to make payments on claims.
Oracles extend the capabilities of blockchains by providing access to all the resources needed to exploit external data and have hybrid smart contracts that go beyond simple tokenization. With these tools, blockchains can exploit external data and communicate with the real world, including insurance or on-chain auto part tracking.
With the use of oracles and the randomness they bring, blockchain is still expanding its field of application, what will be next?
We would like to thank @0xbakebot for his quality article that you can find here in French