CrypToadz Chained

Every toad up there was drawn by Ethereum, just now.

Those toadz didn't exist until you opened this page. The CrypToadz Chained contract painted each one from a random seed. Reload for a new crowd, or click one to keep it.

Two contracts

Same toadz, a second contract

CrypToadz live in the original contract, which records who owns each toad. Ask it what toad #1 looks like and it hands you a link to Arweave. CrypToadz Chained is a separate contract that answers the same question with the toad itself.

Ask the original 0x1CB1…49C6

tokenURI(1)

https://arweave.net/OVAmf1xgB6atP0uZg1U0fMd0Lw6DlsVqdvab-WTXZ1Q/1

A pointer. Somebody has to keep the Arweave gateway up and serving that file for the toad to show.

Ask CrypToadz Chained 0xE8D8…096A

tokenURI(1)

Asking the contract…

The answer. The JSON and the image are both in the reply, and any Ethereum node can produce it.

The chained contract isn't an NFT collection of its own. It holds no tokens and can't move one. It only implements tokenURI, the one ERC-721 function that says what a token looks like, for the same token IDs. Ownership stays where it always was.

Inside one call

How the contract draws a toad

  1. + Background
    Salmon

  2. + Body
    Ghost Bones

  3. + Mouth
    Beard

  4. + Head
    Brain

  5. + Accessory II
    Short Cigarette

  6. + Accessory I
    Explorer

Each frame above is a fresh call to the contract's builder with one more trait than the frame before. Here's what happens inside every one of those calls:

  1. 1. Stored

    Each trait's art is kept as compact drawing instructions, compressed with DEFLATE and written into contract bytecode with SSTORE2, the cheapest place to park bytes on Ethereum.

  2. 2. Inflated

    A Solidity inflate library unpacks only the traits this toad wears.

  3. 3. Painted

    The traits are drawn onto a 36 × 36 pixel canvas.

  4. 4. Encoded

    A GIF encoder written in Solidity turns the canvas into an image file.

  5. 5. Wrapped

    Image and traits go into a base64 data: URI, which is what tokenURI returns.

The 145 toadz that weren't generated from traits, the 1/1s and the animations, are stored whole. The few toadz Gremplin touched up by hand carry small patches, so the chained copy matches the original exactly.

Proof

Checked against the originals, pixel for pixel

Every metadata file and every frame of every image was compared with the Arweave originals and the IPFS provenance images by two validators written separately: one in Node with pixelmatch, one in C# with ImageSharp.

toadz rebuilt from their traits
6,880
toadz rebuilt from their traits
1/1s and animations stored whole
145
1/1s and animations stored whole
pixels per toad, scaled up without smoothing
36 × 36
pixels per toad, scaled up without smoothing

ERC-4804 · ERC-6860

One link away from fully on chain

Your toad still points at Arweave, because that's the link the original contract gives out. To point at the chain instead, a link has to name a contract rather than a server. ERC-4804 defines that kind of link, the web3:// URL, and ERC-6860 revises it.

web3://scheme0xE8D8C0A6f174e08C44aB399b7CE810Bc4Dce096Acontract/tokenURIfunction/1token ID?returns=(string)read the answer as text
An app that understands this link calls the contract for the answer. No gateway or file host is involved.

If wallets, marketplaces and browsers resolved web3:// links, and CrypToadz metadata pointed at one, CrypToadz wouldn't depend on anything off chain: no Arweave, no IPFS, no gateway. Most apps don't support these links yet. If you build or use one, ask for it.

Make a toad nobody has seen.

Open the builder