The Ultimate Guide to Blockchain Oracles
Ultimate Guide to Blockchain Oracles
- Blockchain Oracles lets smart contracts talk to systems that aren’t on the blockchain so that the terms of the contract can be carried out.
- Oracles on the blockchain are important because smart contracts that live on blockchains can’t get to data that isn’t on the blockchain.
- The value of decentralized applications goes up when smart contracts can work with off-chain data feeds (dApps).
- The oracle problem is the worry that comes from having a system that is not centralized depending on a system that is.
The word “oracle” comes from the Greek language and means a person who can talk to the gods and see the future. People in the past didn’t know much about what was going on now or what would happen in the future. So, they turned to oracles to learn things they couldn’t figure out on their own. In the world of blockchain, oracles act as bridges between blockchains and the outside world.
What is a Blockchain Oracle?
A blockchain oracle is a data feed that gets data from other blockchains and the outside world, checks it, and sends it to smart contracts that live on the blockchain. An oracle can get data from systems outside of the blockchain and send it to the blockchain. It can also send data from the blockchain to other systems. For example, when a user makes a payment through a blockchain transaction, an oracle opens a smart lock.
As was already said, oracles act as bridges that connect off-chain/external data providers to on-chain systems like smart contracts. This makes smart contracts work in a wider range of situations. In other words, without blockchain oracles, smart contracts would only be able to use data that is already on the blockchain. An oracle provides a way for trusted external data to trigger the functions of a smart contract.
Keep in mind that a blockchain oracle is not the source of the data. Instead, it is the system that queries, confirms, and verifies data sources that are not part of the blockchain. This information is then sent to a blockchain network. The data that is sent can be about the prices and exchange rates of assets, natural disasters, risk measurements, statistics, dynamic data (data that changes over time), political activities, games, geolocation and tracking data, events in other blockchains, etc.
How Do Blockchain Oracles Work?
In general, an oracle is made up of a smart contract that works on-chain and some things that work off-chain. Other on-chain applications send requests for data to the contract, which then sends them to the off-chain part (known as an oracle). The oracle node can query data sources, mostly through Application Programming Interfaces (APIs), send the information it gets, and store it on the blockchain.
Here’s how a blockchain oracle works as an example:
Let’s say Alice and Bob bet on who will be president of the US in 2024. Alice is sure that the Republican candidate will win, but Bob is sure that the Democrat will win. They made clear rules for the bet and locked in their stakes with a smart contract. Once the results of the 2024 election are known, the smart contract will give the money to the winner.
Remember that smart people don’t know what’s going on off-chain, which in this case is the outcome of the US presidential election in 2024. When the time limit is up or the election is over, the oracle asks a trusted API who won and sends that information to the blockchain. The information is then used by the smart contract to send the money to the winner.
If the oracle didn’t ask for and send the information on-chain, there would be no free and fair way to settle the bet.
Why Are Blockchain Oracles Important?
Most people who use cryptocurrencies think of smart contracts as lines of code that run at certain addresses on the blockchain. These “smart contracts” are computer programs that can automatically carry out agreements between parties when certain conditions are met. This is why they are called “smart contracts.”
But it’s hard to figure out how to use smart contracts to carry out agreements between parties in deterministic systems like the blockchain. In a static state and with a certain input, a deterministic system always gives the expected results. There is no difference between the outputs and inputs. To make sure execution is predictable, blockchains only need to agree on a simple yes/no questions based on data that is already in their ledger. Here are some examples of binary questions:
- “Did the wallet’s owner, discoverable through the public key, use the correct private key to sign off on this transaction?”
- “Is there enough cash in this wallet to make a deal?”
- Is the agreement final concerning this smart contract?
If blockchains got information from systems outside of the blockchain, determinism would be hard. As the off-chain data may change often, this makes it harder for nodes to agree on whether changes to the blockchain’s state are real or not. For example, think about a smart contract that does a transaction based on the current BTC-USDT exchange rate, which it gets from a standard price API. The number would probably change a lot, and there is also a chance that the API could be hacked or broken. This means that different outputs would come from nodes that ran the same contract code.
Determinism is an important part of any public blockchain, which has many nodes all over the world. Since there is no central authority that acts as a true source, we expect that the duplicate transactions on the nodes will lead to the same results. If node A runs a smart contract code and gets the output “4”, but node B runs the same code and gets the output “10,” this would break the consensus and value of the blockchain as a distributed computing system.
The above example also shows the problem with letting blockchains get information from sources outside of the blockchain. Oracles solve this problem by “pulling” information from outside sources and sending it to blockchains so that smart contracts can use it. Since on-chain data can’t be changed and is available to everyone, blockchain nodes can use off-chain data securely to make changes without breaking consensus.
The Blockchain Oracle Problem
The blockchain oracle problem is about putting information from outside a blockchain. It’s important to make sure this information is correct because if it’s not, smart contracts will use wrong inputs to make wrong results. Since smart contract transactions can’t be undone, we need to make sure that the oracle input is correct. Imagine if a mistake caused a smart contract to send a $100 million bet to the wrong winner. That will be a disaster since the smart contract can’t be changed and the users’ names are kept secret.
The other problem is that oracles, especially those that are centralized, can be a single point of failure that can be hacked or manipulated. This could make smart contracts not work right, which could lead to unintended results. When people use oracles, they have to trust that the oracle is giving them accurate information, which can be a problem.
But there are ways to solve the problem of the blockchain oracle. One uses more than one oracle to get the same information, which makes it more likely that the information is correct. The second option is to use decentralized oracles to make sure that data can’t be changed. As more people use blockchain technology, new ways to solve the blockchain oracle problem will likely be found.
Types of Blockchain Oracles
Oracles can be put into two main groups: those that are centralized and those that are not. Let’s talk about each one separately, including their pros and cons.
A centralized oracle is a system that a blockchain network can use to get all of the data or information it needs from a single source. The oracle is a link between the blockchain and the outside world. It gives information to smart contracts on the blockchain when they need it.
A centralized oracle usually runs on a server or set of servers and is run by a single organization or entity. Its job is to get data from different outside sources, such as APIs and web scraping, format the data, and send it to the blockchain. A good example of a centralized oracle is Provable.
Advantages of Blockchain Oracles
1). Faster data retrieval
Oracles that are centralized can quickly get data from trusted sources by using special methods.
2). Greater control
With a centralized oracle, one organization is in charge of the data that goes into the smart contract. This gives the sourced data more credibility (especially when the entity is highly trusted).
Centralized oracles are good for large-scale applications because they can handle a lot of requests.
Disadvantages of Blockchain Oracles
1). Single point of failure
Since one person or group controls a centralized oracle, it can become a single point of failure for the whole system.
2). Lack of transparency
The information given by a centralized oracle may need to be completely open, which makes it hard for users to check that the information is correct.
3). Centralized control
The centralized control of the oracle makes it very easy to censor, which goes against the idea that smart contracts should be decentralized.
A decentralized oracle is a way for smart contracts on a blockchain to get secure access to data from outside the blockchain. It works by using a network of nodes to collect and check data from outside sources and then using a consensus mechanism to agree on how accurate that data is.
Examples of Decentralized Blockchain Oracles
By market cap, Chainlink is the largest decentralized blockchain oracle. It is built on Ethereum and gets data from different sources, like APIs, through a decentralized network of independent nodes. Then, to make sure the data is correct and reliable, it uses a reputation system and a consensus mechanism. The data is then used by smart contracts on the blockchain to carry out the terms of the contract.
By market capitalization, Band Protocol is the second-largest decentralized blockchain oracle. It is built on Cosmos and has cross-chain features. It uses a decentralized oracle network to get data from different providers and delegated proof-of-stake (DPoS) to make sure the data is correct. The data are used by the oracle contract to carry out the terms of the contract.
Advantages of Blockchain Oracles
1) . No single point of failure
Since it is not run by a single entity, a decentralized oracle is less likely to be hacked or shut down.
Before being sent to and stored on a blockchain, transactions on a decentralized oracle are written down on a public ledger.
3). Censorship resistance
A decentralized oracle is hard to censor because it is not run by a central authority.
The data on a decentralized oracle is protected by cryptography, which makes it impossible to change.
Disadvantages of Blockchain Oracles
Setting up and running decentralized oracles can be harder than setting up and running centralized oracles.
Because they use a network of nodes that are spread out, decentralized oracles may not be as scalable as centralized oracles.
Oracles on the blockchain help smart contracts do more by giving them access to resources that aren’t on the blockchain. These resources are important for making hybrid smart contract applications that are useful and better. Like how the internet completely changed how people shared information, oracle-based smart contracts are changing how people exchange value and carry out automated contracts.
Do you have questions about how to find your ideal niche? Let us know in the comments below!
If you liked this information about The Ultimate Guide to Blockchain Oracles, be sure to follow us on Facebook, Pinterest, Quora, Reddit, and Instagram! And don’t forget to subscribe to our newsletter
More Useful Resources: Elon Musk supports Bitcoin And Dogecoin?