Hi, I have been thinking recently about the way we are predominately creating NFTs on Cardano, right now the trend is to add the NFT attributes to the transaction metadata, however, I think this is not really that good if we want to do more interesting things with the tokens. As long as we keep adding the NFT attributes to the transaction metadata we will never have decentralized minting (creating new NFTs from smart contracts, e.g breeding mechanism etc), as we can not enforce any kind of restrictions on the transaction metadata from the scripts. The users always have all the freedom to add anything to the metadata. Also, we cant read the information stored there from the contracts, making it impossible to use for example to implement business logic on the chain.
I have the following idea, but I am not sure if it could work:
Objectives:
1.- Stay away from an account base model and if possible keep the NFT as a native token.
2.- Have the metadata accessible from the contracts (token metadata must be inside an eUTXO).
Possible solution:
At minting time we create two tokens, for example:
“fffffffffffffffffffff.Monster00001” and “fffffffffffffffffffff.Monster00001_state” (they could be in the same policy or different policies).
Token “Monster00001” could still be freely traded as a native token, however token Monster00001_state will be trapped in an eUTXO which holds the token metadata or dynamic state (depending on the use case).
To retrieve the metadata for token fffffffffffffffffffff.Monster00001 we just need to find the eUTXO which contains fffffffffffffffffffff.Monster00001_state and read its Datum, but here is where I am stuck.
I know that by using –tx-out-datum-embed-file we can embed the datum data on the transaction (as opposed to the datum hash). However, is this information persisted on the blockchain? (I am guessing it is as it is needed in some scripts validators), and if so, how can we retrieve this data?.
Another option I was thinking of is to encode the data in additional tokens, for example, if the NFT has strength attribute or dexterity, we could add these tokens to the eUTXO (30 tokens of strength).
We could also encode some information on the asset name as @bwbush showed on another thread, however, the space to do this is limited (although if we are creative I guess we could store a large amount of information there). We could also combine several of these approaches.
I was wondering if anyone has come up with a good solution for this/ has already implemented something like this?