Web3 Oracles

1 year ago By Okpala Oluchukwu

image description


What are web3 Oracles?

Oracles in context to web3, refer to data feeds that bring data from off-the-blockchain data sources and deploy it on the blockchain for smart contracts to use. Oracles act as intermediaries between the world outside the blockchain and the blockchain itself. With Oracles, the exchange of information between these two spaces is made possible.

Oracles are necessary because smart contracts running on some blockchains can not access information stored outside the blockchain network. Enabling smart contracts to execute using off-chain data inputs extends decentralized apps’ value.

For instance, suppose Jade bets 10 ETH on who will be the next Nigerian president, the prediction-dapp will require an oracle to confirm election results and determine if Jade is eligible for a payout.

To do this, oracles will have to verify and validate these data before uploading and storing it on the blockchain. Consequently, reliable sources of information are a necessity for oracles.

Furthermore, besides just pulling off-chain data and broadcasting it on Ethereum, oracles can also push information from the blockchain to external systems. An example could be an oracle that unlocks a smart lock once the user sends the fee via an Ethereum transaction.

We can now see that oracles are very essential to the blockchain as they are even able to trigger functions of smart contracts using off-chain data. They act as a source of external information for smart contracts on the network.

The Oracle problem

As we should be well informed about how the blockchain network works by now, it would be safe to say that the blockchain is built on the accuracy and transparency of transactions between parties. Information and transactions between users have to be true, precise, and transparent to avoid discrepancies on the network.

That being said, enabling oracles to provide information to the blockchain could pose certain threats to the network. How can we be sure the information provided is valid and up to date? How can we be assured that the information will be available and updated regularly?

Different oracles differ in their patterns and types and thus, differ in means of solving The oracle problem. We will discuss this in more detail below.

Oracle Design Patterns

Oracles supply information using various patterns. These patterns include immediate-read, publish-subscribe, and request-response.

Immediate-read: This works by storing data in the connected smart contract. It provides real-time information such as fluctuations in stock prices, weather information, or even scores in a football game.

Publish-subscribe: This oracle pattern works by allowing dApps to subscribe to specific data sources, and receive updates when new data is published. The dApp can specify the type of data it is interested in and the frequency of updates and the oracles will send the data to the dApp as it becomes available. An example is an oracle that provides information on the latest ETH-USD price to users.

Request-response: This oracle pattern works by allowing dApps to request specific data from the oracle, specifying the type of data it needs, and the oracle returns the requested data. These request-response oracles are ideal in cases where the dataset is too large to be stored on the smart contract’s storage( as smart contracts can’t store a large amount of data) or the user only needs a small part of the data.

Types of Oracles

  1. Centralized Oracles:

A centralized oracle is an oracle that is controlled by a single entity. This single entity is responsible for updating and delivering off-chain information to the blockchain. Centralized oracles are therefore preferable in cases where proprietary datasets are published directly by the owner with a widely accepted signature. However, they have been criticized for certain reasons:

Single point of failure: As the centralized oracle is controlled by a single entity, this means that if that single entity fails, the entire system can fail too. This creates a potential for censorship or manipulation of the data being fed into the blockchain.

Availability: Centralized oracles can’t always be trusted to make off-chain data available to smart contracts when needed. If the entity decides to turn off operations, the connected smart contracts would be at risk.

Incentive misalignment: Centralized oracles are typically motivated by profit, which can lead to incentive misalignment with the users of decentralized applications. For instance, a centralized oracle may prioritize its own interest over the accuracy of the data it provides.

Issue of Correctness: With only one point of data supply, there is no way to confirm if the data being provided is correct or not. Even if the provided is a recognized one, there are still chances of misinformation.

2. Decentralized Oracles:

A decentralized oracle is a type of oracle that operates in a trustless and decentralized manner, allowing for data to be transferred from the off-chain world to the blockchain without relying on a single entity. Decentralized oracles overcome the limitations of centralized oracles. In a decentralized oracle network, data is provided by multiple nodes, which can be incentivized through token rewards or other mechanisms to provide accurate, trustworthy data.

This means that to ensure even more accurate data, decentralized oracles employ certain mechanisms to arrive at a specific result since multiple sources provide off-chain data. An example of this mechanism is the voting or staking mechanism.

Voting or staking: Some decentralized oracles require participants to vote or stake on the accuracy of answers to data queries using the network’s native token. For instance, if a contract needed the off-chain data of the current US president, nodes will stream in their answers and these answers would pass through votes to be decided. The answer will be decided by the majority of votes or stakes.

Some benefits of the decentralized oracles include:

  1. Trustlessness: Decentralized oracles rely on a network of nodes, eliminating the need for a single trusted source and making the data more trustworthy and transparent.
  2. Security: With multiple nodes providing data, the risk of a single point of failure is reduced, making the information more secure.
  3. Censorship resistance: Decentralized oracles are not controlled by a single entity making it difficult for any one party to censor the information being transferred to the blockchain.
  4. Availability: As various nodes are providing the off-chain data to the blockchain, data can always be available when needed.
  5. Tamper-proof: As the information provided by decentralized oracles is stored on the blockchain, it can not be easily altered or tampered with.

Applications of Web3 Oracles

  1. DeFi: During financial transactions on the network, financial information such as the price of tokens, exchange rates, market values, and so on are needed for the effectiveness of the transaction.
  2. Identification: Oracles can be used to verify and update a user's identity from off-chain sources.
  3. Generating outcomes for events: Events that take place outside the blockchain can be administered on the blockchain with the aid of oracles. For example; The results of the Nigerian election Jade initially placed a bet on.

In conclusion, Oracles are vital for expanding the functions of the blockchain and expanding the information accessible on the blockchain. Already existing blockchain oracles include Chainlink, Witnet, DIA e.t.c

Share :
Read Next :