A blockchain oracle is a third-party service that connects smart contracts to real-world data from outside the blockchain. Smart contracts are deterministic and self-contained — they can only access data that exists on their own blockchain. This is a fundamental limitation: a lending protocol needs real-time asset prices; a weather derivative needs forecast data; a sports betting contract needs game results. Oracles solve this by fetching external data, verifying it, and delivering it on-chain in a format that smart contracts can use.
Oracle types: Price feed oracles (most critical for DeFi) — deliver real-time asset prices; Chainlink dominates this space with decentralised, tamper-resistant price feeds used by Aave, Compound, Synthetix, and hundreds more; Event oracles — report on real-world events (sports results, election outcomes) for prediction markets; Computation oracles — perform off-chain computation and return results (e.g. Chainlink VRF for randomness); Cross-chain oracles — relay information between different blockchains. The “oracle problem” is a central challenge in blockchain design: bringing external data on-chain creates a trust dependency that can undermine the trustlessness of smart contracts. A manipulated price oracle can drain an entire DeFi protocol — this attack vector has caused hundreds of millions in losses. Decentralised oracle networks (Chainlink, Pyth, Band Protocol) mitigate this by aggregating data from multiple independent sources.
Example: A flash loan attacker manipulates the price oracle of a small DeFi protocol by briefly distorting the market price of a low-liquidity token, causing the protocol to value collateral at 10x its real price, and draining the lending pool before the oracle corrects.
Learn more: Chainlink — What is a Blockchain Oracle?