William M. Peaster

Posted on Oct 26, 2023Read on Mirror.xyz

Understanding Onchain NFTs šŸ”—

āœØĀ This post originally appeared in Metaversal on BanklessĀ āœØ


The majority of NFTs store their art and key metadata ā€œoffchain.ā€

Yet thereā€™s growing demand for ā€œonchainā€ NFTs for better permanence and security.

Not sure what makes a project actually onchain, though?

No worries, Iā€™ve got you covered ā€” for todayā€™s post letā€™s go over the different shades of onchain and some example projects and DIY resources to note!

-WMP


The Offchain-Onchain Spectrum

In the NFT ecosystem, metadata storage isnā€™t an either/or question as there exists a spectrum of different approaches, ranging from the entirely offchain to the fully onchain. Each approach has its unique nuances, so letā€™s delve in below.

Offchain

Offchain storage occurs when essentially only an NFT collectionā€™s tokens exists on the blockchain while its core metadata (e.g. trait info) and media (i.e. the art) are hosted externally. This approach is inexpensive and offers flexibility but on the flip side it has the least guarantees with regard to long-term durability, especially if the NFT data is stored in a private server setup rather than via decentralized storage networks like Arweave, Filecoin, or IPFS. At least with these networks, a community can take over stewardship if the original creators close up operations, and these sorts of shutterings *have *happened before with NFT platforms like Ascribe, Digital Objects, Editional, and yes, even FTX. So offchain storage isnā€™t bad per se and is a spectrum in its own right, but itā€™s something to look out for when present with other potential issues, e.g. a centralized and editable smart contract.

Semi-onchain

In non-generative contexts, semi-onchain storage is when a project stores some or most of its key metadata on the blockchain while storing its media content offchain, e.g. on IPFS. In the context of generative art a la Art Blocks, this type of storage occurs when a collection stores its main code (output instructions + input ā€œseedā€ hash) onchain but it still relies on some offchain dependencies, e.g. external code libraries.

Calldata storage

An alternative onchaining technique that eschews NFTs in favor of encoding media within Ethereum transaction calldata. This technique, recently repopularized by Ethscriptions, has been around since 2016 and experimented with by projects like 0xmons, Blitnauts, and beyond. The catch? These encodings are at risk of being wiped amid Ethereumā€™s proposed ā€œPurgeā€ upgrade.

Hashed onchain

This method was famously popularized by Larva Labs, who put it into action six years ago with the original CryptoPunks smart contract. In the creatorsā€™ own words: ā€œWhen we created CryptoPunks in 2017, we linked the composite images of all the punks to the smart contract by storing a cryptographic hash of the image in the Cryptopunks contract. This way, it was clear that the contract pertained to that image, and that image only.ā€

Hybrid onchain

This hybrid approach happens when a project is retroactively brought onchain. In other words, letā€™s say a collectionā€™s original smart contract stores its media externally. Then later the project decides to deploy the collectionā€™s media in a new, separate smart contract to officially archive it onchain. The original contract and the subsequent contract arenā€™t connected directly, but practically speaking they come to live side by side. Examples of projects that have performed this effort are CryptoPunks in 2021 and CrypToadz in 2022.

Fully onchain

The ā€œgold standardā€ as far as token durability goes, this storage method is when all data and media needed to view or reproduce an NFTā€™s content is stored directly on the same chain the NFT was issued on, e.g. Ethereum. This method is powerful because it means the content will be accessible (and composable, interoperable, etc.) for as long as Ethereum exists, i.e. indefinitely. This category can include when projects upload files entirely onchain (e.g. CyberBrokers SVGs) or when projects have their NFT content entirely generated in real time onchain (i.e. ā€œinchainā€) by the Ethereum Virtual Machine, e.g. Runtime Art. This category also encompasses when generative art projects store their code onchain and rely on onchain libraries, e.g. p5js. In the past creating fully onchain art was relatively expensive with regard to gas costs, though in recent times innovators have been devising increasingly affordable ways to affordably mint onchain. Chaos Roads by Chainleft is one such example of the more efficient possibilities here today.


Examples of onchain NFTs

  • šŸ”² Autoglyphs ā€” Created by CryptoPunks creators Larva Labs, Autoglyphs is hailed as the first onchain generative art collection on Ethereum.

  • šŸ‘½ Avastars ā€” Inspired by Autoglyphs, Avastars later became the first PFP collection to entirely store its metadata on Ethereum; it pioneered the method of storing a pingable bank of SVG traits within a smart contract.

  • šŸø Baby Pepes ā€” An animated GIF collection whose odyssey to becoming onchain was conducted and documented by xtremetom, a developer and co-founder of Cool Cats.

  • šŸ—”ļø Loot ā€” If you were around in 2021 you probably remember the text-centric Loot adventurer gear NFTs becoming a sensation, but what you may not know is that the 8,000 pieces were generated directly ā€œinchainā€ by their code and the EVM as no files were uploaded to Ethereum.

  • šŸ¦‰ Moonbirds ā€” An onchain migrator, this PFP collection started out with IPFS storage but later invested into uploading all its trait layers to an Ethereum smart contract, which is now responsible for assembling and backstopping the images.

  • šŸ§® Neolastics ā€” By onchain innovator and creative Simon de la Rouviere, this is one of the first-ever onchain generative art projects and the first to use a bonding curve for NFT minting.

  • šŸ’« Nouns ā€” Nouns DAOā€™s architecture, from its art generator to its governance system, is not only entirely onchain but also incredibly innovative. As RTFKT chief technology officer Samuel Cardillo has previously explained, ā€œ[This] smart contract ā€¦ is out of this galaxy. Just pure perfection. Everything decentralized, onchain, generated in a SUPER clever way.ā€


Making your own onchain NFTs

In the past, if you wanted to create an onchain NFT and didnā€™t have smart contract development skills, youā€™d have to enlist the help or services of someone who did.

Now, though, there are some no-code resources available that creatives can tap if they want to readily mint stuff onchain. For instance, Indelible Labs is one tooling suite that specifically makes it straightforward to drop large NFT collections onchain. A newer release here to note is Efficax by diid, a streamlined interface that allows you to mint fully onchain ERC-1155 NFTs on Manifold.

Additional resources

Zooming out, if you want to get a better sense of the range of onchain projects weā€™ve seen in NFTs to date, check out the Onchain Canon, a great repository that was collectively curated during my time at JPG. Another resource to keep an eye on here going forward is On-Chain Checker by tokenfox. In early access for now, the platformā€™s designed to help you get an idea for just how onchain a given collection is using a five-point scoring system.

Zooming out

The big picture? The shift from a technical niche, requiring intricate knowledge to craft onchain NFTs, towards more accessible, no-code solutions like Indelible Labs and Efficax signifies a democratization of onchain minting.

While NFTs continue to grow in popularity, itā€™s essential to take into consideration not just where their data lives, but how that location might impact their longevity and value. For collectors and creators alike, it's less about choosing a side in the offchain-onchain spectrum and more about understanding the implications of each choice.

As for the implications of ā€œthe fully onchain,ā€ thatā€™s major durability, full composability, and persistent interoperability. And I think thatā€™s a damn compelling combo for us cryptonative dreamers!


Action steps