zkzoomer / dorsiaclub

Customizable NFT Business Cards
https://dorsiaclub.netlify.app/
3 stars 3 forks source link
blockchain nft solidity

Patrick BATEMAN

Dorsia Club - Customizable NFT Business Cards

The original idea behind this project was to create an NFT that users could customize, so that they could truly own their token: a dynamic NFT.

The end result is an NFT Business Card whose assets get randomly generated at the time of minting, but which has name and positions that get defined by the user.

The Business Card

The NFT is powered by the Business Card smart contract, which is an extension of the ERC-721 token standard. What these changes do, in short, is:

The Oracle

The oracle is continuously listening for new update events, that indicate it that it needs to generate a new Business Card image. The assets that define this image are given by the genes attribute from the smart contract. The oracle constructs this Business Card, and will then upload this image onto IPFS. The resulting token metadata IPFS hash is uploaded on-chain. This whole process can take as little as 30 seconds.

As I intend to launch this project comercially in the near future, the assets used for generating these Business Cards will not be made available in this repository.

If you wish to test the functioning of this oracle on a local blockchain, you can follow these instructions.

The Website

Built on React.js and supporting Metamask, it allows end users to:

Possible improvements

Business Card attributes are generated using the keccak256 hashing function as a source of randomness, and using as one of the inputs the block's timestamp. A miner/validator could potentially tamper with this RNG and generate a number of their liking. While such event is possible, it's also true that the amount of computational resources necessary for this should deter any attacker from crafting the sickest and most amazing looking Business Card.

The oracle needs to process each Business Card one by one. In the event that all 1,111 Business Cards were minted at once, it would take ~9 hours for the oracle to process all of them. This could be solved by running several instances of it in parallel, each of them processing tokenIds ending in a certain digit.

The oracle as it stands is of course a centralized entity, currently being run on an AWS server. Since an IPFS content identifier (CID) is generated deterministically, different parties creating identical Business Cards will arrive at the same CID. This could be used to decentralize the oracle, allowing Business Card owners to generate Cards and interact with an additional smart contract that would act as the oracle.

Links and resources

You can go ahead and mint your own Business Card, free of charge:

Polygonscan link links:

Reach out on Twitter: https://twitter.com/0xdeenz