Blockchains have a tough time talking to one another. Most cannot connect to the wider internet, and none can access the corporeal pre-web hinterland known as “IRL.”  

Instead, blockchains can only really access information pertinent to the execution of transactions or smart contracts—similar to how ChatGPT can’t, at least in its current rendition, search the internet for your query but must rely on its training data.

For blockchains, that’s a big problem if a smart contract needs to access real-time information. Smart contracts, if you have forgotten, are clever self-executing programs that disburse cryptocurrency when certain external parameters are met. That means they often need facts about the outside world, which are hard to come by for a line of code, trapped in a blockchain. 

For instance, a weather-related smart contract might only execute if it is raining in Seville. But the contract can’t don factor 50 sunscreen and hop on the cheapest Megabus; it needs to be able to digitally gauge the weather in the almost-always sunny Spain.

And more than that, the blockchain needs its source to be trustworthy. A smart contract would be useless if anyone could simply submit a weather-based lie and get away with it. A crypto betting protocol, for instance, might only pay out if it could independently say that it is, in fact, raining in Seville. 

But if smart contracts can’t access the internet, and if they need to access data in a trustworthy manner, what are they to do? 

Delphic DeFi

One answer, made popular in the past few years, is to rely on something called a blockchain oracle, which basically acts as a trustworthy source of “off-chain data”—that is, any information not found on the blockchain itself—for smart contracts. 

Generally, they have to be decentralized to ensure that the knowledge they supply to the blockchain has not been tampered with.  

The ‘Oracle Problem’

For a long time, oracle development was plagued by the so-called “oracle problem.” That is, how can you create a decentralized and trusted source of information about the outside world without compromising on either security, authenticity, or trust? 

One early attempt to resolve the problem was Augur, a prediction market platform that aggregated bets from users on the probability of events. The outcome of a given event would be determined by a “reporter” who would earn cryptocurrency by being honest. Other reporters could dispute the first reporter’s assessment if they disagreed. 

Most of the time this worked fairly well, and bets would be settled without too much discontent. Bets involving election or sports data, for instance, were simple enough to collectively verify. 

The problem, however, was that some outcomes depended on subjective opinions, or wording that was open to misinterpretation, and disputes over poorly phrased markets could go on indefinitely. The invalidated Augur market “Will the weather be pleasant on August 20?” was perhaps the most notorious example of this tension. 

One-Man Oracle

Other oracles relied on catastrophically rigid guesswork. Take the abortive blockchain project DigiPulse, for instance, which attempted to build a “dead man’s switch,” a kind of smart contract that automatically disburses a dead user’s funds to an agreed recipient upon news of said death. 

The issue was DigiPulse’s founder wasn’t quite sure how to determine if a user was dead. His solution was to presume a user’s passing if they spent a set amount of time offline. But this didn’t account for, say, taking a vacation, losing one’s keys, or simply getting bored of the internet. 

More pertinently, the DigiPulse oracle couldn’t even tell if an heir’s address was still in use. Its founder, a decidedly centralized entity, said he would have to simply try and find out for himself. Not exactly the kind of system that is scalable for a multibillion-dollar DeFi (decentralized finance) ecosystem. 

Chainlink 

One of the most popular and successful decentralized blockchain oracle networks is Chainlink, which pioneered a clever way of reconciling off-chain data from multiple sources into a single, reliable nugget of information.

You might have already heard of it because its token, which trades as LINK, is pretty popular. As of April 2023, it has a market capitalization of $3.8 billion.

Chainlink never really bothered to find a way to feed the truly off-chain stuff, like users’ deaths or weather-pleasantness, into the blockchain. Instead it focuses on market data, which can reliably be averaged out across multiple sources. 

A common application for Chainlink is the crypto price feed. Smart contracts, for instance lending protocols like Aave, need to access real-time crypto prices to adjust the costs of their loans and to work out how to reward people who stake their own crypto as collateral. 

Aave is primarily based on Ethereum and therefore can’t access this data itself. So, Aave’s smart contracts tap Chainlink for the price data. 

To carry out Aave’s bidding, Chainlink scrapes data about a cryptocurrency’s price from a reputable price aggregator, e.g., CoinGecko, which takes information from cryptocurrency exchanges, like Uniswap. Chainlink’s decentralized validators verify this information so that Aave’s smart contract can rely on it. 

How Does Chainlink Validation Work?

It’s worth getting into a bit more detail on how Chainlink has mastered its Delphic art. 

Rather than relying on a single source, validation on the protocol relies on a constellation of validators that together represent a “decentralized oracle network,” or DON.

The process begins when a smart contract seeks specific off-chain data and puts out a request. The decentralized Chainlink protocol receives this request, producing three new contracts that it broadcasts to its set of token-holding validators.

The first of these contracts, the “Chainlink Reputation Contract,” filters for validators with good standing and a track record of accuracy. The second, the “Chainlink Order-Matching Contract,” takes bids from the validators who want to respond to the request and then assembles a group. 

These validators then use clever software to obtain whatever data is needed from one or more sources and make it blockchain-legible.  The third contract, the “Chainlink Aggregating Contract,” then cross-references the data and checks for errors or discrepancies. 

If, for instance, five validators draw data from the same source but two responses differ, the anomalies will be ruled out as dishonest or ineffective. 

The contract will do this on a large scale across many validators and sources, averaging it out as a single data point that is fed into the initial requesting contract, and then rewards the contracts with LINK. 

Other Oracular Use Cases

Oracles have wide-ranging uses including sharing data across blockchains (for instance, sharing Bitcoin data to Ethereum), identification services, and tapping “Internet-of-Things” (IoT) sensors in supply chains. 

That last one has been attempted for a while, with varying success. Essentially, items that travel along a supply chain—say, lettuces—are each referenced via a unique code on the blockchain. However, as with DigiPulse, the supply chain model falls prey to the “garbage in, garbage out” problem. That is, you can’t be certain that the lettuce farmer at the back-end isn’t just labeling, say, random pebbles as lettuces and logging them on the ledger. 

Still, at least in theory, these technologies could help replace the need for middlemen to verify claims about data. A decentralized insurance contract, for instance, could verify the validity of an insurance claim by tapping an oracle, then relying on its findings to determine whether to pay out. (Though a decentralized oracle that can reconstruct, say, a complex workplace accident is still a long way off.) 

The system of oracles is powerful when it works and dramatically devastating when it does not. In the early days of DeFi, hackers manipulated plenty of poorly built oracles by flooding liquidity pools with flash loans—massive instant crypto loans—thereby momentarily distorting the price of the cryptocurrencies in the pool. Then, the hackers would run away with all the money before the liquidity pools had a chance to rebalance.