Originally published in the NOWNodes blog.
Each ecosystem has three main components, and in the absence of one of them, it ceases to function. Any infrastructure consists of users (customers or consumers), the system itself, and the personnel who maintain and maintain it. If you remove even one link from this chain, the system will stop.
Imagine a situation when you are in a foreign country and want to visit local attractions. You are a tourist, i.e. a user. A city is an ecosystem. But in order to fully use it, you need a guide and translator who understands your language. The guide serves as a bridge between tourists and urban infrastructure. Oracles are such a bridge for blockchain. In this article, we will talk about what blockchain oracles are and why they are needed in the DeF and Web3i ecosystem.
Blockchain oracles are the same translators and guides that link data sources from the outside world (the Internet) and the blockchain. Oracles accept information from various sources and convert it into a language that is understandable for smart contracts-programs that independently process transactions on the blockchain. In other words, oracles serve the entire Web3 ecosystem.
Among the data received by the oracles, there may be such as the current network state or the current cryptocurrency exchange rate. Smart contracts use this data in accordance with the rules laid down in the source code, and then broadcast to users and control transactions based on them.
Without oracles, blockchain and smart contracts would not be able to access data from the outside world, since it is not embedded in their protocols. Oracles significantly expand the scope of smart contracts due to the fact that they can work with data outside of the blockchain.
Oracles can not only accept data from external off-chain sources, but also send it back. The functionality of oracles is determined by developers depending on the purpose of their use.
Depending on the principle of operation there are several types of oracles:
Human oracles are people who manually verify data and send it to a smart contract;
Incoming or outgoing oracles are those that either transmit information to smart contracts or to external sources from smart contracts. Oracles can also be hybrid.
Contract oracles — designed for one specific smart contract. Such oracles cannot be used for other smart contracts. This may be due to the mechanism of individual smart contracts.
Centralized or decentralized oracles — run by a single company or community. Everything is clear here: decentralized oracles eliminate the risk of third-party interference.
There are many ways to use oracles. Previously, the functions of smart contracts were limited. The program tracked and controlled the fulfilment of the transaction conditions only within the blockchain. For example, when purchasing tokens, the seller must ensure their delivery. If one of the users does not fulfil them, the transaction will not be completed, and the reserved coins will be sent back to the owners.
But what if you need to perform verification from other sources outside of the blockchain? And here oracles come to the rescue, which provide compatibility of on-chain data from Web3 and the regular Web.
Let’s imagine a situation where two players are arguing about what rate Ethereum will reach by the end of 2020. Player A bets that the cryptocurrency will grow to $1000, and player B-that it will fall to $200. They place a bet and fix the deal using a smart contract. However, the smart contract could not obtain data about the rate.
Then the oracles intervene, which receive data about the cryptocurrency exchange rate via the exchange platform API or via a service for monitoring rates in real-time. The smart contract receives data, compares it with players ‘ forecasts, and transfers coins to the winner who was closest to the correct answer.
By the way, the reliability of cryptocurrency quotes is another problem that can be solved with the help of oracles. If the players’ forecasts are close to each other, the result may be erroneous, since the rates on different platforms differ.
To solve this problem, the Chainlink blockchain was developed, which consists of a decentralized network of oracles. Oracles get data from various sources and compare them with each other. Only then is the information sent to the smart contract. In this way, smart contracts get more reliable and accurate information than when working with a separate Oracle. In addition, this approach eliminates any manipulation of data.
But this global problem is not the only one. Oracles act as intermediaries between users and smart contracts, so the final result depends on the reliability of the Oracle data. If it is compromised, the smart contract will also execute an incorrect transaction. The Chainlink solution eliminates dependence on one particular Oracle, promoting decentralization.
Another striking example of using oracles is Provable. The platform provides ready-made Oracle-based solutions for developers of decentralized applications (dApps). Provable allows you to integrate solutions such as a blockchain-based GCH for gambling, a reliable data provider, and a military-level Provable security module for the most important processes. The Provable blockchain allows you to make sure that the data is received in its original form and has not been modified.
Blockchain oracles increase the scalability of the blockchain ecosystem by merging it with the outside world and increasing data transparency. This mechanism favourably contributes to the mass implementation of decentralized solutions in traditional systems. The oracles built an unbreakable bridge between the on-chain and off-chain ecosystem and established compatibility between them.