The Concept of Blockchain Oracles
Table of contents
In this article, you would get to learn about web3.0 oracles; their relation to off-chain data computation and on-chain data computation, the different types of oracles, and their use cases as well.
What is a Blockchain Oracle?
An Oracle is an entity that acts as a middle layer to connect a blockchain network(s) to real-life data.
In much simpler terms, an oracle is a bridge that helps send off-chain data to a blockchain network for necessary transactions through smart contracts and Vice Versa.
Examples of these transactions include; getting the real-life price data feed of a particular stock in the NYSE and tracking a real-life scenario for verification on a blockchain network.
Let's say, the price index for a New York stock just increased and a transaction was required to be carried out when the price index pumps, due to the smart contracts which blockchain oracles work with, the real-life data is sent straight to the blockchain network and the aim of establishing the oracle is accomplished.
Therefore, an Oracle is an intermediate between blockchain networks to retrieve real-life data.
Why Blockchain Oracles?
This is where the "Oracle Problem" comes in. Since blockchain networks are highly deterministic, they can only fetch data and make interactions with the data transmitted within as they are not able to send any data out or even in.
Let's say Mr. A sends $100 worth of Ethereum for Mr. B, the processes required to take place would be one(1) validation, and secondly the signing process of the transaction by Mr.A, and confirmation by Mr. B.
With all these processes, the blockchain network can only read the on-chain data interactions taking place on the network at that specific time before storing the data.
Therefore, interactions outside the blockchain cannot be read. Although the interoperability of blockchains has been solved but the issue of interoperability lies between two or more blockchains but the interoperability between blockchains and real life cannot be possible with two blockchains without an Oracle.
With blockchain oracles, off-chain data can be fetched through smart contracts to enhance the communication between these off-chain protocols and on-chain protocols.
Examples of these off-chain data protocols are:
Data Providers
Web API's
Payment Systems
IoT devices
Cloud Providers etc.
How Blockchain Oracles Work.
Blockchain Oracles are set-up such in a way that a part of the oracles retrieves information from on-chain components(which are the contract part of a blockchain) while the second half retrieves information from the off-chain component(these off-chain parts are known as oracle nodes) which would be needed for specific interaction with the blockchain.
Therefore a certain oracle has two different parts for interaction:
1. The On-chain component known as Oracle Contract and;
2. The Off-chain component known as Oracle Nodes.
These Oracle Contracts are responsible for relaying/sending data queries to the Oracle nodes directly from other contracts.
Therefore before data is relayed to the Oracle nodes, a log event would be sent to the Oracle nodes. These log event contains the data requested from the oracle nodes which would be sent back through smart contract calls to the blockchain.
When once the log event is relayed to the Oracle Nodes, it then extracts information from external sources such as Web APIs, IoT providers, and any protocol required to extract information.
Reading the details of the log event, actions such as validation, submission of data, or any request contained in the log events are then achieved.
Types of Oracles.
It's fun to know that web3 oracles as the name implies are definitely decentralized. But this doesn't make it the only set of oracles. Other oracles may be centralized.
Although there is a stronger adoption of decentralized oracles compared to centralized oracles due to the downsides these centralized oracles may bring such as poor availability, poor incentives, and low trust in the system which makes the centralized oracles liable to be hijacked by scammers.
This makes the adoption of decentralized oracles stronger as in terms of poor incentivization, these oracles nodes can simply sign transactions rather than paying the oracles. This brings less trust as the urge to manipulate data may come in.
Moving into the last section of this article,
The Use Cases of Blockchain Oracles.
Decentralized Oracles can be used for various applications, ranging from;
Retrieving Financial Data: Just like the example given in the first section of this article, before the price of the NYSE stock can be signaled by the blockchain, it has to be automated by a smart contract and this is thus the responsibility of the Oracle Contracts to trigger the Orcacle nodes and hence the oracle node verify the details.
Verifying Events: This also has to do with more verification of real-life cases, just like the first example covers but in this case, let's say for blockchain games that try to adopt the style of traditional games and would create a means for P2P transactions, Oracles would be used to verify that these individuals send Fiat and as well know it's the corresponding price so as to enable the purchase of gaming tools.
There are more use cases that the world of Oracles brings. Protocols such as Chainlink, ParaLink, and Tellor can be integrated into Ethereum Dapps for usage.
Any issues you need to be cleared about? Feel Free to leave a comment or you can reach out to me on Twitter.
Subscribe to my newsletter
Read articles from Tim.0x directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Tim.0x
Tim.0x
I am a technical writer with 2years of experience in the blockchain industry. I write whitepapers for Web3 protocols and I have contributed to Ethereum.org through website translation for global language adoption for blockchain