Background

CryptoKitties is a game about digital collectibles built on the Ethereum blockchain. It captured the attention of the cryptocurrency communities because it is bringing some of the core concepts of digital ledger technologies (e.g. wallets, transaction times, gas fees) to more of a mainstream audience.

It is also an example of digital scarcity. Unlike tokens which have been driving the explosion of initial coin offerings in cryptocurrency, CryptoKitties are an example of a digital asset, like a token, but where each is unique and can carry a unique value.

I’m currently working on some projects where we’re investigating similar concepts, so initially I started reviewing CryptoKitties as a proof-of-concept. However, I soon got pulled into the rabbit-hole of deciphering the puzzle of their genetic algorithm.

Breeding kitties for fun & profit

The premise is straightforward, breed two kitties with a set of unique cattributes and the offspring will have some mix of those cattributes.

Parents pass cattributes to their children

For the most part, you can follow how the traits are passed on. For instance, above the bloodred trait was clearly inherited from the parents and passed on to one of the children.

Down the rabbit-hole

However, knowing that all of the breeding exists on the Ethereum blockchain makes this a lot more interesting. We know that, essentially the program that runs the breeding (the smart-contract) is available for everyone to see.

Soon after CryptoKitties launched, a myriad of fan-built tools and websites appeared to try to make sense of the kitties being bred (a population which quickly went into the 10,000s and then 100,000s).

One particularly interesting web tool is CryptoKittydex.

CryptoKittydex

Cryptokittydex presented a fascinating puzzle about how the genes were encoded. Each kitty is represented as a unique long number, their genetic code, which is stored on the Ethereum blockchain.

I began to play around with this. Using what I know about procedural generation, I realized that there should be some base parts of each kitty which map to the cattribute and then to the appropriate gene.

As I started to map this out, something about CryptoKittydex was bothering me. Occasionally, you’d get duplicate values.

Shadowgrey cattribute … or is it Cloudwhite?

I soon realized that we should be looking at the binary code– and soon became obsessed with cracking the code.

I won’t go into each step of deciphering the code, I posted some of my work on in the Reddit group, with the subject CryptoKitties Genome Project.

CryptoKitties Genome — Deciphered