So what is a blockchain oracle?
In order for a blockchain to be truly autonomous, it must have access to all the information it needs to function. This is where oracles come in. Oracles are devices or entities that connect a deterministic blockchain with off-chain data. They act as a bridge between the two worlds, inputting every piece of data through an external transaction. By doing this, we can be sure that the blockchain contains all the information it needs to verify itself. In this blog post, we will explore what oracles are and how they work.
Oracles have been around since the early days of blockchain. The first oracle, Bitcoin Oracle, was created in 2010. Since then, oracles have been used to provide smart contracts with data about everything from weather patterns to stock prices. Oracles are an essential part of any blockchain network that wants to interact with the outside world.
What are the different types of blockchain oracles?
There are two types of oracles: off-chain and on-chain. Off-chain oracles are third-party services that provide smart contracts with external data. They are not part of the blockchain network and they do not have access to the blockchain’s transaction history. On-chain oracles, on the other hand, are entities that are part of the blockchain network. They have access to the blockchain’s transaction history and can be used to verify on-chain data.
Off-chain Oracles
The most popular type of off-chain oracle is the centralized oracle. Centralized oracles are provided by a single entity, such as a company or organization. They are responsible for maintaining the accuracy of the data and they have complete control over it. The main advantage of using a centralized oracle is that it is more efficient than an on-chain oracle. Centralized oracles can also be used to provide data to multiple smart contracts at the same time. The downside of using a centralized oracle is that it is less secure than an on-chain oracle.
On-chain Oracles
Decentralized oracles are provided by a network of nodes, each of which is responsible for verifying a piece of data. This type of oracle is more secure than a centralized oracle because it is not controlled by a single entity.
Lets explore some of the decentralized oracles
Chainlink
The most popular type of on-chain oracle is the Chainlink network. Chainlink is a decentralized network of nodes that provides data to smart contracts. The Chainlink network is powered by the LINK token, which is used to pay node operators for their services.
The Chainlink network has a reputation system that is used to ensure that node operators are providing accurate data. Node operators with a high reputation are more likely to be chosen to provide data to a smart contract.
The Chainlink network is also highly scalable. It can handle millions of requests per day and it can be used by any blockchain that supports smart contracts
Witnet
Witnet is a decentralized oracle network that is powered by the Wit token. Witnet is used to provide data to smart contracts, and it is also used to create decentralized applications (dapps).
Witnet is a reputation-based decentralized oracle network. Nodes that run the Witnet software earn or lose reputation when they correctly or incorrectly fulfill a data request, with correctness defined by a consensus algorithm that analyzes node responses. nodes who disagree with the majority are penalized (by going offline or attempting to be malevolent), and their reputation is divided among the honest nodes. If the agreement is set to timeout, it will not be punished as long as at least one node adheres to it.
Witnesses (oracles), are chosen at random by the Witnet protocol to mine and satisfy data requests based on their reputation score. Witnesses that are good will increase in reputation points and be more likely to be picked for jobs, resulting in tokens being awarded upon completion.
The Band Protocol
The Band Protocol is a cross-chain oracle network that allows decentralized apps (dApps) to link price and event data, allowing the decentralized and real worlds to interact. Despite being a year younger than Chainlink, Band has garnered a great deal of attention since its debut in 2018 and is widely considered to be the most serious competitor.
The Band Protocol is a decentralized oracle network that allows dApps to access data from multiple data sources. Data sources can be either on-chain or off-chain. Band differs from Chainlink in this regard, allowing dApps to access data via smart contract data points rather than external oracles.
Band also offers “community-curated” data sources that allow dApp operators to participate in the management and curation of data feeds to solve the oracle problem and provide smart contracts with reliable data feeds.
The Band Protocol is powered by the BAND token, which is used to pay node operators for their services. The BAND token is also used to stake data sources. Data providers that stake their data sources are more likely to have their data included in the Band Protocol.
Example of a blockchain oracle
Let’s say we have a smart contract that releases funds based on which basketball team won the game. Participants agree on terms and send their funds to smart contract, betting on their team. Since there is no way for a smart contract to interact with external data it has to depend on some other trusted source, oracles.
After game is over Oracle will query trusted API to find who won and then send that data to smart contract. This way contract can release funds to a winning party.
If we want to make this system even more trustless we can have multiple Oracles, each querying different API. In that case smart contract will compare results and release funds only if there is enough consensus between them. This way even if one Oracle is compromised, attacker would need to compromise multiple Oracles in order to manipulate results.
Blockchain oracles can be used in many other ways, not just for sports betting.
They can be used to track shipment of goods, update weather conditions or anything else that needs interaction with data from outside world.
Oracles are an essential part of blockchain ecosystem and allow us to build trustless applications.
The Oracle Problem
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.
Oracles are not part of the foundation blockchain’s consensus, which is a major drawback. They are, unfortunately, not included in the security mechanisms that public blockchains may provide due to their non-participation in the primary blockchain consensus. The inference of third-party oracles and smart contracts’ trustless execution remains an issue that has yet to be fully resolved in the blockchain space.
One way to solve the Oracle Problem is to use multiple Oracles, each with its own data source. The smart contract can then compare the data from the different Oracles and only execute if there is enough consensus between them. This solution is not perfect, but it is a step in the right direction.
Another way to solve the Oracle Problem is to use on-chain Oracles. On-chain Oracles are entities that are part of the blockchain network. They have access to the blockchain’s transaction history and can be used to verify on-chain data. This solution is more secure than using off-chain Oracles because it is not controlled by a single entity.
The Oracle Problem is an important challenge that needs to be addressed in order to build trustless applications on blockchain. While there are some possible solutions, the best solution has yet to be found.
Closing thoughts
One of the most important aspects of a blockchain oracle is its ability to provide reliable data. This is because smart contracts rely on external data in order to function properly. Without reliable data, smart contracts would be limited in their capabilities.
One of the key elements needed in order for the blockchain ecosystem to develop securely, dependably, and trustlessly is for oracles to be implemented in a secure and reliable manner.
Related Posts