Solana nft metadata

Solflare X NFT”, “family”: “Solflare” }, “properties”: { “files”: [ { “uri”: “https://www.arweave.net/abcd5678?ext=png”, “type”: “image/png” }, { “uri”: “https://watch.videodelivery.net/9876jkl”, “type”: “unknown”, “cdn”: true }, { “uri”: “https://www.arweave.net/efgh1234?ext=mp4”, “type”: “video/mp4” } ], “category”: “video”, “creators”: [ { “address”: “SOLFLR15asd9d21325bsadythp547912501b”, “share”: 100 } ] }}

For the fields that match the on-chain metadata, on-chain information has priority.

  • description – Human readable description of the asset.
  • image – URL to the image of the asset. PNG, GIF and JPG file formats are supported. You may use the ?ext={file_extension} query to provide information on the file type.
  • animation_url – URL to a multi-media attachment of the asset.

Solana nft metadata

NFT artwork’s image fileanimation_urlURL linking to the animation royalty_amountThe percentage of royalties to the creator for each resalecopyright_transferWhether the copyright is transferred to the buyeraddressToken contract address on the chainresellableWhether the artwork can be resoldoriginal_creatorNFT creator’s address on the chainedition_numberEdition number of the artworktitleTitle of the workurlLink to the NFT sale listingfile_keyThe downloadable file for the NFTnameName of the artworkedition_totalTotal number of editions of the artwork

In the listing shown above, the animation_url and file_key fields are empty, which means that this NFT does not have an animated version (it’s a still image) and there is no downloadable bonus content file.

If you purchase this particular NFT, what you own will essentially be a token that links to an artwork via its metadata.

Solana nft metadata format

If so, you’re ready to get airdropped some SOL!

This is, of course, devnet SOL, but it’s still necessary to interact with the devnet. Run this command:

solana airdrop 2

When that is complete, you can run this command to verify your devnet wallet has the SOL:

solana balance

You should see that your devnet wallet has 2 SOL.

With all of the initial Solana and Metaplex installation and configuration done, we will move on to configuring out NFT drop.

Drop Configuration

This is the most important part of the entire drop, so you should read about it in full here. Metaplex uses a tool called Candy Machine for NFT drops like this, and it’s important to make sure your project is configured properly.

In the root of your project, create a JSON file called config.json.

Solana nft metadata generator

When this happens, the creator of the NFT may need to change the metadata to fix the error.

Curious about where MetaData is stored? Check out, “This is Where NFT Metadata is Stored | Everything You Need to Know.”

How to Change the Metadata of an NFT?

To change the metadata of an NFT, you will need a deep understanding of computer science and how blockchain technology works. You’ll start by going into the code of the NFT and changing the metadata URI.

From there, the process differs depending on how your NFT is made and its specific purpose. Changing a game NFT is much different than changing an art NFT.

You’ll likely want to consult someone in the space to help you with the process if you are not familiar with blockchain technology.

Solana nft metadata standard

Let’s took a look at a basic JSON metadata file structure for NFTs on Solana:{ “name”: “Number #0001”, “symbol”: “NB”, “description”: “Collection of 10 numbers on the blockchain. This is the number 1/10.”, “image”: “0.png”, “attributes”: [ {“trait_type”: “Layer-1”, “value”: “0”}, {“trait_type”: “Layer-2”, “value”: “0”}, {“trait_type”: “Layer-3”, “value”: “0”}, {“trait_type”: “Layer-4”, “value”: “1”} ], “properties”: { “creators”: [{“address”: “N4f6zftYsuu4yT7icsjLwh4i6pB1zvvKbseHj2NmSQw”, “share”: 100}], “files”: [{“uri”: “0.png”, “type”: “image/png”}] }, “collection”: {“name”: “numbers”, “family”: “numbers”}}

Just like with the Ethereum metadata standard, the Solana metadata standard has a name, image, and description. Additionally, you can include attributes (just like with ETH), a symbol, and collection details.

Solana get nft metadata

Place all your tokens addresses (mint id) as string array to the ./src/data/token-list-to-parse.json.

Download current meta.

You need download existing metadata for further reuse on update command. Run

yarn download-metadata

It will get array of tokens from ./src/data/token-list-to-parse.json and fetch all metadata to the file src/data/current-metadata-cache.json (may take ~1hr for 1k items).

Create new updated metadata on Arweave.

It can be done with metaplex upload same as when creating new candy machine. Tip: You can upload to devnet with same result, arweave links will be still valid.
Otherwise newly updated links need to be formated to format of metaplex cache file.

Solana nft update metadata

Additionally, the immutability and security offered by the blockchain does not apply to data stored off-chain, which means that externally hosted metadata could be altered or removed.

Put simply, the only thing secured by the blockchain is the smart contract – your certificate of ownership. This is why there is so much insecurity hindering the widespread adoption of NFTs – without the actual asset being stored on the blockchain, there is no guarantee that the NFT you buy today won’t just end up becoming a broken link to a non-existent file in 5 years if/when the server(s) it is hosted on shits itself.

Solana nft add metadata

The supported file formats are MP4 and MOV for video, MP3, FLAC and WAV for audio and GLB for AR/3D assets. You may use the ?ext={file_extension} query to provide information on the file type.

  • external_url – URL to an external application or website where users can also view the asset.
  • properties.category – Supported categories: image (png, gif, svg, jpg), video (mp4, mov), audio (mp3, flac, wav), vr (glb, gltf)
  • properties.files – Object array, where an object should contain the uri and type of the file that is part of the asset. The type should match the file extension. The array will also include files specified in image and animation_url fields, and any other that are associated with the asset.
  • Solana mint nft with metadata

    NFT with Python

    Maybe this was the step you’ve been waiting for. Here we are.

    For this, we used the Metaplex Foundation’s Python API. Get this downloaded and in your working directory. You should be able to mostly follow the examples they’ve provided, but for the purposes of this tutorial, here is ours:

    import base58import jsonimport osimport metaplex_apifrom cryptography.fernet import FernetSERVER_DECRYPTION_KEY = Fernet.generate_key().decode(“ascii”)TEST_PRIVATE_KEY = os.environ[‘TEST_PRIVATE_KEY’]TEST_PUBLIC_KEY = “MsE5TofYuKtxgboqwzbLxjFbaNwK41b3YYfX6gyxfcD”cfg = { “PRIVATE_KEY”: TEST_PRIVATE_KEY, “PUBLIC_KEY”: TEST_PUBLIC_KEY, “DECRYPTION_KEY”: SERVER_DECRYPTION_KEY}api = metaplex_api.MetaplexAPI(cfg)account = metaplex_api.Account(list(base58.b58decode(cfg[“PRIVATE_KEY”]))[:32])api_endpoint = “https://api.devnet.solana.com/”# requires a JSON file with metadata.

    The two NFTs that are stuck loading are using a public IPFS gateway. The two that load almost instantly are loaded through a Dedicated Gateway.

    When viewing your NFTs on Solana NFT marketplaces, the assets will load through the IPFS gateway as well. This allows people to experience the content in the way it was designed to be experienced.

    Wrapping Up

    The benefits of using IPFS for the storage of NFT assets are well-documented.

    IPFS offers quick retrieval (especially when using a Pinata Dedicated Gateway), IPFS offers content addressability, and IPFS is portable. Ownership of NFTs can transfer in both the token sense and the media sense.

    However, it has not always been easy to use IPFS with Solana NFT projects. Hopefully, this tutorial helps change that.

    Leave a Reply

    Your email address will not be published.