1

Every tutorial I've seen and every single example in the doc shows PNG files. But I can't find any documentation that explicitly states that this is the only supported format. Is it possible to mint an NFT with a JPG file or something else?

TylerH
  • 20,799
  • 66
  • 75
  • 101
emersonthis
  • 32,822
  • 59
  • 210
  • 375

1 Answers1

2

Short answer: All image formats with the image/* mime type.


Reasoning behind the statement:

  1. Solana is a platform allowing for smart contracts (called Programs) written in Rust, C, and C++ (source). There are also some unofficial tools that allow you to compile contracts written in other languages, such Solang for Solidity.

  2. There are smart contract standards, usually defined as an interface and a set of rules (such as when to emit specific events), originated in the Ethereum ecosystem as EIPs (Ethereum Improvement Protocol). One of them is EIP-721 which is the first approved, and widely used, NFT standard.

    You as a developer, are able to create an NFT smart contract that doesn't follow any of the EIP standards. But, a common practice is to follow the original standards even though you're developing on another network (such as Solana), respecting network-specific differences.

  3. The EIP-721 standard explicitly describes the image field of the metadata JSON:

    A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents.

Note: The standard is also referred to as ERC-721. ERC is a subset type of EIP, and both names are correct.

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100
  • Thanks, Peter. Is it just coincidence that every doc or tutorial example I've ever seen shows a PNG? Is there a reason why that seems most common? – emersonthis Nov 21 '21 at 17:05
  • 1
    For a bit more context, I was recently experimenting with Metaplex's candy-machine library and it did not seem to support any formats besides PNG. That might be a temporary bug... I guess I'm wondering if in your experience other formats are _theoretically_ valid (according to the spec), or if they're actually used in practice. – emersonthis Nov 21 '21 at 17:08
  • @emersonthis I'm not familiar with the Metaplex libraries, but from what I [found](https://docs.metaplex.com/nft-standard): "PNG, GIF and JPG file formats are supported" (quote from the linked docs page). I understand that some 3rd party libraries can have limitations on their app level, disallowing some of the less used image formats... I personally haven't seen any other format apart from PNG to be used as an underlying resource for an NFT, but in my understanding of the standard - any other image format (assuming it's `image/*` mimetype) is theoretically valid. – Petr Hejda Nov 21 '21 at 22:59