What is a blockchain oracle?

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.

Credit to Chainlink

The different types of oracles

Software 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.

Hardware oracles

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.

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

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.

Features of Chainlink

Open source

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.

Decentralization

With no single point of failure, it increases the security and reliability of the network and the information Chainlink oracles provide.

Data signing

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.

Service agreements

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

Also, Read

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store