Sun, 27 Sep 2026
BTC $84,433 +0.41% ETH $2,688 -0.07% SOL $121.57 -0.12% Mkt cap $2.96T
RSS

Basics

On-chain and off-chain data

Last reviewed 27 Sep 2026 ยท 3 min read

Short answer

On-chain data is information stored on the blockchain itself, secured by cryptographic mechanisms and agreed upon by network nodes. Off-chain data exists outside the blockchain. Smart contracts cannot access off-chain data by default, so oracles are applications that bridge this gap by bringing external information onto the blockchain for contracts to use.

What is on-chain data

On-chain data is information stored directly on the blockchain. This includes transaction records, account balances, and the state of smart contracts. Each block contains data and state stored in consecutive groups. Blocks are chained together cryptographically, with each block referencing its parent. Data in a block cannot change without altering all subsequent blocks, which requires consensus from the entire network.

Sources: ethereum.org

Every computer in the network, called a node, must agree upon each new block and the chain as a whole. This ensures everyone interacting with the blockchain has the same data. Once transactions are verified as valid and added to the blockchain, cryptographic mechanisms ensure they cannot be tampered with later.

Sources: ethereum.org

What is off-chain data

Off-chain data is information stored outside the blockchain network. Examples include real-world events, exchange rates, weather conditions, or any data not stored on the blockchain itself. Smart contracts cannot access off-chain data by default because blockchains are deterministic systems that must produce the same results given the same inputs.

Sources: ethereum.org

The determinism problem

Blockchains require determinism to function. A deterministic system always produces the same results given an initial state and a particular input. If blockchains received information from external sources that could change, nodes would arrive at different results when executing the same code. This would break consensus and eliminate the blockchain's value as a decentralized computing platform.

Sources: ethereum.org

What are oracles

Oracles are applications that source, verify, and transmit external information to smart contracts running on the blockchain. They bridge the information gap between the blockchain and the external environment. An oracle typically consists of a smart contract running on-chain and off-chain components. The on-chain contract receives requests from other smart contracts and passes them to the off-chain oracle node, which queries data sources and sends the data back to be stored on-chain.

Sources: ethereum.org

Oracles can be input oracles, which retrieve external data for use by on-chain contracts. They can also be output oracles, which send information from the blockchain to external applications. Some oracles perform computational tasks off-chain. Different oracles vary based on data sources, trust models, and system architecture.

Sources: ethereum.org

How oracles extend smart contract utility

Without oracles, smart contracts would be limited entirely to on-chain data. Oracles enable hybrid smart contracts that function based on a combination of on-chain contract code and off-chain infrastructure. For example, an on-chain prediction market relies on oracles to provide information about real-world outcomes to validate user predictions. Crop insurance smart contracts can use oracles to determine when certain weather conditions have occurred and trigger payouts.

Sources: ethereum.org

The oracle problem

Using oracles introduces challenges. Data from an oracle must be correct for a smart contract to execute correctly. Having to trust oracle operators to provide accurate information undermines the trustless aspect of smart contracts. Oracles must handle three main challenges: correctness (ensuring data is authentic and unaltered), availability (ensuring data is accessible without interruption), and incentive compatibility (rewarding accurate information and penalizing incorrect data).

Sources: ethereum.org

Official sources used on this page

2.00 sources

Observed 27 Sep 2026, 13:59 UTC Source

Questions

Why can't smart contracts just read off-chain data directly?

Blockchains are deterministic systems that must produce the same results every time given the same inputs. If nodes could pull data from external sources that change, different nodes would get different results when executing the same code. This would break consensus. Oracles solve this by putting off-chain data on the blockchain first, so all nodes see the same information.

Sources: ethereum.org

How does an oracle get data onto the blockchain?

An oracle consists of an on-chain smart contract and off-chain components. When another smart contract requests data, the on-chain contract passes the request to the off-chain oracle node. The oracle node queries external data sources using APIs or other methods, then sends a transaction to store the requested data in the smart contract's storage on the blockchain.

Sources: ethereum.org

What is the oracle problem?

The oracle problem is the challenge of verifying that injected information came from the correct source and hasn't been tampered with, and ensuring the data is always available and updated regularly. Since smart contracts depend on oracle data being correct, and operators must be trusted to provide accurate information, this undermines the trustless principle of blockchain technology.

Sources: ethereum.org

Sources

  1. ethereum.org
  2. ethereum.org

All reference pages Editorial standards