-
-
CryptoMarc - Annemieke 1
-
CryptoMarc - Breed Annemieke/Marc 2
-
CryptoMarc - Annemieke 3
-
CryptoMarc - Marc 4
-
CryptoMarc - Marc 5
-
CryptoMarc - Marc 2
-
CryptoMarc - Breed Annemieke/Marc 1
-
CryptoMarc - Marc 1
-
CryptoMarc - Breed Annemieke/Marc 3
-
CryptoMarc - Breed Annemieke/Marc 5
-
CryptoMarc - Annemieke 4
-
CryptoMarc - Breed Annemieke/Marc 4
-
CryptoMarc - Annemieke 2
-
CryptoMarc - Marc 3
-
CryptoMarc - Annemieke 5
Inspiration
The hype of the NFT market inspired me to find out if I can make randomized NFT CryptoPunks based on my own traits and see if it makes sense to breed with other people's traits, in order to generate characters to be used in games or to predict certain traits like skills. Since I have clients in the Labour market, it would be nice to see if you can build teams by mixing skills traits with different people, based on some randomization and labour-APIs.
What it does
The project generates random characters - CryptoMarcs, based on layers of images: background, face, mouth, eyes, clothes and minting them as NFTs. The character image layers and traits are randomized using the Chainlink VRF feature, so input to the NFTs can always be verified. Then we get NFTs with different traits according to generated random numbers, that are used to build up the character image according to the layer weight which is closest to the random number, as well as random skills traits that correspond to the Dutch/Flemish CompetentNL standard, to be invoked using the Chainlink API feature.
Breeding is the act of mixing 2 or more CryptoMarcs, mixing the random numbers of the traits and again randomise the resulting traits, before minting the resulting Breed NFT. I bred with a CryptoMarc resembling my wife (Annemieke) to see if the resulting breeds were lookalikes of my sons. Not far off I would say...
Seriously, we could use this in a game to mix traits for stronger characters or more business wise, use the traits to mix skills matching labour standards like CompetentNL to build a balanced team according to some mixed skills need.
How we built it
Several chunks of code are used to build the project. I started out with Chainlink's boilerplate repo to test the Chainlink features. I dropped the price feeds since I don't need them for this project yet. After some testing with the Ethereum and Polygon test networks I ended up using the Kovan network, as I noticed it's the most stable and feature rich for the VRF and API functionality.
The 2 main contracts are APIConsumer, derived from the tutorial and RandomCryptoMarc, based off of Dungeons and Dragons. APIConsumer is getting the first essential skill from the CompetentNL API, which my company ovrhd maintains, using a random number as input to a job title according to the standard. This random number is generated by RandomCryptoMarc and I used the expand function to get more, as input for the traits. So every RandomCryptoMarc NFT has a mapping of tokenId to Attributes - traits and Competences - skills.
For the image generation I used Hashlips art engine and accommodated for the random number input. This way we can verify after uploading to Pinata, that both the metadata and the image is based on the random number generator of RandomCryptoMarc, potentially a strong feature in verifying scarcity.
The breed function basically mixes traits and skills of 2 CryptoMarcs, randomizes them and generates a new CryptoMarc NFT the same way as before, only mixing the trait and skill numbers from the input CryptoMarcs. The resulting numbers skills set is then input to the APIConsumer, which calls the CompetentNL API and returns the most essential skill for each job title number.
Challenges we ran into
I would have liked to build a true breeding marketplace but I ran into timing issues and the fact that interaction with the Chainlink features experience quite some latency; especially VRF took about 1 minute, at least on Kovan. Therefore I generated the NFTs and handled the API functionality using hardhat task functions on the command line instead. API Consumer response was also lagging about 1 minute, and repeating request/response interactions errored often. I wasn't able to link to a dataprovider, then I might have built a richer API response than the plain 1 string response shown in the tutorial. For a business proposition in the Labour domain this will be paramount.
Accomplishments that we're proud of
The actual verification of random numbers with respect to NFT metadata and traits and getting fun lookalikes.
What we learned
Oracle functionality is quite essential to business propositions as we need to build more trust in what I call the input of blockchains. At the moment proponents talk about trustlessness, that is contradictory to what business would like to understand, which is: can I trust this information and the algorithm that is used to generate it?
What's next for Random CryptoMarcs & Breeds
Build out a true breeding marketplace as a game and onboard friends to play and mix with their mates
Built With
- chainlink
- hardhat
- hashlips-art
- pinata
- solidity
Log in or sign up for Devpost to join the conversation.