Jack Allan Kasbeer

← Inventions & Projects

Pacman Gobbles, We Go Up

· nft, dynamic metadata, flask, api, transient labs

On a flat day, Pacman keeps eating. It’s a tiny detail in PWNING N00BS, LOGIK’s portrait of Blur’s co-founder for CoinDesk’s Most Influential 2023. There are two films, and my code has to pick one even when ether hasn’t moved.

ETH up: running Pacman eats ETH.
ETH down: Pacman falls into a blissful bed of clouds.

From a market reading to a film

In the up film, Pacman runs through a 4:5 frame eating ETH. In the down film, he falls asleep in a wide bed of clouds. Both files live on IPFS. The token points to a metadata service I wrote in Flask.

When a viewer requests the metadata, the service looks up ether’s percentage change over the previous 24 hours. A negative reading selects the cloud film. Zero or above selects the running film. The response gives the viewer the matching video and still image. CoinDesk’s Most Influential 2023

Sequence: a marketplace calls tokenURI on the contract and gets a URL; it requests that URL from the Flask metadata server; the server asks CoinMarketCap for ETH's 24-hour percent change and returns green.json if it's zero or above, red.json if below; the marketplace then loads the video from IPFS.
The same pattern as the Ocean Series, with a different data source.

I’d used this arrangement before. The Ocean Series picked an ink loop from a weather report. Here I had about a week before the auction, two films and a different feed. I could reuse the same path from the token to the screen.

The contract in my repo and the one in the auction

I wrote a one-token Solidity contract for the piece. The auction used a Transient Labs creator contract, and that’s where the work was minted on December 1. Its first token points to the same service my draft did. Switching contracts required no changes to either film or to the rule that chooses between them. Deployed contract

There are two ways you might see yesterday’s mood. A marketplace can hold on to an old copy of the metadata, or the server can be unavailable when the viewer asks for a new one. Looking at a cached portrait tells you what the market was doing the last time that copy was fetched.

Artwork © LOGIK.