Crypto glossary

Blockchain oracle

Definition

A blockchain oracle is a service that feeds outside data, such as asset prices or event results, into smart contracts that cannot access it on their own.

Smart contracts only see data stored on their own blockchain. To know the price of ETH in dollars, a football score or the reserves behind a token, they depend on an oracle that gathers the information off-chain and publishes it on-chain in a format contracts can read.

Chainlink is the largest oracle network, using many independent node operators that aggregate data from multiple sources. Pyth, Chronicle, RedStone and UMA are other examples, each with its own model for sourcing and verifying data.

Oracles are a critical point of failure in DeFi. If a price feed is wrong, delayed or manipulated, lending protocols can liquidate healthy positions or let attackers borrow against inflated collateral. Several exploits have relied on manipulating thinly traded on-chain markets that a protocol used as its price source.

Example

A lending protocol reads a Chainlink ETH/USD feed whenever a borrower's position changes; if the feed shows ETH falling below the loan's threshold, the contract allows the position to be liquidated.

Related terms

Latest articles on Blockchain oracle