Ram
@hiddentao
1/ Did some investigating into storing NFT metadata fully on-chain, especially with respect to large images. First, The data URI length can be several KB (64 KB+) long: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs#length_limitations
1 reply
0 recast
0 reaction
Ram
@hiddentao
2/ Both SVG and PNG data URIs seem to work. Presumably other file formats would also work. It's expensive to write KB of data to a storage slot (duh!), so an L2/L3 with periods of low gas feed - e.g 1 Gwei - is essential to minimizing overall cost to caller.
1 reply
0 recast
0 reaction
Ram
@hiddentao
3/ For still images, there is no need to use the attribute "image_data" [1] instead of "image" in the metadata since "image" is already widely supported and can point to really long image data URIs. [1] https://docs.opensea.io/docs/metadata-standards
1 reply
0 recast
0 reaction
Ram
@hiddentao
4/ In Metamask I couldn't get the image to show up in the viewer, though it did in the transaction finalization screen when I tried to send the NFT to another wallet. Perhaps it was a cacheing isssue due to initial metadata being malformed?
1 reply
0 recast
0 reaction