We need to take a step back to understand blockchain oracles and why they are created. Oracles are problem solvers for many smart contracts launched on blockchains.
But what is a smart contract, and what problem do oracles need to solve? We will start by answering these two questions and then explain how they solve problems for the DeFi space.
Blockchain Oracles in Brief
Blockchain oracles are complicated computerised systems that connect data from the outside world (referred to as ‘off-chain’) with a blockchain (or ‘on-chain’).
Blockchains, Cryptos, Smart Contracts, and a Problem
The majority of blockchains have their own native cryptocurrency that is used to transfer value, enable the protocol’s operations, or to facilitate governance. Some blockchains (the most well-known being Ethereum) can also be used to build smart contracts. These are blockchain based self-executing contracts with the terms of the agreement between two or more parties, usually a buyer and seller, being directly written into lines of code.
Smart contracts will execute predetermined actions automatically when defined conditions are met, and by being built on the blockchain, they are traceable, irreversible, and unchangeable (immutable). These smart contracts are executed ‘trustless’, not requiring a third party, and if written correctly, can be designed to carry out nearly any contract imaginable.
If a buyer wishes to purchase a home with cryptocurrency, a simple, smart contract could be written for the transaction. It would say something like the following, ‘If the Buyer sends the required funds to the Seller, then the deed of the home at X location is transferred from the Seller to the Buyer’.
When the conditions of the smart contract are met, it is irreversibly executed in accordance with its programming. There is no need for traditional third parties to initiate, manage, or execute such a contract.
There is, however, a problem with this system. Blockchains need a way for smart contracts to be able to use external off-chain data so that the smart contracts can have applications in the real world.
With the real estate example above, off-chain data may include proof of successful payment or the evidence of a deed receipt. Because blockchains are generally self-contained, the connection to the real world is a problem; this is where the problem-solving nature of oracles comes into play.
Oracles Connects Blockchains to Off-Chain Data
Oracles provide a way for a blockchain and its smart contracts to interact with off-chain data. Oracles are similar to another computing system, an application programming interface (API), but to the world outside the blockchain.
There are several instances where real-world data must be communicated to a closed on-chain system. This data is critical when smart contracts rely on real-world events to execute correctly.
Crypto oracles will query, verify, and authenticate the needed external data and then relay it to the closed blockchain system. This authenticated data will then be used to validate the smart contract.
Read the full article here.