Blockchain oracles are third-party services that deliver smart contracts with external data. They aid as a bridge between blockchains and the outside world.
Blockchains and smart contracts can’t access off-chain data (outside the network). However, for many contractual arrangements, it is vital to have relevant data from the outside world to execute the agreement.
This is where blockchain oracles come into action, as they provide an association between off-chain and on-chain data. Oracles are vital for the blockchain ecosystem because they widen the scope of smart contracts. Without blockchain oracles, smart contracts would have minimal use as they would only access information within their networks.
It’s significant to note that a blockchain oracle is not the data source itself but rather the layer that queries, verifies, and validates external data sources and then relays that information. The data communicated by oracles comes in many forms — price information, the successful conclusion of a payment, or the measurement of temperature by a sensor.
Many types of oracles are available, and how a blockchain oracle functions depend entirely on what purpose it was designed for:
Types of Blockchain Oracles
Blockchain oracles can be segregated depending on their qualities:
- Source— does the information originate from software or hardware?
- The direction of information— is it inbound or outbound?
- Trust— is it centralized or decentralized?
A single oracle can stretch into many categories based on how they feed the data. Go through the list of eight different Oracle types below to understand better.
Software oracles
- Software oracles interact with online data sources and transmit them to the blockchain. This data can come from online databases, servers, websites – essentially, any data source on the Web.
- Software oracles connected to the Internet allow them to supply information to smart contracts and transmit it in real-time. This brands them one of the most common types of blockchain oracles. Examples of software oracles include exchange rates, digital asset prices, or real-time flight information.
Hardware oracles
- Hardware oracles those designed to get information from the physical world and present it to smart contracts. Such information could be transmitted from electronic sensors, barcode scanners, and other information-reading devices. Few smart contracts need to interface with the real world to get data.
- An example of this might be a sensor that checks if a truck carrying goods has reached a loading bay. If it does, it relays the data to a smart contract that can then perform decisions based on it.
Inbound and outbound oracles
- Inbound oracles transmit data from external sources to smart contracts, while outbound oracles send information from smart contracts to the external world.
- An excellent example of an inbound oracle would be a sensor measuring the temperature and sharing the update to a smart contract. An example of an outbound oracle might be a smart lock – Post the addition of funds to an address, the smart contract sends the info through an outbound oracle to a mechanism that opens the smart lock.
Centralized and decentralized oracles
- A centralized oracle is managed by an individual entity and is the sole data provider for the smart contract. Using only one source of data can be risky – the efficiency of the contract depends entirely on the entity regulating the oracle. Also, any malicious intrusion from a bad actor will directly impact the smart contract. The main problem with centralized oracles is a single point of failure, which makes the contracts less resilient to vulnerabilities and attacks.
- Decentralized oracles share the same purposes as public blockchains – avoiding counterparty risk. They increase the consistency of the information provided to smart contracts by not trusting a single source of truth. The smart contract queries multiple oracles to govern the validity and accuracy of the information, and this is another reason decentralized oracles can also be represented as consensus oracles.
Contract-specific oracles
- A contract-specific oracle is intended to be used by a single smart contract. This means that if one wants to implement multiple smart contracts, a proportionate number of contract-specific oracles have to be established.
- This type of oracle is observed as very time-consuming and expensive to maintain. Companies that want to extract data from various sources may find this approach unreasonable. On the other hand, contract-specific oracles can be developed from scratch to serve a specific use case, where developers will have the flexibility to tailor them as they see fit.
Human oracles
- Individuals with particular knowledge in a specific field can also serve as oracles. They can research and validate the authenticity of the data from various sources and translate that information to smart contracts. Since human oracles can confirm their identity by employing cryptography, the possibility of an impostor faking their identity and sharing corrupted data is relatively low.
Challenges in Oracles
Since smart contracts perform decisions based on data provided by oracles, they are critical to a healthy blockchain ecosystem. The primary challenge with designing oracles is that if the oracle is compromised, the smart contract relying on it is also compromised. Often this is referred to as “The Oracle Problem.”
Since oracles are not part of the leading blockchain consensus, they are regrettably not part of the security mechanisms that public blockchains can offer. The trust struggle between third-party oracles and the trust-less execution of smart contracts remains a primarily unresolved issue.
Man-in-the-middle attacks can also be a risk, where a malicious bad actor gains access to the information flow between the oracles and the contract and modifies or falsifies the data.
A reliable mechanism that enables the communication between smart contracts and the external world is vital to the global adoption of blockchains. Without blockchain oracles, smart contracts would rely only on information already within their networks, considerably limiting their capabilities.
Decentralized oracles have the potential to maintain safeguard mechanisms that could remove a lot of systemic risk from the blockchain ecosystem. Blockchain oracles remain one of the vital building blocks to be implemented in a secure, reliable, and trust-less manner for the blockchain ecosystem to grow.
About the Author:
Vinoth Venkatesan
Vinoth is a cybersecurity professional by heart with over two decades of experience in Information Technology and Cybersecurity. He is an Australian Computer Society (ACS) Senior Certified Professional in Cybersecurity and holds various industry-leading cybersecurity credentials. Vinoth loves to write about the latest cybersecurity happenings and blockchain-related articles.