gdgdfbdsbdsba.png
2022-07-15
By Az
Tip the author

How to find your NFT metadata

By now you may have heard about the importance of an NFT’s assets and metadata. More specifically, where its assets and metadata are stored. At the end of the day, this is what defines how long your NFT will last, and if it is permanent, or will simply disappear one day. If you do want to read more about the permanence of NFTs, what exactly they are, and how they work, then check out our article here.

In this article, we will be looking at how to identify where your NFT metadata and assets are stored. For the time being, we’ll be looking at NFTs on the Ethereum blockchain.

Right, let’s dive in!

Ethereum NFTs

Ethereum is where it all began, the birthplace of NFTs. So it is no surprise that the major blue-chip projects live on this chain.

For this example we will take the biggest Ethereum NFT project out there – Bored Ape Yacht Club (BAYC) – and use it as an example for our purpose.

To check the details of an NFT we will need to use a blockchain scanner. A scanner allows you to view all information and details of smart contracts and tokens issued and created on all chains the explorer is compatible with.

For the Ethereum network, we will be using Etherscan which you can visit here. Via Etherscan we will try and retrieve the details for a BAYC NFT. Let’s get to it.

Upon visiting Etherscan you will see a search bar:

 

 

The developers at Etherscan have bought their platform a long way, and you can now conveniently search for projects by their common human names, instead of having to know a lengthy transaction number or smart contract address by heart. So let’s search for “BAYC”.

There it is!

 

Notice how there is a blue checkmark next to the name to indicate that the project is verified and official. Always tread with caution, as there are countless fakes copycat projects out there. Let’s click on BAYC.

Now that we are on the BAYC Etherscan page, we can see certain details about the project at the top, like the project’s Max Total Supply, the amount of NFT Holders, and how many token Transfers have been made to date.

But if you scroll down you will notice that there are many more options to click on. We want to essentially read Smart Contract that created the BAYC NFT tokens, so let’s scroll down and click on “Contract”. You’ll get the option to Read or Write to the contract, but only the creator of the contract can write to it. So let’s click Read.

To see where the metadata for a specific token is, we need to check its tokenURI. So let’s scroll down to option number 20, tokenURI. Here we will get a search bar to query a specific NFT token. Since this is the world of programming, numbers start from 0, not 1. So if we want to check the first token we need to run a query for 0. Type in “0” and hit query.

 

 

Etherscan will interact with the Smart Contract by sending the read query to it and displaying the smart contract’s answer to us.

What it returns is:

ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0

This is the link to the token’s metadata file which includes all additional info for the NFT, like the link to the actual image file, and all the NFT’s attributes.  Notice it is hosted on IPFS, as per how the link begins (ipfs://). The rest of the characters after that refer to the IPFS transaction ID (QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0).

Now, this is no ordinary link, and clicking on it will not do anything other than return a missing page error to you. That is because the link is only readable by the IPFS nodes. So we will need a gateway to access the file at the end of the link. There are many public gateways available, but let’s use one created by Piñata.

The Piñata gateway is “https://gateway.pinata.cloud/ipfs/”. We will simply take it and append to it the IPFS transaction ID that Etherscan returned to us. The result is this:

https://gateway.pinata.cloud/ipfs/QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0

Typing that into our browser takes us straight to the metadata file. This is what the file reads:

 

{“image”:”ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ”,”attributes”:[{“trait_type”:”Earring”,”value”:”Silver Hoop”},{“trait_type”:”Background”,”value”:”Orange”},{“trait_type”:”Fur”,”value”:”Robot”},{“trait_type”:”Clothes”,”value”:”Striped Tee”},{“trait_type”:”Mouth”,”value”:”Discomfort”},{“trait_type”:”Eyes”,”value”:”X Eyes”}]}

It may seem overwhelming at first, but if you give it a closer look it will start to make sense. You have the IPFS transaction ID leading to the NFT’s image file, and all the NFT’s attributes and traits.

So we can see that the NFT’s image is also hosted on IPFS, and if we want to visit it, all we need to do is what we did with the metadata file. So let’s convert:

ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ

into

https://gateway.pinata.cloud/ipfs/QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ

Type it into your browser, and there you have it! The image of BAYC NFT with tokenURI 0.

If your project was hosted on Arweave, you would see “ar://” in place of “ipfs://”.

Or if your project was hosted on dropbox, you would see “www.dropbox.com/” in place of it.

You can repeat this process for any other NFT project you want, and easily see where the metadata is hosted, and in turn the media asset (image, video, music, etc.).

BAYC and Arweave

It is worth noting, that in the case of BAYC, the team also pinned their NFT data onto Arweave for full permanence. You can see this by going to the “Provenance” section of the BAYC official website and subsequently clicking on the “List of Arweave URIs” link.

Let’s take a random NFT’s “arweaveId” and try to access it. This one for example:

“initialSequenceIndex”: 0,
“assignedTokenId”: 1147,
“arweaveId”: “ZQY3ditXQtI10IPb-cMYWrBkD-oIGIif_2uHgLS5UYE”

In order to access the Arweave transaction ID, we will need an Arweave gateway such as “www.arweave.net/”. So putting this in front of the token’s arweaveId gives us:

“www.arweave.net/ZQY3ditXQtI10IPb-cMYWrBkD-oIGIif_2uHgLS5UYE”.

And there you have it! You just retrieved a BAYC NFT image from Arweave’s Permaweb.

Other Chains

You can do the same on most blockchains by simply using the correct explorer. For example, on Solana, you can use Solscan, which will show the info under the Metadata property. If you would like to see a Solscan guide let us know in the comments below.


Join our

Telegram / Discord / Twitter

In NFTs
Tagged with In No tags

Az

Author and blockchain enthusiast.

Sign up for newsletter

Sign up here to get the latest news and updates delivered directly to your inbox.