HelpFormat

Generative art (code-driven)

Publish a single deterministic p5.js / Three.js / vanilla-JS script. Each token's hash is generated on-chain at mint time and rendered in a sandboxed iframe by every marketplace.

How it works

At mint time, the contract computes hash = keccak256(abi.encodePacked(blockhash(n-1), block.timestamp, tokenId, msg.sender, address(this))). That hash is the token's identity - your script reads tokenData.hash as a global, seeds its random number generator from it, and renders unique art for that specific mint. Same hash → same image, every time.

Hosting the script

Two options. Paste the script directly: the contract stores it in chunks (≤16 KB calldata each). Or pass a pinned IPFS URI (cheaper to deploy, depends on the pin staying live). Marketplaces then iframe a generator URL like /gen/[chain]/[contract]/[tokenId] which loads the script and runs it deterministically.

Finalizing

Until you call finalize(), you can update the script (fix bugs, polish parameters). After finalize(), the script is locked - no one, not even you, can change it. Collectors usually want this called before serious bidding starts.

Need a personalised answer?

ChatZilla lives at the top of the Help center. It knows every topic in this center and can walk you through your specific collection, wallet or transaction.

Create