A blockchain oracle is responsible for sending external data to a blockchain. Essentially, they bring data from the real world and give it to the blockchain to utilize. Oracles fulfill this need because blockchains only have access to data that happens on their network. By expanding the amount of data blockchains have access to, it can significantly increase the number of capabilities of the applications that run on it.
Oracles are extremely beneficial for smart contracts because they are the basis for Dapps and have many potential use cases that couldn’t occur without the use of real-world data. An oracle isn’t the source of the data but it instead acts as a messenger, by relaying information from other sources and confirming the information is correct before sending it to its desired destination on the blockchain. It is important this information is correct, otherwise the oracle would be feeding incorrect information, which can be extremely problematic.
Blockchain Oracle example
Let’s say you wanted to bet on the winner of a football match with your friend. You could create a smart contract with the odds and both you and your friend lock your desired bet into the smart contract with a payout for the winning person. But the smart contract won’t know the winner because it isn’t able to access this data. After all, it doesn’t run natively on the blockchain. Here, an oracle would query its trusted source for the information of the winning football team, verify the information is correct, then feed it back to the smart contract. Now that the smart contract has access to the result of the football match, it can payout the winner accordingly.
Let’s look at another example. A farmer depends on the weather for their crops to grow well, and to make money from those crops. Insurance companies can provide protection to farms, however, farmers can be limited with their choices of only local providers which may give them an unfair deal. The farmer could instead enter into a smart contract with an online insurance company where the criteria are based on the amount of rainfall in the region. By using an oracle, the smart contract can receive accurate rainfall data from national weather bodies, and use it to provide coverage based on the amount of rainfall in the region. Below you can see a visual representation of a smart contract, powered by Chainlink, that demonstrates this example.
Crypto Trading Bot | Best 16 Bitcoin Trading Bots [Free & Paid]
Best crypto trading bots for Binance, Coinbase, Kucoin, and other crypto exchanges in 2021. Quadency, Bitsgap…
The different types of oracles
A software oracle is an oracle that pulls data that originates from online sources. This could include information like weather, crypto prices, or even flight schedules. Since software oracles are connected to the internet, they can feed information in real-time. Because this allows them to provide information that constantly updates as necessary, they are the most common type of oracle used by blockchains.
A hardware oracle is an oracle that pulls data from a physical device in the real world. This could include devices like a photocopier or a barcode scanner. For example, a supply chain may be responsible for packing and shipping boxes of electronic parts. At the end of the packaging line, someone may scan the box to mark it’s been packaged. A smart contract can be created where the oracle feeds it information about boxes that have been scanned, which the smart contract can make decisions based on.
Inbound and outbound oracles
Inbound and outbound refer to which way the information is being sent. If an oracle is sending information to a smart contract, then it is inbound. If an oracle is sending information from a smart contract to an external source, then it is outbound. An inbound oracle might supply information to a smart contract about the winner of a football match. An outbound oracle might use a method to unlock a smart contract and send the payout of a bet to the winner’s address.
Centralized and decentralized oracles
A centralized and decentralized oracle refers to the control structure of an oracle. If an oracle is centralized, its information is coming from a single entity and can be considered a single point of failure. There is a risk in using a centralized oracle because if that single entity were to fail then the oracle would be unable to function properly. This single point of failure also poses a security risk because only one entity needs to be attacked for the oracle to be rendered useless.
A decentralized oracle has multiple entities that it uses to provide information. In this instance, the oracle has multiple points of failure and can be considered more trustworthy from an information and security standpoint. Moreover, a smart contract could also utilize multiple oracles to achieve consensus for the necessary information, similar to how blockchains need consensus to confirm transactions — this is an example of consensus-based oracles.
The oracle problem
Since oracles act as the middleman between blockchains and external information, there is an underlying problem that faces them from achieving widespread adoption. Blockchains can’t pull data from external sources so they require oracles to fulfill that. If an oracle is compromised, then this also compromises the smart contract. This is the oracle problem. For the oracle to be trustworthy for a blockchain it needs to be secure from attacks, decentralized to reduce the concentration of failure and provide correct data.
Chainlink is currently the largest and most used blockchain oracle. It is a decentralized oracle network that provides external data for smart contracts. Chainlink uses a network of nodes, rather than a single node, to provide data. Data is supplied and validated by multiple different sources which allows Chainlink to achieve a high degree of security and reliability for their data. Below you can see a basic layout of how Chainlink operates with smart contracts.
With a centralized oracle, there is only one node that is responsible for the process that Chainlink provides with a decentralized network of nodes.
Features of Chainlink
Open source technology allows it to be audited and verified by anyone, similar to a public blockchain. This can increase confidence for users because they have access to view how its operations are coded, or even submit improvements.
With no single point of failure, it increases the security and reliability of the network and the information Chainlink oracles provide.
Nodes sign the data they provide to smart contracts so the nodes can have their performance measured and quality tested. This enables improvements to be made to increase the performance of individual nodes which lift the whole network.
Agreements between the smart contract and oracle are made that outline the rewards or penalties that will be handed out based on their performance.
Join Coinmonks Telegram Channel and learn about crypto trading and investing
- What is Margin Trading | Dollar-Cost Averaging
- BigONE Exchange Review | Grid Trading Bot
- 3Commas Review | Pionex Review | Coinrule review
- Ledger vs Ngrave | Ledger nano s vs x | Binance Review
- Bybit Exchange Review | Bityard Review | CoinSpot Review
- 3Commas vs Cryptohopper | Earn crypto interest
- The Best Bitcoin Hardware wallet | BitBox02 Review
- BlockFi vs Celsius | Hodlnaut Review | KuCoin Review
- Bitsgap review | Quadency Review | Bitbns Review
- Crypto Copy Trading Platforms | Coinmama Review