The Making of OnChain Monkey

Danny Yang
9 min readSep 16, 2021

In November 2020, my wife and I went to the emergency room with our newborn daughter who weighed less than six pounds. Her eyes had turned a canary yellow and jaundice was spreading across her body. We rushed to the ER despite the fact that COVID cases were surging in the area. At the ER, only one parent was allowed to enter, and my wife, tired and sore from giving birth three days earlier, ended up having to wait in the car. At that moment, I felt a terrible knot in my stomach cradling my daughter and listening to her cry.

That experience brought home for me how tenuous, fragile and precious life can be and how something tiny can become the focal point for your world. It made me realize the responsibility we all share to protect the future of the planet and our society for my daughter.

The rise of COVID helped me to see the trouble we are in as a society with exponential problems. This class of problems includes things like ecological collapse, climate change, and global pandemics. Exponential problems have two very distinct phases, in the early phase there’s a very small effect that’s easy to dismiss, especially if there are economic benefits to some people who prefer the status quo. Once the problem starts being felt, it’s often growing so quickly that it’s too late to stop it. Our ways of understanding the world, making decisions, social and economic incentives and how we live are all demonstrably incapable of meeting these challenges.

What this incident showed me is that if we aren’t able to come up with new ways to address exponential problems, we are hurtling towards catastrophe. We need fundamental change in the structure of incentives for social benefit and future generations, like my daughter.

At Nfinita (company soon to be named MetaGood), we want to find a way to address those problems. We have the belief that we can use crypto to incentivize doing good. In 2018, Bill Tai was able to do real world good with an NFT named Honu Kitty. This year, our team had been working on a bunch of different NFT ideas around animals — birds, bears, robots animals, and in a bunch of different styles. We wanted to create an NFT collection as a platform to incentivize doing good. For this collection to work, it had to stand out and be unique. Yet we also wanted to fit within the 10k PFP collection format that people understood and appreciated. But there have been so many already, and many good ones too! So how was this possible?

Many people appreciate NFTs because they are a combination of art, technology, and finance. On the technology side, an NFT is written on the blockchain, and the blockchain can record the NFT basically forever. A typical NFT has an image and traits describing the image (combinations of traits usually determine “rarity”) called metadata. Many NFTs actually do not store either of these on the blockchain, but only store a pointer to an off blockchain storage location. Sometimes the data for the NFT is actually stored on a centralized server, so if someone turns off the server, the NFT is rendered useless and effectively erased! A much better approach is to store the data on a decentralized service like IPFS. However, this is separate from the blockchain, so there is still a risk that the storage location may not continue to store the data.

The truly secure and long lasting NFT is all on chain. All metadata and images are stored on chain. There are only a handful of 10k PFP NFT projects that have achieved this on chain status. One reason is that it’s expensive to do all on chain. Projects that are on chain required many transactions to load all the data and come at a high cost.

For this project, we wanted all on chain, a small footprint on the chain, and good design! This presented a bunch of problems. First was the design. How can we draw something interesting in limited space and limited tools? I had been playing around with SVG because I thought Art Blocks was pretty cool. I knew that PFPs had to be relatable to a person, so the face needed human features. That’s why BAYC is such a great collection. I played with circles and drew a bunch of different faces before I settled on the face you see in OC Monkey. I picked a monkey because it’s a primate and very relatable to us, like apes. Also because monkeys have a certain vibe. Monkeys monkey around and love monkey business. Doing good should be fun!

Work in progress. Experimenting with shapes and lines.

Next was figuring out the different feature combinations, the number of traits, and the rarity distribution. Here I wanted to pay tribute to BAYC (South Park was another look I had in my head — and wouldn’t it be cool if South Park featured an OC Monkey one day?). I modeled the number of attributes and the general distribution after BAYC. One major difficulty in this medium was that I had a bunch of different color combinations, and I had to make sure that when they were combined randomly, the design still worked. If the same colors meet from two different features, it could totally screw up the look!

For the earrings, the diamond earring is the rarest, and the difference in RGB value is very small. This was done on purpose. You have to look closely to appreciate the difference in some of the features.

The eyes were quite hard to do. I knew eyes were going to be important. My first version was just two big symmetric circles. They didn’t look special, and it was impossible to do nearly two dozen variations. Then I switched to two tone eyes, but that didn’t work either. It took a bunch of versions to get to the final form. And like with the diamond earring, the difference in eye colors for some are only clear up close, and this was on purpose.

Removing the black lines was better for the design, but made the color choices harder.

The mouth was the most fun to draw. Especially tweaking the unshaven look. Here also, before the final version, there were a bunch of failed designs. Particularly with color conflicts between all color combinations of the mouth and the bordering fur (I started with a 2 tone mouth, like I did with the eyes).

I thought clothes and hat would be the easiest. In my mind I was thinking about a circus monkey with a red hat and red vest. I could pick two tone colors different from the fur, so this didn’t involve the complexities of the face. The final touch was the nipples of the shirtless monkey. That was the last detail that I added. I didn’t think of that when I was doing the fur. But when I got to the clothes, I realized that a solid color on the body just looked like a shirt (without the pocket). When I was stuck on this, I went to look at the BAYC ape without the shirt. That didn’t help (no nipples there). I googled “cartoon monkey” and none of those had nipples either. They all used two color tones, so I tried that with a smaller rectangle. That did not look good! It just looked like a random box at the bottom of the image. When I finally did try drawing nipples, I knew instantly it was the finishing touch for the design! (And speaking of rarity, outside of porn, how often do you see nipples anywhere?)

While I was doing all the design, I was also trying to keep the size of the program small so I could do it in a single transaction. I was compiling the smart contract constantly and checking the size. There was also the part about creating a 10k collection with rarity traits. This was more a computer science problem, and I used a relatively straightforward approach, so much easier in my opinion than figuring out the art design. (In computer programming, debugging often is the most time consuming part, and towards the end, after I thought I had the finished code, I ran into a strange bug. I tested the contract on testnet, and all seemed correct, but when I tried to view it on OpenSea, the image and metadata wouldn’t load. I banged my head on this for two days, comparing the code character by character, and didn’t see anything wrong. I reread the metadata standard documentation to see if I somehow misunderstood something. Nothing. So what was it? The code was correct! OpenSea wasn’t showing it correctly until much later. Another issue I ran into was that the first time I tried to deploy on ethereum mainnet, I wasted over 0.6 ETH in gas, and the contract failed to deploy! I almost didn’t try again.)

Finally, I had the thing working with the 10k collection and the design. However, because I could generate all this within a contract, I wanted to do one better. I had the idea I wanted to call the collection the Fortune Monkey. Using the metadata, I mapped on an additional 171 word phrases so for each monkey, I could also generate a unique fortune (like in a fortune cookie). I thought that would be hilarious. But the “Fortune” feature bloated the contract too much, so I cut it out. Fortunately, the metadata for OC Monkey is all on chain and readable with the getAttributes call. Someone else could create the Monkey’s Fortune NFT that uses the OC Monkey contract metadata and have each OC Monkey tell a unique fortune. Hopefully people will tip the owners of the OC Monkey! And the hope is that the OC Monkeys themselves will be generous in giving to others!!! We want to incentivize doing good and create a whole new giving economy around this project to try to address in some way the exponential problems facing our society.

Just like my experiments to create the initial OC Monkey smart contract, this whole NFT community and economy building that is happening now, and will continue to happen around OC Monkey and crypto overall, is going to be a series of experiments. We want to create a new economy of giving and doing good. We want to create communities of interest who are incentivized to do good in the world. We don’t know what the right incentives are now, or possibly ever. What we do know is that we want to fight fire with fire. The growth rate of crypto, the advancement of blockchain technology, and the reach of tokenized economies all have exponential effects, and we can try to harness that in some way to bring us closer to solving our exponential problems.

That’s it. We hope you liked the making of OnChain Monkey, a 10k PFP NFT collection, all on chain, and in a single transaction! We hope monkeying around can help us grow community, give back to society, and find new solutions.

Monkeying around with the input data

Links for the project:

Discord. Twitter. OpenSea.

--

--