What are oracles in blockchain? (and why they are essential for DeFi, GameFi, and more)
Blockchain is a closed system. It does not know what the weather is today, who won the match, or how much a dollar costs. But what if a smart contract needs this information?
Here come the oracles - the bridge between the blockchain and the outside world.
Why are oracles even needed?
Without them, smart contracts would be 'blind'. They wouldn’t be able to:
Find out the price of an asset on an external exchange,
Confirm the occurrence of an event (for example, rain in London),
Execute a condition based on external data (for example, betting on sports).
Example
Imagine a decentralized exchange where you open a position if ETH drops below $3,000. The smart contract does not know this by itself - it needs external data. That’s what the oracle provides.
What types of oracles are there?
Software - provide data from web sources (prices, rates, APIs).
Hardware - record events in the real world (sensors, RFID).
Incoming - bring data into the blockchain.
Outgoing - send data out of the blockchain.
Are there any risks?
Yes. If the oracle is compromised, it can jeopardize the entire contract. That’s why popular solutions like Chainlink use a network of independent nodes and a decentralized approach to data verification.