Overview: Blockchain Oracles
Oracles solve the oracle problem by connecting the on-chain and off-chain world while ensuring privacy, security, and scalability…
The blockchain is exploding as decentralized applications (DApps) are developed across industries. Smart contracts accept deposits of collateral assets and issue loans, pool tokens to back and write insurance policies, and execute transportation and IoT functions to carry out the terms of trade finance. These DApps need to connect to data from the outside world but could compromise the security of the blockchain. This dilemma is known as the data oracle problem.
Decentralized data oracles solve the oracle problem by connecting the on-chain and off-chain world while ensuring privacy, security, and scalability off-chain. They are the bridges that link blockchains with the real world, transporting inbound and outbound data across the ecosystem. As the data nexus of the crypto economy, crypto oracles are becoming essential middleware on blockchains.
Data oracles can query, verify and collect data from many sources (e.g., data providers, web APIs, IoT devices) and deliver it to smart contracts.
The price feed on your swap platform, bet outcomes on prediction markets like Augur, or sports stats on your fantasy football DApp are fed through data oracles. Without data oracles, smart contracts would be stuck in a time glitch with traditional data feeds, while decentralized applications are becoming faster, smarter, more secure, lower cost, and generally more efficient using these decentralized data feeds.
With the oracle problem solved, data oracles are focused on innovating and creating many exciting new use cases for decentralized applications. This article peaks at some of the state-of-the-art crypto oracle platforms and the developers building more advanced DeFi, GameFi, and other DApps for them.
Benefits of Oracles
If you have searched for a flight on Skyscanner, you have a basic idea of how decentralized data oracles work. The metasearch engine aggregates flight, hotel, and car data from airlines worldwide. If you use this tool instead of searching for individual travel services, chances are your travel bookings are more efficient, faster, and lower cost. Similarly, data oracles can draw data from many varied offline datasets to provide more accurate, reliable, and useful information to decentralized applications, be it for travel, decentralized finance, GameFi, insurance, or any other DApp.
Similarly, some practical early use cases for data oracles like Chainlink and Band Protocol are DeFi aggregator services like Alpha Finance Lab and 1Inch, and platforms for building arbitrage and crypto bots like Hummingbot. Oracles are powerful because they are designed to accept the definitive truth, and nothing but the truth, about the data from the external world. This is accomplished by querying data from multiple sources, validating the integrity of data through distributed node networks, ensuring that calculations are tamper-proof, and securely delivering this truthful data to the smart contract.
Oracles can not only fetch data from many sources but also improve data accuracy and reliability by ensuring the data fetched is more accurate, complete, consistent, up-to-date, and privacy-enhanced through:
Decentralization — A distributed network of nodes can query many different APIs and aggregate data on-chain. Data accuracy is improved, corruption is lowered, and the risk of a single point of failure from one data source is eliminated.
Data privacy — Data privacy and even complex computations can be handled off-chain while verifying the information on-chain.
Decentralized consensus — Data is confirmed through a decentralized network of incentivized nodes with various approaches to ensure correctness. Witnet awards mining jobs to nodes who earn a good reputation and punishes those with a bad reputation, while Chainlink assigns incentives to good actors and penalties to bad actors.
Data security — Because each node signs the transaction, it is near impossible to change and manipulate the data. Data transactions are transparently recorded on the blockchain, and data feeds can be viewed through public explorers. Oraclize and Cornell’s Town Crier, acquired by Chainlink, use trusted execution environments (TEES) to protect an application in an enclave that secures data and code from the rest of the operating system.
Interoperability — Crypto data oracles like Chainlink and Witnet are being built for a multichain world by supporting blockchain agnosticism, allowing data to be channeled to and from various public and private blockchains, making smart contracts truly universal contracts.
Privacy rollups — Privacy algorithms confirm and verify data without revealing the underlying data required on-chain. UMA uses optimistic rollups in its Optimistic Oracle, whereby an oracle is only needed to dispute invalid liquidations to ensure the correct collateralization of its priceless contracts, thereby minimizing oracle usage to improve network security and scalability.
These data oracle features are behind the user data empowerment revolution powered by crypto data you can trust. Under this new decentralized data paradigm, Facebook could not use your data without your knowledge. More DApps are empowering users to build data products and services to power an essential development behind truly composable DeFi as DApps enable users to create their own highly customizable insurance products, swap pools, options contracts, etc. Through the zero-fee trading platform, the Woo Network, institutional traders can develop customized institutional oracles.
Anyone can use the Graph Indexing protocol — global graphs of all the world’s public information shared and queried across any application — to build data-powered decentralized applications. Interoperable blockchains NEAR and Harmony are among the participants in the Graph Hack to build DApps and subgraphs (open APIs) for Web 3.0.
How New Oracle Features Are Expanding App Use Cases
Data oracles are expanding blockchain use cases by 90 percent, estimates Chainlink, the most used data oracle. Following are some examples of innovative uses of data oracles by decentralized applications:
DeFi — Data oracles support fast real-time trading data aggregated from many sources to improve data quality and provide prices with less variation from the market average. This improved pricing data contributes to new, more efficient AMM models like HydraSwap or options platforms like Friktion Labs by lowering impermanent losses and making more efficient use of capital.
Illiquid markets — Lithium Finance uses its decentralized consensus mechanism to crowdsource price forecasts on illiquid markets, enabling decisions to be made on product launches based on market sentiment, lending and collateral management, and other investment decisions.
GameFi — On Stonk League, real-time league tables are assigning ratings to gamers and investors and, for the first time, providing performance stats for finfluencers, top copy traders, and other DeFi influencers to put stats behind their cyber advice and endorsements on YouTube and other social media channels.
Random number generation — Tamper-proof random number generators like the Chain-link VRF “provably fair and unverifiable randomness” are rebuilding trust in online applications such as gambling and games by making randomness cryptographically secure.
Supply chain — The fully decentralized supply chain is coming to life using data oracles to seamlessly connect software (smart contract terms and payments) to hardware data (RFID tag and IoT data on sales, logistics, customs, and other supply chain data). VeChain uses this technology to break down enterprise data silos and provide a 360-degree end-to-end view of the supply chain to make data more actionable and transparent.
Are Oracles Infallible?
The answer may rely more on behavioral economics than math-based smart contracts. Can oracles prevent bad actors from being motivated to act dishonestly? Oracles are only as good as the quality of their data, and node operators validate that quality. These highly flexible oracles are developing ways to program a higher level of reliability automatically.
Let’s say Alice and Bob both invest $100K in a $BTC/$DAI liquidity farming pool. Alice’s crypto exchange uses a traditional price feed service popular with large institutional investors that delivers price quotes with the highest latency in the marketplace. She places her bet at a higher price than the average market price but only makes a modest 5% profit after large players on the exchange collude to manipulate the price.
Bob’s crypto exchange uses a decentralized data oracle. At the same rapid speed, the data oracle aggregates prices from not one but dozens of different pricing feeds to deliver a price that more accurately reflects the BTC supply-demand in the entire market, smoothing out the effects of the market manipulation on the one exchange. Bob makes a 10% profit. We can see how a data oracle providing more accurate pricing can improve investment outcomes.
Both Alice and Bob decide to increase their investment in the staking pool to $1 million. Unfortunately, the six node operators on Alice’s exchange decide that $1 million is a high enough incentive to collude on falsifying information, so Alice’s bet loses, and the pool wins.
On Bob’s exchange, however, the oracles automatically program a higher level of reliability. For transactions above $1 million, 12 rather than six node operators are required. The bad actors do not try to manipulate the system as the difficulty level and risk of being caught has increased.
How Decentralized Data Oracle Nodes Uphold Security and the Truth
As shown above, a DeFi platform can establish definitive truths required within its network, which, in turn, are then upheld by the node operators, who could be penalized for not supporting the truth. Each dApp can set thresholds that are dynamically monitored and automatically triggered, in this case, with proof that scales with a value, resulting in more nodes becoming involved in the consensus.
As this example shows, oracles are very flexible tools that allow smart contracts to interact with one another in new and more meaningful ways. Of course, a bad actor operating a DeFi platform could set a threshold too high to trigger risk controls. This risk can be lowered by choosing platforms that operate as decentralized autonomous organizations (DAOs). The users decide on crucial risk controls and other parameters by exercising their voting rights.