ERC721 metadata / IPFS

Lets imagine we have NFTs that are simple pngs/jpegs.
If one was to use OpenZepelin’s ERC721URIStorage , then its tokenUri (maybe appended to a base path) is supposed to point to a json doc that has more info about the nft right ?

e.g www.myserver.com/nfts/1.json

{
name:"",
description:"",
image: “”
}

So if I understand correctly - since that json doc is on a server that can go down or be modified then thats why IPFS is usually used?

But if one uses IPFS does that mean the uri would directly point to an image on ipfs without needing to put metadata anywhere ?

Yeah! You just save the image in IPFS but the NFT metadata is from the contract.

thanks, I was actually just reading about minty (https://docs.ipfs.io/how-to/mint-nfts-with-ipfs/#minty)

Seems like minty not only adds the metadata at an ipfs address, but the actual resource that the metadata points to is also at an ipfs address:

minty mint ~/flight-to-the-moon.txt --name "Moon Flight #1" --description "This ticket serves as proof-of-ownership of a first-class seat on a flight to the moon."

> 🌿 Minted a new NFT:
> Token ID:              1
> Metadata URI:          ipfs://bafybeic3ui4dj5dzsvqeiqbxjgg3fjmfmiinb3iyd2trixj2voe4jtefgq/metadata.json
> Metadata Gateway URL:  http://localhost:8080/ipfs/bafybeic3ui4dj5dzsvqeiqbxjgg3fjmfmiinb3iyd2trixj2voe4jtefgq/metadata.json
> Asset URI:             ipfs://bafybeihhii26gwp4w7b7w7d57nuuqeexau4pnnhrmckikaukjuei2dl3fq/flight-to-the-moon.txt
> Asset Gateway URL:     http://localhost:8080/ipfs/bafybeihhii26gwp4w7b7w7d57nuuqeexau4pnnhrmckikaukjuei2dl3fq/flight-to-the-moon.txt
> NFT Metadata:
> {
>   "name": "Moon Flight #1",
>   "description": "This ticket serves as proof-of-ownership of a first-class seat on a flight to the moon.",
>   "image": "ipfs://bafybeihhii26gwp4w7b7w7d57nuuqeexau4pnnhrmckikaukjuei2dl3fq/flight-to-the-moon.txt"
> }