What I learned from building an on-chain ecosystem for CryptoPunks
I couldn’t tell whether I was early or late when I first got into NFTs back in June, but I got hooked pretty fast. Within a week, I went from buying my first two CryptoKitties for 0.01E to buying a Hashmask for 0.5E to picking up a CryptoPunk from the floor at 15E. One of the first resources I came across was OpenSea’s Non-Fungible Token Bible, and when I read about CryptoPunks likely being the “best candidates for true digital antiques”, something just clicked. That doesn’t mean it was an easy decision. Until earlier this year, I had never even traded crypto currencies, so spending $34k on a 24x24 image felt like a crazy risky investment, and I was literally sweating when I pulled the trigger.

During the JPEG Summer that followed, I started to grasp the full potential of the technical and cultural revolution that we’re about to witness, and realized I couldn’t just watch from the sidelines; I had to be a part of building this future. I played around with p5js for a bit, but with a background in software engineering, it was only a matter of time before I would end up spending my weekends and free evenings looking at Solidity.

In the meantime, Dom Hoffmann had unleashed Loot unto the world, with new derivative projects popping up every day. There was clearly a spark of genius in this idea of dropping a collection without any artwork, functionality or roadmap, with each NFT being nothing but a bag of raw properties, leaving it to others to build the entire ecosystem on top of it. However, once you understand the core concept, you may start to wonder why we even need these new property bags at all. Surely, the metaverse is more likely to be populated by punks, apes or cats than by wizards, warriors and elves, and all these communities will coexist heterogeneously rather than in isolated silos? Is a divine robe inherently more valuable than a hoodie just because it doesn’t come with a visual representation? What’s the benefit of using 8 random numbers as a seed for generative art compared to just using the random traits of your profile picture? Why not just build on top of the communities that are already out there?

There are two potential arguments that stand out. First, the legal issues and concerns around intellectual property. We may be building towards a decentralized world, but most projects still have a core team behind it. These are the people who set the rules, who own the IP, who control the Discord, who publish the next version of the roadmap, who decide what is and isn’t an official collaboration. They might even file a DMCA with OpenSea or sign a deal with Hollywood. So while they can’t take down your derivative contract once it’s published on the chain, in theory they could come after you IRL. You don’t need to worry about any of this when building on top of Loot.
The other nice thing about Loot is that all metadata is generated and stored on-chain. This may sound like the kind of thing only Autoglyph owners obsess about, but as a Solidity developer, there is something magical about the idea that you can do everything within the contract itself. No need to use IPFS, no secret reveals, strictly speaking you don’t even need a website. And of course it’s easier to build interesting new functionality on top of an existing contract if it doesn’t have any external dependencies. It’s great to see CrypToadz being released as a public domain project, but the algorithm that actually generated these 6,969 images hasn’t been released, so say you want to generate new toads with different combination of traits, you’re going to have to do a lot of reverse engineering or come up with your own algorithm and artwork.

This used to be the state of the world for CryptoPunks as well. When they were originally released in 2017, only a hash of the master image containing all 10,000 punks was stored on-chain. This has led to some criticism over the years, which to be honest was mostly academic in nature. Sure, in theory all digital copies of the master image could get lost over the centuries, and in theory future generations could challenge the convention of the punk in the top left corner being #0 and the one on the bottom right being #9999, but the chances of this actually happening get smaller with every single punk sale. Still, it was a really interesting move when Larva Labs deployed a new contract for on-chain CryptoPunks that could generate attributes and images for all CryptoPunks on the blockchain itself.

The really interesting thing about the new CryptoPunksData contract is that it provides valuable insight into how the original CryptoPunks images were likely generated. It may appear rather trivial to just compose the layers of pixels for each attribute, but in fact there are a lot of additional constraints. If you are familiar at all with CryptoPunks, you know that some attributes only occur for either male or female punks, while other attributes can occur for both but may be rendered differently. You may be aware that apes can have hats but no hair, and that there are no zombies with clown hair. But have you considered the fact that a medical mask is in the same attribute category as cigarettes and pipes? That males can only smile or frown because they can’t have lipstick? And that a clown nose is always rendered on top of everything else?
So now the CryptoPunks color palette, the compositing rules, and the pixel assets for each attribute are available on-chain. That means that, at least in theory, you can deploy your own derivative contract that generates punks on-chain, and either follow or deliberately break some of the constraints that apply to the original CryptoPunks. In practice, it’s not that easy, because most of the internal data isn’t exposed as public contract functions. So while you can dig into the Larva Labs contract, do some reverse engineering and figure out what the pixels are for each attribute, you can’t just query the contract on-chain to get that information on the fly. In order to do that, you would need to re-deploy a similar contract that publicly exposes more of the internal data and functions. Which is exactly what I ended up doing.

Now, if you’re new to web3 and hoping to launch a successful NFT project, building yet another punks derivative is probably not the best idea. But for me personally, being invested in CryptoPunks, seeing the potential of Loot-like projects, and now having the possibility to build everything on-chain, this seemed like the perfect opportunity to dig deeper into Solidity. I set off on this journey with three clear principles in mind: optimize for learning rather than profits, try to keep everything on-chain, and aim to add value to the existing ecosystem and community rather than just ripping off the original.
Welcome to the Lost Punk Society
The first thing I wanted to explore was what breeding for CryptoPunks would look like. I’m not talking about yet another babypunks project here, but breeding in the sense of CryptoKitties, where you need to own both parents in order to mint children. The core idea was to treat the original CryptoPunks as generation 0 but also allow inter-generational breeding as long as the parents are not closely related. You need both a female and a male punk to mint children, and no punk can ever have more than two children. The traits for the children are generated in a pseudo-random way based on the traits of both parents. By keeping minting free for first generation children, my hope was that CryptoPunk owners would be able to make some money by selling their child punks, while anyone buying into the ecosystem would feel a tangible connection to the original CryptoPunks with provable provenance in the shape of a family tree (parent IDs are stored as attributes in the metadata).

Key lessons learned? First, while CryptoPunk owners tend to be familiar with Etherscan and minting through contract, they also tend to be paranoid when it comes to connecting their punk-holding wallets and interacting with unknown contracts. In retrospect, it’s a small miracle that I actually managed to convince those first few people to trust me and mint the first children (I couldn’t even mint 1st generation children myself as I only own a single CryptoPunk). With only 3,840 female CryptoPunks to begin with, and less than 1,000 wallets owning more than a single punk, it ended up being harder than I anticipated to gain some traction, and three weeks later there are still only 21 lost punks minted. Good thing the blockchain lasts forever.

The second lesson I learned was that people are actually reluctant to sell their children — who would have known! If you’re targeting an elite audience of multi-punk owners, you may actually not need to worry so much about the initial mint price (which was free in this case), but you should consider the fact that these may not be the kind of people looking to make a quick 0.05E profit. Many new projects would be happy to see a 0.5E floor price, but in this case it just means new people aren’t buying into the project and we’re not seeing any later generation minting.
Bring in the clowns
For my next experiment, I wanted to shake things up a little. While people generally responded well to the idea of mixing traits on-chain, some also seemed to miss the element of surprise that you get from a more random mint, and others felt that it would have been better if the lost punks looked more different from the original CryptoPunks. With the lost punks contract, I had strictly applied the same constraints as Larva Labs originally used, but because I had deployed my own helper contract, it was relatively easy to add additional attributes. This new project allows you to generate a clown version from your CryptoPunk by randomly assigning clown attributes while adding a few more color options.

Now there is still a clear connection between the original CryptoPunk and its clown version (with provenance stored on-chain), but you no longer need multiple parents to mint and most clowns look very different from the original CryptoPunks. If you own a CryptoPunk, you can mint its clown for free. Once the public sale opens, anyone will be able to mint clowns from unclaimed punks, but half the cost of minting will automatically be transferred to the address that owns the original CryptoPunk. This might not be much, but it’s yet another attempt to add some value to the existing ecosystem while building a tangible connection between OGs and new entrants.
The key lesson I learned here is how much I hate shilling and how bad I am at marketing. With less than 200 followers on Twitter, a zero marketing budget, and dozens of competing projects launching each day, where do you even start? The only real tool I had was the ownership of my CryptoPunk and the access it provided to some exclusive channels like metalink.com and the Larva Labs #cryptopunks discord channel. And this even works, kind of. Every time you share a link to your discord, a few people might join, and occasionally you might even convince a CryptoPunk owner to mint a clown for free. The problem is it makes you feel dirty and cheap. I don’t think I could ever resort to spamming people in DMs, but at times it felt like what I was doing was just as bad.

HivePunks ⬡⬢
Initially, I was planning to open the public sale for Clown Town Society about two weeks after opening up the free pre-mint for CryptoPunk owners. But now I’m thinking I might want to wait until at least a few more punk owners have minted their clown, maybe we can get it to 100 or something? In the meantime I might also add a basic front-end website for it after all(*). One interesting dynamic is that you pick the punk you want to mint a clown for, rather than it being assigned randomly. But it will cost more to mint a clown from an alien, ape or zombie than from a human punk (unless you own the original punk in which case it stays free). While this minting process is different from what we are commonly used to, it is actually easier to implement.
For my final experiment, I wanted to challenge myself to pseudo-randomly assign 10,000 derivative punks at mint time, while still preserving a 1:1 mapping to the original CryptoPunks. I also wanted to address some of the feedback I received from people who joined the Discord but didn’t own a CryptoPunk, and who were basically asking for a really cheap entrypoint into the ecosystem. All contracts I’ve deployed so far automatically transfer 10% of the proceeds to charity by hard-coding the ethereum address for GiveDirectly. But of course you could still argue that charging more for minting clowns from rare punks and sending half the proceeds to the wallets of the corresponding punk owners isn’t exactly democratizing NFTs or levelling the playing field.

For HivePunks, I used a similar approach as outlined above, but I played around a bit more until I came up with an aesthetic that I liked. For this project minting is open to everyone and the cost is fixed at 0.02E(**). Keep in mind that you tend to pay a bit more for gas when minting an NFT like this though, because significantly more computation is actually happening on-chain. The trait distribution is exactly the same as for the original CryptoPunks, so there will be 9 aliens and 1 of them will be smoking a pipe. I think I lucked out with HivePunk #0 by getting the hoodie twin of CryptoPunk #99!
Out of the three punk derivative projects discussed here (which I managed to launch in 3 consecutive weeks), HivePunks is arguably the one that is most like other shitpunk projects. But I still hope that the fact that everything is generated fully on-chain makes it feel just a bit more special and interesting.
(*) Edit: public sale is now open so anyone can now mint clowns from unclaimed punks through clowntown.io.
(**) Edit: minting HivePunks is now free so you pay for gas only and you can mint through hivepunks.art.
If you read all this way, I want to send you a heartfelt thank you, and I would love to connect with you on Twitter!