What is a blockchain oracle?
A blockchain oracle is a service that connects smart contracts to external (off-chain) data — prices, weather, sports scores, identity verification results, IoT sensor readings. Smart contracts are deterministic and cannot natively access external APIs; oracles bridge this gap. Reliable oracles are critical infrastructure for DeFi (price feeds), insurance (parametric triggers), and supply chain (real-world events).
Oracle architectures
- Centralised oracles: single trusted operator (e.g., a company-run API); fast and cheap but single point of failure.
- Decentralised oracle networks (DONs): multiple independent node operators aggregate data; consensus-driven; Chainlink is the dominant example.
- First-party oracles: data publisher operates own oracle (Pyth, Redstone); reduces middleman cost and latency.
- Optimistic oracles: data is posted optimistically and challenged via dispute window (UMA).
Oracle attacks and risk
- Price manipulation: attacker manipulates source venue (often a low-liquidity DEX) used by an oracle, then exploits the bad price downstream. Famous: 2022 Mango Markets ($117M), bZx attacks.
- Stale data: oracle update latency exposes protocols during volatile periods.
- Node collusion: small DONs can be co-opted; reputation and stake systems mitigate.
- Best practice: time-weighted average prices (TWAP), multi-oracle aggregation, circuit breakers on extreme moves.
Related practice areaICOs, Crypto-Currencies & Blockchain →