They act as a gateway to the external world
The term oracle originated from the Greeks, and it refers to someone who has mystical abilities to look into past, present, future and has answers to all questions of time and beyond.
Smart contracts are purposely isolated from the outside data. Sometimes blockchains, which do not interact with external data sources, may need off-chain data to execute transactions based on contractual agreements. However the network cannot access the data outside of it.
This is where blockchain oracles come in. They act as a gateway to the external world by integrating on-chain information requirement with off-chain data sources. Oracles connect the blockchain and smart contracts with external networks. Oracles fetch the data required by the smart contract.
The data can be of many forms like insurance conditions, price information, payment status or employee attendance records.
Blockchain oracles are third party entities that connect a blockchain network to the external systems, thereby enabling smart contracts to execute actions based upon inputs and outputs from the real world. Oracles lay a system for decentralized ecosystem to access available data sources outside of the chain. They transmit data from the external world to the blockchain network.
Essentially, blockchain oracles do not store the data themselves. Instead they are a layer that request and validate external data and its sources and then pass that information on the blockchain.
Once the oracle network reaches a consensus it is transmitted to the smart contract that called the data and the smart contract executes its conditions and transactions then get recorded on the blockchain.
Therefore oracles have emerged as a reliable and safe way to source data off the chain onto the blockchain.
To understand blockchain oracles better let’s consider an example where Amish imports clothes from Brian. They both agree on terms of this trade which is that Amish will pay a certain amount to Brian once he receives the clothes and after being assured of quality standards.
Once they lock their funds in a smart contract, the transaction will take place that is Brian will be paid only if the trade conditions are met.
Meanwhile, smart contracts do not have the external data of trade outcome results stored on the chain, which is why it must rely on the outside data which decentralized oracles provide. In our case the oracle then verifies from a trusted API whether to execute the transaction and send the locked in funds to Brian.
Now since the information conveyed by oracles to the blockchain determines the outcomes, the oracle mechanism should be extremely credible if the contract is to take place exactly as expected.
Chainlink is the most popular decentralized oracle network.
The Oracle Problem
Major reason for existence and popularity of blockchains comes from its decentralization feature. Which is why, blockchains are purposely isolated from the world beyond its network and are governed by the rules determined by the code. But sometimes smart contracts need outside information to execute the code, that’s where oracle comes into the picture.
However, this also leads to the oracle dilemma. The problem of authenticity of the data inbound onto the blockchain. In many cases it has been observed that authenticity of smart contracts had been compromised due to oracles being tampered with, outdated, or hacked. Bitcoin, since it does not access any information outside its blockchain and execute smart contracts does not face the problem of authenticating external data.
Types of Oracles
Various types of blockchain oracles are in existence today depending upon the blockchains requirements like payment mechanism, execution, etc. Major categories of oracles are as follows: Hardware oracle, software oracles and human oracles.
These are connected to the internet and use online resources and transmit the information extracted, to the blockchain. This data can be any data from the web — ranging from online encyclopedias, databases, and websites. Since software oracles are connected to the internet there is no information lag and blockchain receive accurate information real-time.
Some blockchains and smart contracts may require information that is not available online and must be extracted physically. Such information could be from barcode scanners, digital thermometers and many information reading devices. Hardware oracles translates real life values into digitally readable values.
A contract specific oracle is intended as a single smart contract — which means if one wants multiple smart contracts then an equivalent number of oracles must be established.
Individuals with expertise in a certain field can also serve as information oracles. They are used for verifying information which can later be used for executing transactions.
Input oracles are the most widely used oracles today. They offer secure off-chain computation by taking off chain data from the real world and providing it to the chain for meeting smart contract requirements. Input oracles are used majorly by Chainlink for price feeds and it also provides DeFi smart contracts with financial market data.
On the other hand, unlike input oracles, output oracles send instructions to the data outside the chain which then prompts the network to take actions as per the conditions. For example, making a payment if conditions are met.
Another type of oracles are cross chain oracles that have access to data across multiple blockchains. It allows inter-operability for moving information and assets amongst different blockchains.
Compute-enabled-oracles are fairly new type of oracles. Their purpose is a lot more than delivering external data to the blockchain, and these oracles can execute trust-minimized computation on behalf of smart contracts off-chain.
To conclude, smart contracts and traditional information disseminators have immense potential of coming together and forming the future framework of data driven automation by uniting their expertise to solve the blockchain oracle problem.
Oracles cannot be completely isolated from the world and are important if smart contracts are to achieve greater penetration across markets and multiple use cases.
For more such knowledge bytes please explore the various courses offered by 3.0 University.