1

I'm trying to understand how crypto unique tokens are stored on the blockchain and how is it linked to a graphic of this token. In the case of cryptokitties, each kitty is generated randomly by the smart contract from my understanding. But how is each kitty's image stored on the blockchain? Or is this all controlled by a centralized server and only the smart contract generates random string data to represent a kitty?

0

I think you can learn a lot of thath making your own crypto game with cryptozombies.io they have a chapter dedicated to explain your question

3

Your second hypothesis is correct. The “genes” are generated on-chain and ownership etc. is also tracked there. Interpreting the raw blockchain data and turning it into a game with a UI is done in a centralized manner with a standard webserver and all that Jazz.

  • I'm curious to how are the "genes" generated in a random way. Is there a function that generates random data for this use case? – Patoshi パトシ Feb 21 '18 at 16:19
  • Updated my answer to include a link about gene randomness generation. :) – lungj Feb 21 '18 at 16:27
3

The images are not stored on the blockchain but the gene string is. The images produced are done via a server. A good example of this is how https://robohash.org/ works. A random string creates a new image.

The gene string is only random to an extent. Each piece of the string represents a crypto kitties characteristics...and during the birthing process, they are modified to still hold most of the characteristics of the parents. There is a function called mixGenes() that leads to a contract called geneScience and unfortunately, the source isn't verified.

  • thanks, that really solidified my understanding of identicons which is what cryptokitties is based off of. – Patoshi パトシ Feb 21 '18 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.