On-Chain NFT

An on-chain NFT is an NFT whose complete artwork and metadata are stored entirely within the blockchain smart contract itself — as opposed to storing only a pointer (URL or IPFS hash) that references external storage — making the art genuinely permanent and censorship-resistant as long as Ethereum continues to operate, since no centralized server or IPFS node needs to remain live for the NFT to be visually accessible.


The Problem with Off-Chain Storage

Most NFTs do NOT store their artwork on-chain. Instead, they store:

“`

tokenURI → https://someserver.com/token/123.json

“`

Which contains:

“`json

{

“name”: “My NFT #123”,

“image”: “https://someserver.com/images/123.png”

}

“`

What happens if someserver.com goes down?

  • The image URL returns 404
  • The metadata is lost
  • The NFT is an on-chain token pointing to nothing
  • Collectors call this an NFT “going dark”

What if the IPFS hash is referenced instead?

Better — IPFS is content-addressed (the hash references the content, not a location). But:

  • Someone must be “pinning” (hosting) the IPFS content
  • If all pinners stop, the content becomes unavailable
  • IPFS is more permanent than centralized servers, but not guaranteed permanent

On-Chain Storage — How It Works

On-chain NFTs store everything in the contract:

Option A — SVG data:

The contract generates SVG (Scalable Vector Graphics) code in real time based on the token’s attributes. When queried, the contract returns a base64-encoded data URL:

“`

data:image/svg+xml;base64,[encoded SVG]

“`

No server needed — the image is generated from code when requested.

Option B — Compressed pixel data:

Small images (like CryptoPunks’ 24×24 pixels) can be stored as raw pixel data in the contract.

Option C — Algorithm:

Art Blocks stores the JavaScript algorithm in the contract. When viewing, the website runs the algorithm with the transaction hash as a seed to regenerate the image. The image is always reproducible from the on-chain data.

Why On-Chain Matters

True permanence:

  • As long as Ethereum runs (indefinitely expected), the art exists
  • No company needs to maintain servers
  • No subscription fee to keep content “live”

Censorship resistance:

  • No domain owner can take down the art
  • No government can send a takedown notice to a server
  • The art exists in a distributed ledger, not a server

Authenticity:

  • The art cannot be swapped (a common attack on off-chain NFTs where server operators replace the image)
  • What you see is what was minted, immutably

Major On-Chain NFT Collections

Collection Storage Type On-Chain Since
CryptoPunks Pixel data in contract 2017
Autoglyphs SVG generation in contract 2019
Art Blocks (Curated) JavaScript algorithm in contract 2020
Nouns SVG parts in contract 2021
Checks – VV Edition On-chain SVG 2023
Loot Text in contract (SVG) 2021

The Cost of On-Chain Storage

On-chain storage is expensive:

  • Ethereum storage costs gas proportional to data stored
  • Storing 1KB of data costs significant ETH
  • This is why most NFTs use off-chain storage — cost
  • Art Blocks handles this by storing code (small) that generates images (large) rather than the images themselves

History

  • 2017 — CryptoPunks stores pixel data on-chain; one of the first NFTs with genuine on-chain art
  • April 2019 — Autoglyphs: first dedicated on-chain generative art; algorithm stored in contract
  • November 2020 — Art Blocks establishes on-chain algorithm model for generative art; stores JavaScript that generates images
  • 2021 — Nouns stores all SVG parts on-chain; makes on-chain art a community value
  • 2021 — Loot stores text items on-chain as SVG
  • 2022–2024 — On-chain art becomes a distinct collector category; “will it survive 100 years?” is the defining question collectors ask; on-chain storage commands a premium

Common Misconceptions

  • “IPFS NFTs are on-chain.” — IPFS stores data in a distributed network, not on Ethereum. IPFS is better than centralized servers but is not “on-chain.” On-chain specifically means stored within the blockchain’s contract state.
  • “All Art Blocks NFTs are on-chain.” — Art Blocks Curated series stores algorithms on-chain. Art Blocks Playground and Factory series have historically mixed approaches. Check individual project pages for storage specifics.

Social Media Sentiment

  • X/Twitter: On-chain storage is highly valued in the serious NFT art collector community; “is it on-chain?” is a quality question applied to evaluating new projects; Nouns and Art Blocks are the canonical references.
  • r/CryptoArt: On-chain storage is considered a mark of quality and commitment; off-chain storage is viewed as a risk factor.
  • Developer community: On-chain art engineering is technically interesting; smart contract developers who specialize in on-chain art generation are respected specialists.

Last updated: 2026-04


Related Terms

See Also

  • Art Blocks — the canonical on-chain generative art platform; the gold standard for on-chain NFT storage
  • Autoglyphs — the first dedicated on-chain generative art on Ethereum; the historical precedent for the on-chain art movement
  • NFT Metadata — the broader topic of how NFT data is stored; on-chain storage is one end of the spectrum

Sources