And what is the oracle problem?
What is an oracle?
One of the definitions of an oracle is “A person or thing regarded as an infallible authority or guide on something.”
In a town, a man walks his dog at 9:00 AM every morning. No matter what. His dog-walking schedule is so consistent that the townspeople rely on it to know what time it is in the morning. If the man is walking his dog, it must be 9:00 AM!
This man, whether he knows it or not, is an oracle.
How reliable is this man as an oracle? What if he gets sick, the dog runs away, or it rains? These could all interrupt his schedule and no longer make him a source of truth for when 9:00 AM is.
Background on oracles
The idea of oracles originated in ancient times with Greek mythology. An oracle was a being who would act as a bridge from the people to the gods, and would share knowledge of the future. The act of receiving this information is also known as divination.
Though various different methods were adopted for divination, the idea of an oracle has remained the same.
Vocabulary.com states that “In modern usage, any good source of information can be called an oracle.”
The [Blockchain] Oracle Problem
The blockchain is a wonderful tool for keeping track of everything happening within its network. That said, blockchains require a method of verifying data that doesn’t originate from themselves.
How does a blockchain know the price of a token? How does a blockchain know the results of the presidential election? How does the blockchain know what color the sky is?
The blockchain needs a source of truth — an oracle.
Why does the blockchain need to know the answer to these questions in the first place?
A smart contract needs to know the answers to questions so it knows what to do next. A prediction market contract needs accurate results so it knows who to reward. A lending contract needs the latest price of a token so it can request and return the proper amount.
Why not use a reliable outside source for all these questions?
This is the whole problem. What would a reliable source look like? It would be likely that this is a centralized outside source, and proving the reliability and perpetual accuracy of this source would become problematic.
How can we solve the oracle problem?
There are a few teams trying to solve this.
Augur is one of the bigger players in this space working on an oracle for their prediction markets. Augur allows users to vote on what the true result of a scenario is, and dispute that result if they believe it’s incorrect. This would be crowd-sourcing results and is a democratic way of finding the truth.
Another solution is Chainlink, which is a project that is creating a decentralized oracle network. This oracle network allows smart contracts to access off-chain data feeds. These data feeds can be separate blockchains or standard data feeds like web APIs. An example of this is if the stock market had its own blockchain — other blockchains would access its data via Chainlink and use it as an oracle.
Having an oracle is step one. Step two is making sure that oracle is reliable and secure.
While every oracle is a source of truth, that truth may not always be the real truth.
There have been a handful of incidents of oracle exploitation, resulting in loss.
Synthetix had an incident where their oracle reported a price for the Korean won that was 1000x what it should have been. A trading bot detected this pricing error, took advantage, and made trades that resulted in 1000x profit. That bot profited over $1 billion in less than an hour.
Another oracle-related incident occurred recently with bZx, a protocol that allows users to engage in margin trading through a product called Fulcrum. Simple enough, but Fulcrum needs an oracle to know how to price things. For this, they used Kyber. Kyber is a trading platform and should have accurate, up-to-date prices, but Kyber is a smaller trading platform that doesn’t have a lot of liquidity, relative to various centralized exchanges.
A clever user exploited this for profit.
Long story short, this user took out an ETH loan, deposited some of it into Fulcrum, and used the rest to buy up all the orders for a stablecoin on Kyber. This inflated the price of that stablecoin on Kyber to $2 instead of $1. Since Fulcrum uses Kyber as it’s oracle, Fulcrum now thinks that this stablecoin is worth twice as much as it should be. The user withdrew their initial deposit of ETH from Fulcrum that was now worth 2x what it was before, paid back the loan, and profited around $600k.
The bZx team is no longer using Kyber as its oracle and is moving toward Chainlink.
The future of oracles
While the idea of an oracle has been around for centuries, oracles in the blockchain space are still young. There are bound to be problems with them, but we’ll learn as these problems come to light. One day, after enough lessons, we’ll have solid oracles.
It’s hard to say what oracles will look like in the future; it’d be nice if we had an oracle to tell us.
Some of these articles go much deeper into the complexities of oracles and the oracle problem.