The Blockchain Oracle
Introduction to Oracles:
A blockchain, as we discussed earlier, is a type of decentralized computer that can make commitments. But, to take the analogy further, today’s blockchains are like computers without an internet connection: they have access to all data stored within the computer, but have no way of knowing real-world data from outside the blockchain. So, for example, it can’t know what the current conversion rate of USD-BTC is, or what is the weather like in London, or who won the Wimbledon Men’s Singles in 2020 — unless, there is a way to fetch this data onto the blockchain. That’s where Oracles come in.
Oracles, simply put, are a means to get “off chain” data onto the blockchain.
But there’s a important thing to note there: Blockchain transactions are irreversible. A single error in the blockchain computation result could lead to losses running in the millions or even billions of dollars. And unlike centralized financial institutions (like banks and exchanges), these blockchains do not have safeguards like the ability to manually pause/ stop/ reverse any transaction. Apart from errors in the blockchain code, or malicious attacks on the blockchain network itself, a significant area of vulnerability in the blockchain computation is the input data. Concerns around any errors or attacks on the off-chain data entered into the blockchain, could be severe impediments to their adoption and functioning.
So let me append the earlier statement.
Oracles, are a means to securely and accurately get “off chain” data onto the blockchain.
And that is what makes the Oracle problem so tough to crack. However, it is critical to solve this problem, in order for blockchains to capture meaningful value in the real world.
Where do I see potential applications for Oracles?
A few potential applications that will need external data include:
- Data on flight timings & delays for flight insurance
- Data on sports events for crypto-based betting platforms
- Information on the weather for crop-insurance for farmers
- USD-BTC conversion rate for lending in US Dollars
As one can guess, the applications are enormous, and in several different fields. But the biggest users of Oracle services in the near future seem to be decentralized finance (DeFi) applications.
What are some of the promising Oracle projects?
The last two years have seen the emergence of many projects leveraging a mix of software and hardware to attempt a solution to the Oracle problem. Most of these leverage their own “token” and “staking” in some or the other form.
- A token is a digital asset, that is used to incentivize the desired behaviour among all participants in the network. Since there is (usually) a limited value of tokens that can be generated, the scarcity implies that their value will increase as the application becomes successful.
- Participants demonstrate their commitment and confidence in achieving the desired behaviour on the blockchain, by “staking” their tokens. Unwanted outcomes (usually wrong data) can be punished by slashing these stakes from the responsible participants.
ChainLink is a “middleware” that takes data requests from dApps, then accordingly selects a set of data sources and a set of nodes to fetch that data. The data from all the nodes is then aggregated (by some logic like weighted average/median) and shared with the dApp. For every request, Nodes are selected based on their reputation and on the number of tokens they stake. A higher number of tokens indicates a higher degree of confidence that the data is accurate, because nodes that end up sharing wrong data risk their tokens being slashed as punishment.
This design, great execution and a very strong team to back it have all led to ChainLink being the most dominant Oracle so far. So much so that the old maxim can be modified in the blockchain context to say
Nobody got fired for using data from ChainLink
It completed 500+ integrations recently, and it has an enviable partner list which is growing steadily. Its LINK tokens enjoy a fully diluted market cap of $30Bn!
While ChainLink might be a successful solution so far, it is definitely not very efficient. Adding middlemen between dApps and data-sources in the form of nodes increases the number of transactions that happen for every request, thereby causing high gas fees (transaction charges) and slow speed to output. Both these issues are exacerbated because ChainLink is built on Ethereum, which routinely faces network congestions and subsequent high fees. In fact, few ChainLink transactions have costed as high as $450 per request! In addition, involving multiple nodes makes it vulnerable to Sybil attacks. Another important thing to note, is that while the request-response process is decentralized, the whitelisting of nodes is controlled by a centralized team.
The other similar/ competing oracles — Band Protocol and Tellor have a leg up against ChainLink in terms of either speed/ cost and degree of decentralization.
API3 questions the philosophy of having a middle layer between the data provider and the dApp, and instead offers Airnode — an “oracle maker” solution, where top data API providers can themselves become oracles. They effectively build a secure blockchain-wrapper around traditional APIs to ensure they can relay data to dApps.
By eliminating middlemen (oracle nodes) that capture a lot of the transaction value and simplifying the design, API3’s solution can potentially be orders of magnitude faster and more cost efficient.
The job of ensuring only trustworthy and secure data providers connect to Airnode, is entrusted to their DAO (decentralized autonomous organization) that consists of members who own the API3 token. Members have to stake their tokens to form a sort of insurance pool that can be tapped into to reimburse the dApp in case of wrong/malicious data shared with them. This ensures DAO members act in the interest of highly secure and accurate data responses to dApps.
The insurance concept could be a game changer for dApps. For every data request, the value of insurance cover is calculated and communicated to the dApp. So application designers can continue to use Airnode and enjoy the faster speed and lower costs as long as the value of transactions/exposure is within the insurance value. In case the exposure is very high and not within the range of the insurance, the dApp can be programmed to verify the data with another source (at higher cost/ lower speed). By eliminating the need to get multiple data values and aggregate for ALL transactions, this makes the overall system more efficient. Any disputes regarding data are handled by a decentralized mechanism called Kleros Court.
I have created this table below to compare all four solutions.
A look into the future
While at first, one might think that this would be a “winner takes all” opportunity, I believe there will be room for several players here, catering to requirements of the users. An oracle solution needs to consider several factors while making design choices. We already discussed one — data accuracy and security. But would a DeFi contract with <$1000 at stake really pay upwards of $100 for this data? Clearly not. So cost is another factor. Now consider a sports betting application based on cricket that changes its bids after every ball. Would they accept an oracle that gives extremely accurate data at very minimal cost, but takes 5 minutes to return the data? Their would be a lag of a full over (6 balls) by the time they get this data, and they’ll certainly be doomed — so we have our third factor, speed. I can see the potential to have at least a couple of profiles of oracles that index differently on the three parameters — data accuracy, speed and cost, and within those profiles, the winner might indeed take all!
Now with this background, let us look at where these four solutions stand.
I feel ChainLink will continue to dominate the decentralized Oracle space — with need for high accuracy but moderate speeds and cost. Other competing Oracles in the same space like Band Protocol and Tellor will be marginal players, finding small niches for them at best. ChainLink does have issues around cost and speed, to a huge extent driven by its decision to be on Ethereum — but as Ethereum solves for network congestion and fees, the benefits should translate to ChainLink as well. ChainLink’s network effects and huge headstart will help them survive against this competition till that happens. API3’s Airnode I believe is set to gain a sizable chunk of market share from ChainLink in the future, especially for dApps which place a premium on cost and speed, and don’t have exposures that are within insurance limits. API3 is also doing all the right things from a regulation/ compliance perspective — potentially a critical advantage in the future. In fact, Airnode is being referred to as ChainLink Killer in many circles.
I do believe the LINK token is already very expensive (at a fully diluted market cap of $30Bn+), and I don’t expect serious value-multiplication in the long-term. But it might make sense to hold the LINK sort of like a BlueChip stock. API3, on the other hand is undervalued (~40 times lower than LINK), given the growth potential and low cost structure of Airnodes. As API3 tokens are used as insurance for the transactions it supports, I see demand for them rising as the value of contracts using API3 grows.
List of useful links
Overview on Oracles
- Fabric ventures overview on Oracles
- Delphi essays on the Oracle problem and solutions
- Deep-dive on oracle solutions by Tellor
- Another deep-dive on oracle solutions by Tellor
- Some data on # partners using various Oracle technologies
- Perspectives on Oracles in DeFi
- ChainLink whitepaper
- ChainLink explainer
- ChainLink user’s account of integrating it in their dApp
- Chainlink integrations & pipeline
- 500 integrations on ChainLink
- Info on Gas Fees
- Band Protocol whitepaper
- Band Protocol deep-dive
- Useful Phemex article on Band Protocol
- Lot of details on Band Protocol incl. github activity, usage etc.
- Band Protocol Partnerships
- API3 whitepaper
- CoinFund’s investment thesis on API3
- API3’s twitter feed for updates on partnerships/ clients
- API3 Airnode first GDPR compliant oracle node
Comparison between different solutions
- A comprehensive (but somewhat biased) comparison of ChainLink and Band Protocol
- More comparisons between ChainLink and band protocol
- Comparisons on Tellor and ChainLink
- More simplistic explanations on Tellor and comparison to ChainLink
- Tweet thread responding to the comparison of ChainLink and Band Protocol
- Reddit on ChainLink vs Band Protocol
- Interesting article about ICON moving to Band Protocol shortly after using ChainLink
- Reddit on Tellor vs ChainLink
- Pythia Oracle framework in Delphi
- Witnet and it’s focus on relaying data accurately, rather than relaying accurate data