arrow-up
Tech Deep Dives

Oracles in DeFi 101: A Deep Dive by Tellor

Published on:
September 21, 2020

Opinion: With the rising popularity of the DeFi space, oracles are becoming more relevant. What are the different types of oracles and why are they useful?

Table of Contents

Oracles Defined

Oracle” is a term in cryptocurrency that is not new, but has become more and more relevant as the decentralized finance (DeFi) space has begun to grow more rapidly. To the uninitiated, an oracle may make you think of a prophet or messenger from mystical times — but in the crypto space, oracle takes on a more down-to-earth role as the messenger between real-world data and blockchains.

In cryptocurrency, to be more specific, an oracle provides real-world off-chain data and submits this information to a blockchain to be used by smart contracts. Typically, this is a data feed provided by a third party service. 

To give an example, let’s say you built a betting app on Ethereum that is essentially a smart escrow smart contract. Bob and Alice deposit ETH into this contract and make a bet on specific parameters of the BTC/USD price over the period of one month. Alice says the price at the end of the month will be above $10,000 and Bob says below. They lock ETH into the smart contract and at the end of the month, it automatically disperses the locked funds to the winner. 

Fantastic! No third party escrow bank must be trusted to ensure the funds were fairly distributed to the rightful party. This seems like a small thing, but removing intermediaries in finance has huge implications on the freedom, accessibility and privacy of these types of products. 

But wait, how did the smart contract know what the price of BTC/USD was? That information does not live on Ethereum. Usually, a major crypto exchange is used to reference that information, like Coinbase or Binance, and they have APIs that allow people to query that data. How your smart contract gets that information is referred to as the “oracle.” 

Since smart contracts on Ethereum are fully self-contained and any information or access to off-chain data is restricted, certain types of smart contracts are reliant on an outside provider (an oracle) of off-chain data points. This is known as the “oracle problem” and is a key hurdle for decentralization. 

Luckily, the space has come up with solutions. Oracles truly enable the potential of smart contracts by allowing access to use cases that would be otherwise out of reach. Oracles merge and expand the new crypto world with existing “real” world assets. In fact, the biggest and most important users of oracles — the DeFi space — is probably the largest industry overall within crypto in late 2020.

Recent events have brought attention to the oracle’s function and how important the oracle’s design, liveness and sources of data are in determining security and level of decentralization of DeFi protocols and overall the safety of users’ funds. As unfortunate as events like Black Thursday were, they have helped the crypto community become more educated or at least curious about oracles. 

Let’s now take a look at some of the various ways people have sought to tackle the oracle problem.


Oracle Designs

Looking at what’s currently in use in DeFi, oracles generally fit into a few broad categories: centralized, distributed, delegated proof-of-stake (dPoS), prediction markets or decentralized. 

Centralized Oracles

This is the simplest form of oracle, where a single party provides the data. It can be a third-party provider (someone you whitelist) or done by the same protocol (yourself). Centralized oracles are typically much faster and more capable than more decentralized options.

The problem, however, is that you now have a decentralized smart contract infrastructure (the protocol) with a centralized key point of failure (the oracle). An extensive amount of trust that must be placed in the central party. In theory, they could censor data at will, or go out of business and shut down their servers, leaving your smart contract with no data. In crypto-speak, you’d say that the oracle has no liveness guarantee.

Distributed Multi-Sig Oracle

This is basically when a handful of parties are each whitelisted to place the data on-chain, and then the user can do any transformation they want (median, average, etc…) before using the data. The issue with this design is that the degree of centralization is still high. It is a better design than a centralized oracle, but still susceptible to manipulation and liveness guarantee is limited.

A variation of this oracle is to use a relaying mechanism, which is where multiple parties sign prices and then one party (or a list of a few parties) pushes the value on chain. The issue with this design is that adding a relayer actually centralizes the entire design and makes it more vulnerable to

manipulation and decreases the liveness guarantee gained in the original multi-sig oracle design.

DPos Oracle

This is a system where whitelisted staked nodes can provide data and lose their stake if they provide bad data. This is arguably better than a multi-sig, since it includes economic incentives for data providers to behave well, but parties have to pay close attention to the whitelister and the whitelisting process. Can they un-whitelist everyone at will? What’s the security mechanism for slashing? How do nodes get added? As in any dPoS system, you need to know how well the nodes communicate and how easily they can collude.

Prediction Market Oracle

This is where participants vote on the right outcome by placing a bet on it (placing their money where their mouth is). If you assume 51% honesty in the system and parties don’t want to lose money, it works and is decentralized. This method has a higher degree of liveness and lower degree of manipulation (per assumptions above) than a centralized oracle, but unfortunately regulatory, speed, liquidity and even cost concerns have made them relatively untenable for many DeFi needs.

Decentralized Oracle

This is an oracle system with an open network of data providers that reach consensus similar to how a blockchain reaches consensus, using game theory and economic incentives. 

Decentralized oracles are slow and expensive, but manipulating them is expensive as well, and they have a higher degree of liveness guarantee. It is tough to decentralize the process by which off-chain data gets used on-chain, which is why it is often part of a “gradual decentralization” plan.

The ability to begin as only partly decentralized — with plans for full decentralization to follow — enables a broader marketplace of ideas to be tested. In fact, there are many DeFi protocols out there that simply can not use a decentralized oracle without greatly reducing the user experience of their product — so they’d rather wait and progress towards decentralization over time. 

The counterpoint to this notion is that it can be hard to climb out of centralization once you are an established project. The incentives aren’t always there unless you build them in from the ground up. 


 



Current Oracles

Some of the major and innovative oracles on Ethereum are discussed below. This is focused on oracles live on Ethereum, since currently one of the biggest industries in crypto is DeFi on Ethereum. 

Provable

Provable (formerly Oraclize) is a centralized oracle provider and the biggest name for this method in the Ethereum space. It’s been live for a long time and is simple, easy to understand and great for testing on MVPs. The obvious risk here is that the central party can either manipulate the data feed or if they shut down their servers, the smart contracts won’t get the data they need (there is no liveness guarantee). 

Chainlink

Chainlink has a centralized whitelisting agency that gets nodes to report to various price feeds. They have many goals on the horizon with regard to decentralization, but this is what is live now, and it is currently based completely on the reputation of Chainlink. As with a centralized oracle, the whitelisting agency has an effect on the liveness guarantee and the degree to which data can be manipulated or censored. Chainlink does, however, focus high quality data, with access to paid APIs. Since they have central parties, they can even act as middleware, completing specific tasks which require authentication. Synthetic, Aave, bZx and Set are some of the few DeFi projects with volume and they currently use Chainlink.

As a disclaimer, this is our best knowledge of how Chainlink works currently (not a proposed version).

Maker

Maker’s oracle structure is basically a complex proof-of-authority model with privacy. They’ve recently moved to a model where anyone can be a relayer, but there is no transparency on who the data providers and what their incentives are, and their code readability is very poor. However, Maker follows some best practices, namely they have an hour delay in their oracle updates. This oracle security module (OSM), which is a smart contract on-chain, allows their token holders to say whether an update is a bad value, and they can freeze the system. This is a very important security feature, because it means that the oracle isn’t in complete charge of their protocol — the token holders are. Maker is one of the major players in DeFi and the oracle they developed for their systems is actually one of the most widely used in the space. Notably, Dydx and many smaller projects that need a robust ETH/USD price feed use Maker.

Compound

Compound has a similar structure to Maker, but they have their own reporters and a different mechanism for handling what happens when the real-time data gets on chain. Also, similar to Maker, they follow best practices and don't expect oracle data feeds to be instantaneous. The vision for Compound is that the reporters are known exchanges and large players who sign prices and report them publicly to a feed. This system is similar to a multi-sig approach, but it is very transparent and an important step in getting centralized exchanges more involved in DeFi. 

Tellor

Tellor is a decentralized oracle that provides price data on Ethereum. It uses a network of staked miners that compete to solve a PoW challenge and submit the solution along with requested data. Tellor uses game theory and crypto-economic incentives to maintain the security of the system, similar to how layer ones have harnessed the power of these methods to reach consensus. Tellor is decentralized and currently provides a price feed every 10 minutes. The speed and potential costs are the areas of concern, but it is decentralized and expensive to censor or manipulate the data. The economic incentives are also set up properly to provide a proper liveness guarantee even in times of stress on the Ethereum network. 

Conclusion

In terms of oracle usage, DeFi is basically using two oracle structures that are at best only relatively decentralized. There are other both new and old projects out there using oracles that are not mentioned (like Augur, Gnosis, Band or DIA) — but in terms of DeFi projects with some volume, the list above is comprehensive. We expect that as the community educates itself on the importance of oracles, their designs and how these can affect the security of their funds, DeFi will start moving towards truly decentralized and more secure solutions. 


This article contains links to third-party websites or other content for information purposes only (“Third-Party Sites”). The Third-Party Sites are not under the control of CoinMarketCap, and CoinMarketCap is not responsible for the content of any Third-Party Site, including without limitation any link contained in a Third-Party Site, or any changes or updates to a Third-Party Site. CoinMarketCap is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement, approval or recommendation by CoinMarketCap of the site or any association with its operators.


This article is intended to be used and must be used for informational purposes only. It is important to do your own research and analysis before making any material decisions related to any of the products or services described. This article is not intended as, and shall not be construed as, financial advice.


The views and opinions expressed in this article are the author’s [company’s] own and do not necessarily reflect those of CoinMarketCap.

Author(s)

Brenda Loya

“I’ve merged my fascination for tech and data through Tellor, providing secure and decentralized data for applications built on blockchains

Terms in Article

Join the thousands already learning crypto!

Get notified when new articles are posted

Email submitted!
Oops! Something went wrong while submitting the form.

Related Articles