How Do I include MP3/Mp4 capabilities in my smart contract? Im interested in minting songs and short videos as CNFTs but I do not see any information online what so ever about how this can be done. There are CNFT projects such as music box who seem to have accomplished this in a short format. Can anyone give me some guidance?
2 Answers
You would never include the actual mp3/mp4 in your smart contract. That's a lot of space (probably more than could ever fit on the chain) and unnecessary.
Instead, you could create a hash of the clip and attach that hash as metadata of an NFT--thus showing unique ownership. That's how NFTs for images/pictures work typically.
How you store the mp3/mp4 is up to you. You could host it on a website, or consider IPFS (InterPlanetary File System) for a bit more safety.
-
Thank you. I have been using pinata.cloud for an IPFS but it has trouble rendering even a small file. Do you have any IPFS's you'd recommend? Nov 19, 2021 at 21:36
-
ipfs.io or you can use the Blockfrost API: docs.blockfrost.io/#tag/IPFS-Add– georgeosDec 3, 2021 at 3:33
So generally the media is stored somewhere else and you just link the NFT to it with a URL. If you didn't do this, the blockchain would grow astronomically.