COMPARISON

On-Chain vs Off-Chain — What Data Belongs on the Blockchain and What Doesn't

One of the most consequential blockchain architecture decisions is what data goes on-chain and what stays off-chain. Getting this wrong is expensive: on-chain storage is orders of magnitude more costly than database storage, and blockchain data cannot be deleted — which conflicts with data deletion requirements in US privacy laws.

Read time

3 min

Category

Blockchain Comparison

FAQ

3

Quick summary

One of the most consequential blockchain architecture decisions is what data goes on-chain and what stays off-chain. Getting this wrong is expensive: on-chain storage is orders of magnitude more costly than database storage.

Author

ClickMasters Team

Published

2025-06-23

Book a Call

Need a quick expert recommendation?

Get a practical recommendation before you spend weeks choosing the wrong blockchain architecture.

Book a Free Strategy Call

Complete Comparison

On-chain data must be immutable, publicly verifiable, trustless, and read by smart contracts — token balances, ownership records, governance votes, and compliance hashes. Off-chain data is for large files, frequently updated data, personal data (GDPR/CCPA), and private business data. Use the hash pattern: store data off-chain, store SHA-256 hash on-chain.

On-Chain Data: What Belongs There

Data that belongs on-chain has one or more of these properties:

  • Multiple parties must verify it without trusting a central custodian
  • It is part of the financial state of the system (token balances, ownership records)
  • Its immutability is the specific value it provides
  • It triggers contractual conditions (smart contract inputs and state)

Examples: Token ownership and transfer history, smart contract state (DeFi positions, escrow conditions, voting records), event logs from contract execution, cryptographic hashes of off-chain documents (proving they existed at a point in time without revealing contents).

Off-Chain Data: What Does NOT Belong On-Chain

  • Large media files (images, videos, documents): storing 1MB on Ethereum costs $5,000–$50,000 in gas
  • Personal data subject to GDPR or CCPA right-to-erasure requirements
  • Frequently updated operational data (inventory, session state, user activity)
  • Data that only one party needs to verify
  • Private business data (contracts, financials) where public transparency is not desired

The correct approach for NFT metadata: Store the image and attributes on IPFS or Arweave (decentralized, content-addressed storage). Store the IPFS hash in the on-chain token metadata. The blockchain provides provenance; IPFS provides persistence.

The correct approach for document authenticity: Store the document in encrypted off-chain storage. Store the document's SHA-256 hash on-chain with a timestamp. Any party can verify the document has not been altered since the timestamp by recomputing the hash.

Cost Comparison

Data TypeOn-Chain (Ethereum L1)IPFSArweave (permanent)AWS S3
1KB text
$0.05–$5.00Free (with pinning: $0.0001)~$0.0000001$0.000000025
1MB file
$50–$5,000$0.0001~$0.0001$0.000025
10MB file
$500–$50,000$0.001~$0.001$0.00025
Ongoing cost
NonePinning: $0.00001/GB/monthNone (permanent)$0.023/GB/month

The GDPR and CCPA Problem

Blockchain data is permanent. GDPR Article 17 (right to erasure) and CCPA Section 1798.105 (right to delete) require businesses to delete personal data on request. If you store personal data directly on a public blockchain, you cannot comply with these requirements. The solution: store personal data off-chain, store only a hash or encrypted reference on-chain. If erasure is required, delete the off-chain data. The on-chain hash becomes meaningless without the original data.

Frequently Asked Questions

Questions founders ask before choosing a blockchain stack

Clear answers to the most common technical, business, and implementation questions around this comparison.

3

Answers

Can I store images directly on the Ethereum blockchain?

Technically yes; practically never. A 1MB image stored on Ethereum L1 would cost $5,000–$50,000 in gas. Use IPFS for images with an on-chain reference hash.

Is IPFS the same as on-chain storage?

No. IPFS is a decentralized content-addressed file system. Files stored on IPFS are not on a blockchain — they are stored on IPFS nodes that volunteer to pin the content. For permanent, incentivized decentralized storage, Arweave provides a one-time payment for permanent storage with an economic guarantee.

What data should an NFT store on-chain vs off-chain?

On-chain: token ID, owner address, transfer history, royalty recipient and percentage (EIP-2981). Off-chain (IPFS/Arweave): image file, metadata JSON (name, description, attributes). The on-chain token points to the IPFS/Arweave URI for its metadata.

Frequently Asked Questions

Questions founders ask before choosing a blockchain stack

Clear answers to the most common technical, business, and implementation questions around this comparison.

3

Answers

Can I store images directly on the Ethereum blockchain?

Technically yes; practically never. A 1MB image stored on Ethereum L1 would cost $5,000–$50,000 in gas. Use IPFS for images with an on-chain reference hash.

Is IPFS the same as on-chain storage?

No. IPFS is a decentralized content-addressed file system. Files stored on IPFS are not on a blockchain — they are stored on IPFS nodes that volunteer to pin the content. For permanent, incentivized decentralized storage, Arweave provides a one-time payment for permanent storage with an economic guarantee.

What data should an NFT store on-chain vs off-chain?

On-chain: token ID, owner address, transfer history, royalty recipient and percentage (EIP-2981). Off-chain (IPFS/Arweave): image file, metadata JSON (name, description, attributes). The on-chain token points to the IPFS/Arweave URI for its metadata.

Need Help with Blockchain Data Architecture?

Get expert guidance on designing on-chain and off-chain data storage.

Book a Free Strategy Call