John Palmer

Posted on Dec 14, 2021Read on Mirror.xyz

On-chain SVG

The reason on-chain SVGs matter is not why most people think. It's not just that they live on-chain with no dependencies, or that they have stronger guarantees of being around for a long time.

On-chain SVGs matter because an on-chain render function makes an NFT dynamic. Not in the sense that the asset itself contains animations, but rather - an on-chain render function can make the same item appear differently over time. The same way javascript turned websites from read-only documents into interactive ones, on-chain SVGs turn NFTs from static assets into living digital objects.

An item whose render function generates an SVG each time it's called doesn't need to return the same thing every time. The NFT itself can read any on-chain data and use it to decide how it should appear to its owner in the moment. It can look up relevant state changes, user actions, and external activity, and then display them either as literal information or as abstract visual characteristics. This allows the NFT to provide much stronger affordances to its holder as to its functional purpose.

This kind of dynamicism is really what makes on-chain SVGs so important. They take seriously the idea that NFTs are not just static media, but living digital objects we can use for all kinds of things online. As more people learn to build digital objects in this way, we'll accelerate towards a world where our understanding of NFTs today looks as outdated as the web before javascript.