Oracle is a price feeding (data exchange) service that serves as a link between the blockchain and the outside world bridge between. It can transfer off-chain data into the blockchain network so that the off-chain data can be used by smart contracts; or it can transfer on-chain data to off-chain customers so that they can take actions based on the on-chain information. Mainstream blockchain oracles include Chainlink, UMA Oracle, Witnet, Band Protocol, etc.
The oracle contract is a kind of intelligent contract. It receives data requests from other smart contracts on the chain and passes the requests to the oracle node. After receiving feedback from the oracle node, the data results are broadcast to the requester.
Oracle Node is an off-chain component of the oracle service. It obtains, verifies and transmits information from external sources to the oracle contract.
The chain is a closed system, smart contract It is impossible to access networks and information outside the blockchain. Because off-chain data sources are operable, tamperable and opaque, this is not conducive to the formation of consensus among blockchain nodes, that is, it is not conducive to the security of the blockchain network.
As an example, suppose a smart contract needs to execute a transaction based on the current ETH-USD exchange rate, and it obtains this data from the traditional price API. Data from different data sources can be inconsistent (not to mention APIs can be deprecated or hacked), meaning nodes executing the same contract code will get different results. That is, this may result in the network being unable to reach consensus and the value of the blockchain as a decentralized computing platform being diminished.
Therefore, it is very important for the blockchain that when a smart contract inputs a specific value, it can only produce a specific result.
In addition, on-chain smart contracts need to be combined with off-chain data to achieve a variety of applications, such as prediction markets, insurance, etc.
To solve these problems, Oracle uploads and stores external data on the blockchain. Since on-chain data is immutable and publicly available, on-chain nodes can safely use off-chain data to perform transactions without breaking consensus.
For the decentralized lending market, the protocol needs to know the asset (such as ETH) Current market prices are used to determine the value of user collateral. This way they can assess a user’s borrowing capacity and check whether their positions are safe.
When a user makes a claim, the insurance protocol requires on-chain/off-chain data to verify the occurrence of an insurable event. For example, when certain weather phenomena occur, insurance agreements require compensation to be paid to users who purchase crop insurance. The weather data here is provided by the oracle.
Cross-chain oracle refers to an oracle that reads and writes information between different blockchains. It provides a middleware for blockchain protocols, allowing them to connect to any blockchain without spending time and development costs.
You may be interested in the following information:
- What is Chainlink?
- What is DeFi?