The FIFA World Cup Qatar 2022 is set to kick off in a month. In the crypto industry, predictions of the World Cup matches are gaining steam, and the top priority of these projects is to get match results as fast and accurately as possible. However, smart contracts cannot access external off-chain information alone; a tool that bridges the gap between blockchains and the real world is much needed. In today’s TRON 101, we will focus on the tool that connects the on- and off-chain worlds—the oracle.
The blockchain oracle has the same name as the well-known IT services giant Oracle. But in fact, there is no connection between these two. Initially, an oracle is a person or agency considered to provide prophetic predictions inspired by deities. Blockchain oracles play a similar role. They feed isolated blockchains with real-world information. Such a tool can be called the messenger of the deities in the crypto world.
The name “oracle” is misleading as it sounds like a machine that predicts the future. As a matter of fact, an oracle is a tool that writes information onto blockchains. It is extensively used for predictions but never predicts anything; instead, it synchronizes information such as sports scores, market price, and temperature onto the blockchain.
To make things easier to understand, some compare public chains to operating systems, DApps to applications, and oracles to APIs. As we know, APIs allow applications to communicate with each other. Similarly, oracles allow blockchains to communicate data with the real world.
Let us suppose that there is a DApp for the Qatar World Cup champion prediction where users can check out match scores and prediction results via an on-chain smart contract. The blockchain itself does not provide match results; it has to request data from the API of the World Cup official website before feeding it to the DApp.
Blockchains are isolated protocols, like computers without network connection. Thus, oracles are needed to bridge blockchains and external resources. After receiving the request from a smart contract, an oracle calls external website APIs and returns data to the smart contract for processing.
This seems like a simple process. But the crux here lies in ensuring the credibility of external data sources. Some centralized oracles developed by DeFi project teams are exposed to the risks of “single points of failure”, including data tampering and cyber attacks.
Typical decentralized oracles, such as WINKLink on the TRON network and ChainLink on Ethereum, offer users a more secure and reliable experience. These oracles request data from multiple sources to ensure the credibility of the data. Data requests are processed by multiple nodes together to avoid the trust issue of single-node oracles. In addition, an incentive mechanism is used by these oracles to reward cooperative nodes and punish malicious ones.
The extensive use cases of oracles encompass all DApps that involve off-chain data, including the fastest-rising DeFi. Many DeFi services, such as stablecoins, decentralized margin trading, financial derivatives trading, and decentralized lending, are backed up by oracles.
With a total market cap of $20 billion, DeFi will take an immeasurable blow if oracles go wrong. An example is the oracle attack suffered by the well-known derivative trading platform Synthetix back in June 2019, which led to a loss of over 37 million synthetic Ethereum (sETH).
A blockchain can never exist on its own without connection to the real world, and this is why secure and efficient oracles are necessary for the mass adoption of DApps to be possible. We believe market demand will drive oracle technology to continue to evolve.