- To mint an NFT we need a token URI
- We have convert svg into token URI
- To convert svg into token URI we have encode the svg into base64 encoded
- base64 -i
- To tell the browser it is a svg we have to few things before the base64 encoded data
- data:image/svg+xml;base64,
base64 -i images/happy.svg
base64 -i images/sad.svg
- Since we got a tokenUri instead of using IPFS hash we can actually use 100% on chain using this svg
- Since svg is basically code, onchain we can update and interact with it