The CryptoKitties Genome Project

kaigani
kaigani
Dec 18, 2017 · 5 min read
Image for post
Image for post

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.

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.

Image for post
Image for post
Parents pass cattributes to their 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.

Image for post
Image for post
CryptoKittydex
Image for post
Image for post
Shadowgrey cattribute … or is it Cloudwhite?

CryptoKitties Genome — Deciphered

Image for post
Image for post

Here’s what I’ve found

  • Genes are stored in 12 blocks of 4x5-bit codes
  • Each 5-bit code represents a cattribute associated with the position in the gene (body, pattern type, eye color, eye type, primary color, pattern color, secondary color, fancy type, mouth)
  • Each block of 4 codes represents 1 dominant trait expressed in the Kitty followed by 3 recessive traits.
  • Codes are passed from either parent to child, with a low probability of swapping from the 1st recessive, and a lower probability of swapping from the 2nd or 3rd recessive.
  • There is an occasional mutation on a gene, that seems to be a bitwise-rotation of a gene passed to a child.
  • Fancy cats are either a unique combination of cattributes or a hidden fancy-type gene hidden in the 8th block.
  • totesbasic is a special type of code where only 2-bits are responsible for the totesbasic cattribute which means it can hold hidden data.

Cattribute genes

Body

Image for post
Image for post
himalayan
Image for post
Image for post
ragamuffin
Image for post
Image for post
sphynx
Image for post
Image for post
munchkin
Image for post
Image for post
laperm
Image for post
Image for post
cymric
Image for post
Image for post
chartreux
Image for post
Image for post
mainecoon

Pattern type

Image for post
Image for post
calicool
Image for post
Image for post
jaguar
Image for post
Image for post
spock
Image for post
Image for post
totesbasic (only 2-bits responsible)
Image for post
Image for post
tigerpunk
Image for post
Image for post
luckystripe

Eye color

Image for post
Image for post
sizzurp

Eye type

Image for post
Image for post
thicccbrowz

Primary color

Image for post
Image for post
cloudwhite
Image for post
Image for post
shadowgrey (all 0's)

Pattern color

Image for post
Image for post
barkbrown

Secondary color

Image for post
Image for post
bloodred

Mouth

Image for post
Image for post
Pouty

Fancy genes

Image for post
Image for post
santaclaws
Image for post
Image for post
dracula

Further research

Visible, recessive cattributes

I don’t yet understand how kitties that show more than 8 cattributes (with some not expressed) are storing those cattributes in the genes. There are 4 extra blocks in the genome, but some kitties have 13 or more cattributes listed.

Mutations

I’m not 100% sure how and when mutations occur. Is it completely random or is it something embedded in the genetic code?

Help with the project?

If you’ve found this research helpful, I’m taking donations of non-related attribute clones

My CryptoKitties donation address

0x9d51ac60d6a51e5239b9c7720818b9b3e54925b6


Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store