Skip to content
Jacopo Marcolini
Selected work
Web3NFTEthereumGenerative Art2022

Algorithmic Tokens

A collection of NFTs on Ethereum with one token for each famous algorithm. A script reads the code of the algorithm and draws the token from it: the length, the width of the lines and the hash of the code decide how it looks. I came up with the concept, wrote the generator and the smart contract, and published the collection on OpenSea.

Role
Blockchain Developer & Product Owner
Year
2022
The words Algorithmic Tokens in white next to seven square tokens with colored bars, floating over a cyan wireframe grid that fades into a dark horizon

Code as a collectible

2022 was the year of the metaverse. Brands bought land in virtual worlds, NFT marketplaces traded billions and every company was looking for its way into Web3. The AI consultancy I worked at wanted one too, in a form that said something about its own craft.

Algorithmic Tokens is a collection of non-fungible tokens on Ethereum, one for each famous algorithm, from Hello, World! to the neural networks behind modern computer vision. Nobody draws the tokens by hand: a script reads the source code of each algorithm and derives the image from it, so every token is a portrait of its code.

A collection for an AI company

The project was a business experiment and a way to show what the company knew best. It had to:

Seven algorithms

The first drop holds seven tokens, ordered here from the shortest code to the longest.

Square dark token with a single short orange bar in the top left corner

Hello, World!

The first program almost everyone writes. One line of code becomes a single bar.

Language
Python
Color
#e47801
Bars
1
Square dark token with five green bars, four of similar length and a short one at the bottom

Bubble Sort

The textbook sorting algorithm: it walks through a list and swaps neighbours until nothing is out of order.

Language
Java
Color
#1aa724
Bars
5
Square dark token with six mauve bars, a long one on top and five shorter ones below

Recursive Fibonacci

A function that calls itself to build the Fibonacci sequence, the classic example of recursion.

Language
JavaScript
Color
#a76192
Bars
6
Square dark token with ten violet bars that grow from a tiny one to two almost full-width bars and then settle at medium length

AdaBoost

A machine learning method that combines many weak classifiers into a strong one.

Language
Python
Color
#6d13e6
Bars
10
Square dark token with ten dusty pink bars, four short ones on top and six longer ones below

AlexNet

The convolutional neural network that won the ImageNet challenge in 2012 and started the deep learning wave.

Language
Python
Color
#bf9b97
Bars
10
Square dark token with ten bright yellow bars of medium length, two of them short

GoogleNet

A 2014 network for image recognition built from inception modules, which look at an image at several scales at once.

Language
Python
Color
#f7ff1b
Bars
10
Square dark token with ten deep blue bars of varying length, the third one very short

ResNet

A deep network whose residual connections made it possible to train hundreds of layers, the base of much of computer vision since 2015.

Language
Python
Color
#0938e0
Bars
10
01 / 07

How a token is drawn

The generator turns three properties of the code into three visual rules. Together they make every token unique and repeatable: anyone who runs the same code through the generator gets the same image.

The AdaBoost token, large, with an 80-column ruler above its bars, a brace along the ten bars, and three numbered notes: length on a log scale, width in 80 columns, and the color #6d13e6 from the keccak256 hash of the code
AdaBoost, read through the three rules.

Length

The number of bars follows the length of the code on a logarithmic scale, so a one-liner and a neural network fit in the same frame.

Width

Each bar is measured against the 80 characters per line that most style guides recommend: a bar across the whole token is a full line.

Color

The color is the first six hex digits of the keccak256 hash of the code, the hash function Ethereum itself relies on. Change one character and the color changes.

From script to OpenSea

I took the project from the idea to the marketplace, writing the code at every step.

  1. Pick the algorithms

    I chose a first set that goes from the first program anyone writes to the models the company worked with, in Python, Java and JavaScript.

  2. Write the generator

    A Python script reads each source file, measures its length and its lines, hashes it with keccak256 and draws the token as a square image.

  3. Prototype the contract

    I wrote a custom ERC-1155 contract in Solidity to mint the tokens with their metadata, and deployed it on an Ethereum testnet to try the whole minting flow.

  4. Publish on OpenSea

    For the public release I moved the collection to OpenSea's shared storefront on Ethereum, with a name and description for every token, the collection page and a 3% creator fee.

  5. Bring it to the summit

    The collection gave the company a concrete Web3 project to bring to the Metaverse Summit in Milan in 2022.

Seven tokens on chain

Algorithmic Tokens lives on Ethereum as a collection of seven unique tokens, each one generated from the code it represents. The same generator can turn any other algorithm into a new token with the same rules, so the collection can grow one algorithm at a time.

The seven tokens standing in a row on a cyan wireframe grid, from the single orange bar of Hello, World! to the blue bars of ResNet, each casting a soft pool of its own color on the floor
The full collection, from Hello, World! to ResNet.