What are Oracles and Why Do Smart Contracts Need Them?

Beginner’s Guide / 14.06.2020

What is an Oracle?

“An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions or precognition of the future, inspired by the gods” – this is the literal definition of an oracle. When moving to the world of Software, the word keeps much of what they used to mean, with a few tweaks here and there.

Leaving aside predictions and Godly figures, Oracles are, in a strict software sense, external data feeds used by software engineers and developers to embed applications that collect real-time data. Oracles are entirely based on the needs of the application. An Oracle is usually a third-party service that responds to queries and answers questions. It is in essence, a data provider.
In common practice, the data provided by Oracles is manually and periodically updated by a third party, who is trusted to provide true and fair information. Oracles retrieve and verify external data for all forms of applications and software, through methods such as web APIs or market data feeds.

Say Yahoo Finance needs to show the price of Gold at a particular time. Its back end API is assigned an oracle service, to which it will contact and receive the current price. Big enterprises and data providers like Yahoo Finance, Facebook, Google, etc., cannot depend on just one oracle for propagating information as it might be prone to manipulation. In such cases, a consensus-based oracle is used, which takes in information from numerous sources and projects the mean of all.

Where do Oracles Fit in on the Blockchain?

Blockchain oracles are third-party services that provide smart contracts with external information. They serve as bridges between blockchains and the outside world. Blockchains and smart contracts cannot access off-chain data (data that is outside of the network). However, for many contractual agreements, it is vital to have relevant information from the outside world to execute certain agreements.
This is where blockchain oracles come into play, as they provide a link between off-chain and on-chain data. Oracles are vital within the blockchain ecosystem because they broaden the scope in which smart contracts can operate. Without blockchain oracles, smart contracts would have very limited use as they would only have access to data from within their networks.

Smart Contracts and Their Reliance on Oracles

Ever since the advent of Ethereum, Smart Contracts are the buzz within the community. Hundreds, if not thousands, of prospective use cases, have been developed, some even finding their usefulness in real-world use cases. IBM, Microsoft, and Ethereum, among others, have already successfully developed applications that rely heavily on Smart Contracts.

Smart Contracts by themselves are just pieces of code that bind two or more parties together in a virtual agreement. The agreement that binds the parties may be simple or could have clauses that involve third party reliance. There may be contracts that need data fed to them to make the necessary decisions. This is where a Blockchain, and Smart Contracts specifically, stretch out a hand into the outside world. Oracles solve the problem of third party reliance.

The reliance is justified because Smart Contracts are the first usable and scalable medium on the internet that can execute pre-specified arrangements without the fear of hindrance. Meaning, one can make a smart contract and have it executed on a blockchain with full confidence that it will be fulfilled, given the conditions are met, and no party will be able to hinder its outcome.

But, as the saying goes, every cloud has a silver lining, people often forget that a silver lining has a cloud in return. Smart Contracts, on paper, seem to be the ultimate solution to the immutable agreement problem on the internet, but when trying to develop one faces difficulties that could not have been foreseen.

Is Third-Party Reliance Justified on a Blockchain?

Since smart contracts execute decisions based on data provided by oracles, they are key to a healthy blockchain ecosystem. The main challenge with designing oracles is that if the oracle is compromised, the smart contract relying on it is also compromised. This is often referred to as The Oracle Problem.

For Smart Contract to rightly execute as per the agreement, they have to rely on outside information providers, which in most cases are oracles. For instance, say I get into a bet with my friend that my favorite team is going to win the world cup and he says otherwise. We decide to enforce the same on a smart contract and tag it on a particular blockchain, ensuring the execution.

Since a Smart Contract is not Smart, it has to rely on information provided by other entities to execute itself. Considering the locked amount in a Smart Contract is sufficiently large enough to motivate either party to hinder with the outcome, one of us can manipulate the Oracle provider to propagate wrong information, thus profiting without actually fulfilling the agreement. Oracles, being outside the blockchain are subject to the influence, just like any centralized entity.

Oracles are not part of the main blockchain consensus, they are unfortunately not part of the security mechanisms that public blockchains can provide. The trust conflict between third-party oracles and the trustless execution of smart contracts remains a mostly unsolved issue.

And thus, the debate arises: what can be done to solve the censorship problem? Is it still legit to call a blockchain immutable and censorship-resistant, when something as novel as oracles can be manipulated to change the outcome? What can be done to bridge the gap between the virtual immutability of the blockchain and the apparent problem of information propagating Oracles?

The Concept of Decentralized Oracles, i.e., Oracles that are consensus-based, is often thrown around as a possible solution to the infamous Oracle Problem. Projects like Chainlink are spearheading this idea by developing tools that allows you to distribute trust among oracles. We will look further into the concept in the future.

avatar
Sudarshan M is a long time crypto-enthusiast. Pulled in by bitcoin early on, it did not take long for Sudarshan to divert all of his academic attention from business studies to blockchain by doing his Masters and eventually pursuing his PhD in the subject.