Smart contracts are powerful but sealed off from the outside world; a blockchain has no native way to know the price of ether in dollars, the result of a sporting match, or tomorrow's weather. An oracle bridges that gap by fetching external data and delivering it on-chain in a form contracts can consume. Without oracles, most of DeFi simply could not function, because lending, derivatives and countless other applications depend on reliable, up-to-date price feeds to work at all.
The tricky part is trust. If a contract will automatically move millions based on a single number an oracle reports, that number becomes a tempting target. A lone, easily-manipulated data source is therefore a serious vulnerability, and oracle manipulation has been behind numerous DeFi exploits, where an attacker deliberately distorts a price feed to trick a protocol into mispricing a trade or a loan and then pockets the difference.
The leading response is decentralised oracle networks that aggregate many independent data sources and providers, which makes manipulation far harder and removes single points of failure. Chainlink is the best-known example of this approach. For everyday users, oracles are invisible infrastructure they never interact with directly, yet they are a critical, and historically fragile, link between blockchains and the real world beyond them.
Key takeaways
- An oracle feeds external data, most often asset prices, into a blockchain so smart contracts can use it.
- Much of DeFi depends on oracles, because lending and derivatives need reliable price feeds to operate.
- A manipulated or single-source oracle is a major vulnerability, which is why decentralised oracle networks are preferred.
Oracle — questions fréquentes
Why do smart contracts need oracles?
Because a blockchain has no built-in knowledge of the outside world. An oracle supplies external facts, such as market prices, so a contract can act on them. Lending and trading protocols could not function without reliable feeds telling them current values.
What is an oracle attack?
It is an exploit in which someone manipulates the data an oracle reports, often a price, to trick a protocol into mispricing a loan or trade. Decentralised oracles that aggregate many independent sources are designed specifically to make this far harder.
Related terms
Smart ContractDeFiDecentralised Exchange (DEX)Liquidity PoolStablecoin Tous les termes →New to crypto, or filling in the gaps? Work through the essentials in Learn, browse every term A–Z, or see live prices for the coins these concepts power.