Completely “on chain” stored NFTs— what?

Alex | @ruttkowa
7 min readSep 25, 2021

Interesting CNFT projects, pushing the limits of what I’ve seen so far.

In April I published a story about NFTs made within the Cardano blockchain ecosphere. Back then we had the launch of SpaceBudz and many more projects ready to take off. But this was just the begining..

Projects pushing the limits

Since the launch of native assets for the Cardano blockchain I’ve seen a few more projects, pushing the boundaries of what’s possible.
Some of them even implementing on-chain NFTs without being dependend on IFPS.

How you might ask? Let’s take a brief recap of how NFTs work in Cardano before I start to introduce you to my personal selection of interesting projects.

Native assets in Cardano

Cardano features a unique ability to not only keep track of the “official” currency ada but also of custom tokens, so called “native assets”.

Everyone can come up with their own token(s) and set conditions for creating and destroying them, without the need of smart contracts.
Those conditions are specified in a publicly availiable, so called policyID.
Additional NFT metadata attributes like a description or a link to an image can be attached to a token while it’s being created.

Wallets or third party tools can now look up the initial transaction with which a token got created and query any needed information.

Many NFTs are image based. But storing a whole image on a blockchain (or “on chain”) would be quite expensive as the fees are based on the amount of data which will be stored.
So most of the time another project called IPFS is used to store the image(s) of a NFT.
IPFS, in a nutshell, is another blockchain but for big files. Your uploaded files get assigned a unique identifier and are stored immutably, forever…or until the IPFS project ceases to exist.
This identifier will then be referenced in the metadata information of your native asset.
Therefore most of the NFTs we see have a dependency to IPFS.

While this is a good solution for most of them everyone working in IT might agree with that the lesser the dependencies the better.
But if IPFS someday will cease to exist probably 99% of all NFTs will be worthless because the artwork is no longer there.

Just like a broken hyperlink.

But I’ve seen some creative ways to combat such a dependency.

Projects

All of the project try to tackle the problem described above in a unique way.

1. unsigned_algorithms

Example of an Unsig #11003
Unsig #11003

Website: https://www.unsigs.com
Creator: Alexander Watanabe

What are they about?

As I’ve written above, the majority of NFTs have a dependency to IPFS. The Unsigs collection are the first NFTs I discovered which do not have this dependency.
A collection, inspired by the works of Sol LeWitt approaches the same mindset of having a set of rules and a framework which can be used to generate art in multiple fascinating ways.

How do they work?

Each unsig NFT holds a “recipe” or as the creator likes to call it: a sheet of music. Everyone can recreate the image, given a specific and known environment.
If we stick to the metaphor, we just need an orchestra to play it.

All of the needed data to construct the images and for the orchestra to play is stored completely on chain in the token metadata.
Let’s take a look at it:

Transaction metadata from unsig #11003

As you see there are some attributes or properties like the colors, distributions or multipliers.
With those attributes you are able to create the typical unsig from scratch.

But what about the orchestra?
How do we know what kind of instruments we need?

That’s what the first unsig#00000 is for. This NFT holds the blueprint to the environment you need to recreate in order to build the image from scratch.

The creator even made a youtube video and hosted a written manual in his github repository if you want to give it a go yourself.

2. Stellar Hood

Website: https://stellarhood.com
Creator: TurboEgon

What are they about?

The Stellar Hood project introduced interactive NFTs (yes you can click on them) while also being fully on-chain, just like the unsigned_algorithms.
It features planets and their corresponding attributes found in our galaxy known so far.

You can check out the working example here on pool.pm.

How do they work?

If we take a look into one of the assets metadata we see immediately two big chunks of data, each encoded in a base64 string.
The smaller data is set in the key of the metadata and holds a SVG image to be displayed as a thumbnail.

Excerpt from Stellar Hood #80 metadata from the minting transaction, describing the thumbnail image

The stellar part (pun intended) is in the larger section under files, with the attribute src.
It’s too big to be posted here, but you can look it up in the minting transaction.

Decoding this big base64 html string, we are greeted with some great JavaScript engineering inside a HTML document.
It’s used to build and construct each individual interactive token, feeding off of different inputs and attributes.

So it’s basically a little website / HTML document containing the code to built the interactive token.
Using the base64 standard to encode everything (to make it more safe to store in the metadata), Egon was able to put all of the contents inside one single minting transaction.
And while this is not enough to come up with, everything had to fit into the maximum file size of a transaction: 16KB.

That’s some impressive coding if you ask me.

3. Cardano Trees

Cardano Trees Demo 04

Website: https://cardanotrees.com
Creator: Cardano Trees

What are they about

Instead of being interactive and clickable these NFTs seem to be just an animation of some trees. But there’s more to it.
The trees have different characteristics and attributes impacting their behavior.

How do they work?

Cardano Tree NFTs apply the same techniques and approaches as the Stellar Hood project.
Again the main source file is a HTML document with javascript, shrinked and encoded with base64 to fit in a 16KB transaction.

If you want to, you can decode the data yourself.
This works for the Cardano trees as well as for the Stellar hood tokens.
All you need is a text editor and a browser.
Here’s an example if you want to follow along.

The metadata for the Cardano Tree CT4171is specified in the transaction:
8e48918fe5d99bd91b76866bea85d9ed7122ba03a83d38d4abedfd22e697924b

If we take a look at the metadata and the image value (which serves per definition as a thumbnail) we get this code:

Just copy the big chunk of base64 into a empty text document.
Then, to properly display it, remove:

  • the line containing the text “image: [
  • the commas at the end of every line
  • the double quotation marks at both ends of the line
  • the “],” at the end of the line

If you did everything you should be left with something looking like this:

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyODAiIGhlaWdodD0iNDUwIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjN0I2OEVFIi8+PGNpcmNsZSBjeD0iMTQwIiBjeT0iMTQwIiByPSIxMjAiIGZpbGw9IiNGRkQ3MDAiLz48dGV4dCB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBzdHlsZT0iZm9udDo4MDAgMjRwdCBzYW5zLXNlcmlmIiB4PSIxNDAiIHk9IjQxMCI+Q2FyZGFub1RyZWVzPC90ZXh0Pjx0ZXh0IHRleHQtYW5jaG9yPSJtaWRkbGUiIHN0eWxlPSJmb250OjgwMCAyNHB0IHNhbnMtc2VyaWYiIHg9IjE0MCIgeT0iNDQwIj4jNDE3MTwvdGV4dD48cGF0aCBmaWxsPSIjRkYxNDkzIiBkPSJNMTM0IDM4MHExMi00OSA2LTE1NS0yMS0xMDItMTA1LTM4IDIxLTIyIDQ2LTI5LTE1LTgtMjMtMzYgMTUgMzMgMzAgMzQgNDEgMiA1NiA2MiA4LTM5LTIyLTE0MSAxMSAyMyAxNiA0MiAxNi0zOCA5OC00MS05MSAxMC05NCA0NSAwIDMxIDEyIDc2IDIzLTM0IDk1LTQ3LTkxIDI0LTk0IDYwIDIgMTA4IDE5IDE2OHoiLz48L3N2Zz4K

Just paste this code into your browser URL bar, hit enter and you should be greeted with the thumbnail of the CardanoTree #4171.

Conclusion

So after taking a look behind the scenes are those NFT projects really completely on-chain?

This obviously depends on how you define on-chain.
For me, on chain would mean that I have the ability to recover / restore them from scratch.

The unsigs kind of achieve my definition as they have minted a manual on how to restore them as well. So the instructions are on chain as well. Given the ability to research, one probably could re-generate the images any time in the future.

For projects like Stellar Hood or Cardano Trees an instruction is missing.
But they rely on a technique embedded in most if not all popular browsers. So rather than having an explicit guide on how to re-create the images those projects rely more on current conventions and browser standards.

That being said I definitely see both techniques as being completely on-chain, although having dependencies to third party software, wether it’s a python development environment or a browser.

I hope you enjoyed this little glimpse behind the scenes of what actually makes those projects so fascinating, as I’ve never seen this technique being used before.

What projects am I missing? Let me know, either in the comment section or @ me on twitter!

--

--

Alex | @ruttkowa

Munich Metal | Cardano Ambassador | I want to show how tech can help you | 🇩🇪 & 🇬🇧