In this track: Tokens and digital ownership
intermediate · 3 MIN READ

Onchain versus offchain metadata

Find which parts of a description depend on the chain and which depend on another service.

LET’S PICTURE IT

A museum can engrave a label beside an exhibit or keep the description in a separate online catalog.

SEE IT FOR YOURSELF
A valid counter call, step by stepStep 1 / 4
A valid counter call, step by stepFunction requestincrement()No argumentsBefore executionstored count0A local teaching example with a defined starting stateIncoming callCheck function dispatchCheck coded conditionsRules passConditions passContinue executionA failed check can revert insteadCalculation0 + 1Result: 1Storage writecount = 1Persists if call succeedsCalculating a local value and storing it are separate stepsPersistent statecount1Later readGetter reports 1No new incrementState, logs and browser display have different roles

This example begins with count zero and a request to call increment(). No real contract is deployed.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Onchain data has a protocol context

Data stored or generated by contract execution can be checked with the relevant chain state and code. It comes with resource costs and still needs a display format to be useful to a person.

Offchain references add dependencies

An external metadata URL can depend on a server, storage network or publishing policy. It may be fast and flexible while introducing availability or control assumptions.

Mixed systems are common

A token can store a reference onchain while the referenced document stores media links elsewhere. Saying “the URL is onchain” does not mean every byte of the media is stored in Ethereum state.

Draw the retrieval path

Trace contract to metadata document to image bytes. At each step, ask who can change it and how someone can retrieve it. This is more informative than treating onchain and offchain as universal quality ratings.

QUICK CHECK · NO PRESSURE

If a contract stores a web URL, are the image bytes automatically stored onchain too?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.