nav-close
float feedback icon livechat
banner of the news detail

Crypto basics: Oracles

BY LAWRENCE J. | Updated June 13, 2024

image of the news' author

Financial Analyst/Content Writer, RADEX MARKETS Lawrence J. came from a strong technical and engineering background before pivoting into a more financial role later on in his career. Always interested in international finance, Lawrence is experienced in both traditional markets as well as the emerging crypto markets. He now serves as the financial writer for RADEX MARKETS. read more
SHARE instagram icon share link icon

In our article covering the blockchain, we went over the advantages of such a technology, the salient point being the ability to send money from one person to another without having to rely on a centralised and censorable system. In our article covering smart contracts, we developed the concept further, explaining how this technology could be used to construct much more elaborate tools. Instead of merely transferring funds between wallets, smart contracts could allow people to do all sorts of interesting things with their money. Trading digital assets, borrowing and lending funds, buying and selling derivative and insurance products, using a savings account and earning interest were now just as feasible as in the real world, with the added benefits of distributed ledger technology. The emergence of a new class of finance culminated in what we now call decentralised finance - DeFi for short.

DeFi was an important step in the evolution of cryptocurrencies, but it had one critical weakness: all the applications described above require a bridge between the blockchain and the outside world.

For all their strengths, it is important to remind ourselves of the severe limitations of blockchain technology. Blockchains excel at sending cryptocurrencies from one address to another in a way that every node of the network can agree upon. However, they are completely self-contained systems and as such have access to almost no information outside themselves. The bitcoin blockchain does not know what the price of bitcoin is; nor do other blockchains for their respective cryptocurrencies. Blockchains do not even know what the time is; they are isolated systems by design and cannot access so-called “off-chain” data. Smart contracts face the exact same limitations by extension.

We need to be able to connect blockchains and smart contracts to the outside world in order to do anything genuinely interesting with them - arguably for them to have any real use at all.

Oracles are the tool that allow us to do this. Oracles are the bridge between the outside world and the blockchain. In normal software development, when two distinct applications or programmes need to communicate with one another, they would do so via an API. As we have just explained, this cannot work in the case of a blockchain because the blockchain cannot interface with anything else. Instead, oracles work by fetching the necessary off-chain data and submitting it to the blockchain in the form of a transaction. Oracles are typically granted the mantle of “blockchain middleware” because they occupy the liminal space between the on-chain and off-chain worlds.


This presents a bit of a quandary, known as the oracle problem.

Decentralisation is the core tenet of blockchain technology. It is what sets apart the realm of cryptocurrencies from traditional finance. Crypto without decentralisation is not crypto at all. But what happens when a smart contract or DeFi application is reliant on an external, centralised data input? It would be like using an electric car that gets its electricity from a 50-year-old coal power station. The green credentials of the car become somewhat questionable.

So it is for smart contracts. What would be the point in using blockchain technology if the created system still relied on a central point of failure in the hands of a singular actor? It defeats the entire point of adopting such an approach in the first place. If decentralisation is the end game, then every component of the system must be so.

Let’s say Barry and Dave have a bet. Barry thinks that the price of Ethereum will be at or above $5,000 on the 25th of December 2025; Dave thinks otherwise. The loser agrees to pay out the winner one ETH on the settlement date. Both ardent crypto enthusiasts, the pair agree to set up the bet as a smart contract, all coded in advance. The date finally arrives and the price of Ethereum is around $5,500. Barry rubs his hands as he checks to see the extra Christmas present sitting snugly in his wallet. Where is the ETH he won? It’s not there… How could this be? He won the bet fair and square… He checks the smart contract and confirms that it worked exactly as designed, but for some reason the oracle submitted a price of just $4,000 per ETH.

What happened? The problem here is that the smart contract used an oracle that fetched the price of Ethereum from a singular source. In this case, a very low liquidity crypto exchange with a less than stellar reputation. Just before the contract was set to trigger, a large whale sold into the paper-thin order books, crushing the price of Ethereum on the dodgy exchange. Before the arbitration bots could step in to rebalance the books, the smart contract reached maturity, the oracle submitted the incongruent Ethereum price to the contract, which then payed a handsome reward to Dave.

Everything worked exactly as intended in the example above, but someone was still unfairly treated. The decentralised, trustless, uncensorable nature of blockchain technology could not save Barry from a poorly designed oracle solution. A singular, centralised data feed had exclusive control over the execution of the smart contract. In the end, it was no better than a regular contract.

What do we do about it? The solution here is to apply the same logic that got us this far in the first place. To bypass the oracle problem, the oracle itself also has to be decentralised, taking on the form of an entire, customisable network of nodes and data sources to deliver off-chain information to the smart contract. Returning to the example above, a better oracle solution would have been to pull the price of Ethereum from a wide range of different sources, use a filter mechanism to exclude outliers, average out the remaining respondents, and perhaps homogenise the results over a slightly longer timeframe. A number of clauses and insurance policies could also have been implemented, further mitigating any unexpected outcomes.

One may raise the point that the above still does not stop the oracle node operator from misbehaviour, and they would be correct. Once again, economic incentives are an answer here. Just as miners have an economic incentive to add legitimate blocks to the blockchain, so too would node operators to submit the correct data to a given smart contract.

It is worth making the point that debates surrounding oracle infrastructure do not necessarily stem from purely ideological grounds - nor should they. Decentralisation for its own sake is a waste of time. On an entirely pragmatic level, a decentralised oracle network provides the kind of security, redundancy and freedom that spurred on cryptocurrencies in the first place.

Such security concerns have been ignored countless times in the past few years, with disastrous consequences. Even with the best of intentions, oracle attacks are behind some of the worst losses in crypto history. Some of the more impressive schemes are mind-bogglingly complex. According to some estimates, in 2022 alone, DeFi protocols lost over $400 million because of oracle manipulation attacks. Despite this, the relevance of the appropriately named oracle problem remains overlooked by many crypto proponents who really should know better.

Feedback
float feedback icon
LiveChat
livechat
LOGIN OPEN ACCOUNT

Risk Warning : Trading derivatives and leveraged products carries a high level of risk.

OPEN ACCOUNT
to top icon