Blockchain oracles - what are they, how do they work and why are they needed?
Blockchain oracles are services that take data from the real world, process it, and send it to a smart contract. They have become key tools in the DeFi world and a bridge between crypto and the rest of the world. In this article, we will explain to you what an oracle is, why such technology is needed, and whether all oracles are secure. So, here we go!
What are blockchain oracles and why are they needed?
First, it is important to understand why oracles appeared and what problems they are supposed to solve.
Oracles are computer programs that link data from outside the blockchain to the blockchain world (the onchain).
Blockchain technology is very useful. But it can be compared to a computer without internet access. Blockchain stores data on the network, but it cannot process external information. For a long time we had the problem of compatibility between different blockchains. Now with the advent of smart contracts and WEB 3.0, blockchain is evolving into a large-scale and transparent technology that has no boundaries.
Now let's remember what smart contracts are. They are computer programs that operate on a blockchain protocol, automatically executing predetermined actions when specified conditions are met. All actions in smart contracts are traceable and cannot be undone. Smart contracts are executed without the involvement of a third party. They can be made up to fulfill almost any contract.
For example, if you buy a house for cryptocurrency, you can make a simple smart contract to sell. It would look something like this: if person A sends the required amount to person B, the title deed will be transferred from person B to person A.
When the conditions of the smart contract are fulfilled, it is irreversibly executed according to the programmed rules. This eliminates the involvement of third parties or intermediaries.
But for smart contracts to have any real-world application, they must take information from the real world. In the example of a transaction involving the purchase of a house, a notarial deed or an insurance company might be required. Because blockchains operate autonomously, they do not have access to that information. This is where oracles come into play.
Oracles offer a way for a blockchain or smart contract to interact with external data. They act as an API for the world outside the blockchain.
There are many instances where third-party information needs to be transferred to a closed blockchain system. Especially when smart contracts involve real events. Cryptocurrencies can search, verify and authenticate external information and then transfer it to the closed system. This authenticated data is then used to verify the smart contract. To understand exactly how oracles work, here's another example.
Dave and Rob have a bet about who will win the Champions League final. Dave is sure that it will be Real Madrid and Rob is willing to bet on Barcelona. They make a bet, agree on the amount they will win, and sign a contract. Dave and Rob lock up their money in a smart contract. It will give the prize to the winner based on the result of the match. But how will the smart contract know who won the final match? It is the oracle that will give it that information.
The oracle will ask the trusted APIs to figure out which team won and send the information to the smart contract. The contract will then award a prize to Dave or Rob, depending on the result of the match. If not for the oracle, the smart contract would not be able to determine who won.
Types of oracles
Blockchain oracles come in different types: inbound and outbound; software and hardware; human and digital; centralized and decentralized.
Let's get into the details.
- Inbound Oracles. Oracles communicate with blockchains in one of two ways: they can send data to or from the network. Inbound oracles are used much more frequently. They send real-world event data to the blockchain. Almost any kind of information can be imported - the current price of an asset, the weather, legal documents, statistical data, etc.
An example of using incoming oracles: ‘if an asset reaches price X, a buy order will be placed’.
- Outbound oracles. As you understood, an outbound oracle informs the outside world what happened in the blockchain. For example, a smart contract can be programmed to open a smart lock in a real hotel room if the company receives a payment in cryptocurrency to a specified address. This type of scenario can be used by hoteliers.
- Software oracles. Such services process information from digital sources. For example, data from websites or servers.
- Hardware oracles. Hardware oracles transfer data from the real world. So, they can synchronize with motion sensors, cameras, thermometers, barcode scanners, smart scales, and so on.
- Human and digital oracles. Usually oracles interact with programs and databases. But a real person can also give information and then transform it into a smart contract.
Centralized Oracles and Their Risks
Centralized Oracles are controlled by a single provider-owner. He will be the sole provider of information for the smart contract. And then there is the issue of trust from the parties to the contract.
In a centralized system, we have a single point of failure, which in theory threatens the security of the smart contract. After all, if the oracle falls into the hands of a fraudster, the smart contract is also at risk. As we mentioned earlier, the accuracy and efficiency of smart contracts depends largely on the quality of the data they provide.
Smart contracts were originally invented to eliminate the risk of intermediaries and third-party control. Oracles allow parties to enter into contracts without an intermediary. But if the developer company controls a large share of the market, the oracle itself becomes an intermediary. This is the fundamental problem with centralization. It cannot provide adequate security and integrity.
Decentralized Oracle Network (DON)
Decentralized oracles distribute trust among many network participants. They use dozens of different data sources and are not controlled by a single organization. Therefore, these oracles provide greater reliability and integrity.
The most popular blockchain projects operate as decentralized oracles:
- Chainlink is a decentralized oracle network that delivers real data to smart contracts. It brings together independent oracle node operators and trusted data providers. This is how we get end-to-end decentralization. That is, Chainlink is not essentially a single system. It simply connects the major public and private environments into a single structure. It can be compared to a public library. Native LINK tokens are used to pay for services on the network.
- Band Protocol is a blockchain oracle that is needed to manage and enforce data integrity.
The company's website says the protocol can solve the problem by "creating a decentralized bridge that enables secure communication between smart contracts and the traditional network."
The Band protocol runs on a delegated proof-of-stake (dPoS) consensus algorithm. It was originally developed from the Ethereum blockchain, but switched to Cosmos in 2020 and created its own blockchain (Band-Chain). Its simpler and more efficient form made it a potential competitor to many oracles.
- Augur is a decentralized prediction platform that allows traders of any experience to speculate on predicting sets of future events.
The concept is simple: for a correct prediction, the trader receives a monetary reward; for an incorrect prediction, he loses money.
- MakerDAO is an Ethereum-based smart contract platform that allows the issuance of DAI Stablecoin against crypto-assets. The name of the platform comes from the term market maker.
Most Oracles are built on the Ethereum network, but what if in the future they start using other networks for their work more. As an option, it could be the Aptos network, which plans to become the most secure and scalable Tier 1 blockchain.
This would allow for even greater speed and security for Oracles, which is important when they are used by a large number of applications and users.
The Aptos team consists of former Meta employees and has raised $200 million to build a scalable blockchain for "billions" of people.
Aptos builds on the open source technology originally created for the Meta-backed Diem project, such as the Move programming language at its core.
Aptos has entered into a partnership with Pontem in which Pontem will develop products on Aptos' open-source blockchain. Pontem will work with Aptos to prioritize the development vector of dApps deployed exclusively on the Aptos blockchain, with technical support from the Aptos team.
Pontem is an Aptos Product Studio that develops Pontem Wallet, liquidswap.com and more.
Aptos is a very fast (over 100,000 operations per second) and scalable smart contract platform that can be used to create various dApps (DEX, wallets, games, etc.), which is what Pontem does.
Examples of Oracle Uses
Oracles in the blockchain ecosystem solve different tasks. Here are the most prominent examples of use cases:
- DeFi. The combination of smart contracts and finance has ushered in the era of decentralized finance (DeFi). These products need to connect to accurate data sources (e.g., monitoring prices or trading volumes). That's the task oracles are taking on.
- Insurance. Insurance products can be purchased through oracle, and claims can be paid. Fraud is known to be the biggest problem in insurance. This problem can be solved through blockchain decentralization and reliable oracles. Services capture surveillance footage and satellite imagery, transmit legal information, and record the terms and order of payments under the insurance contract.
- Logistics. Oracles can replace the usual centralized GPS systems in logistics. They automatically transmit delivery and payment data from counterparties, check documents, track shipments, and more.
- Maintaining Stablecoin. MakerDAO's DAI token uses a network of multiple oracles to constantly monitor the Ethereum price. Why? The protocol must continuously monitor the exact price of ETH in order to maintain rate stability. Depending on the data presented, MakerDAO consolidates or liquidates its security.
- Dynamic NFTs. Oracle forecasters have discovered a new kind of dynamic NFT. Such tokens can change their appearance depending on different factors (e.g. time of day or weather). Computational oracles help projects assign randomized attributes to art tokens or select random winners in airdrop.
- Blockchain games. Mathematical oracles make gameplay more unpredictable. For example, they are responsible for randomly dropping lootboxes or picking contestants.
Oracles remain one of the key building blocks for the new WEB3 era. They need to be implemented safely and thoughtfully so that the entire blockchain ecosystem can grow freely.
Oracles: pros and cons
Let's imagine this situation. Some oracle or unscrupulous company was supplying fake data, but they were exposed. Then society faces a dilemma: do a hard fork and go back to the point in the blockchain where the fake data was fixed, or leave things as they are? In fact, both options are not ideal. After all, they would destroy trust in the system.
Nevertheless, the importance of oracles in smart contract technology is enormous. Without them, decentralized applications (dApps) cannot be developed. They are directly dependent on external data outside the blockchain.
Oracles serve as a bridge between smart contracts and the outside world, enriching and evolving the technology. This is why they are an integral part of the WEB3 industry.