How to query your NFT metadata

You should have heard about the importance of NFT assets and metadata by now. More specifically, where are NFT assets and metadata stored? This is the ultimate deciding factor in how long your NFT will last, will it last forever, or will it suddenly disappear someday?

This article will show us how to confirm where our NFT metadata and assets are stored. Let’s take a look at NFTs on the Ethereum blockchain for a moment.

Get started now!

Ethereum NFTs

Ethereum is where it all started, the cradle of NFTs. So, it’s no surprise when we see major blue-chip projects running on this chain.

Let’s take the largest blockchain NFT project — Bored Ape Yacht Club (BAYC) — as an example to illustrate how to query FNT metadata.

To view the details of an NFT we need to use a blockchain explorer. The blockchain browser allows you to browse all the information and details of the tokens and smart contracts generated and issued on the chain, as long as it is a chain that is compatible with the browser.

For the Ethereum network, we will use the Etherscan browser, which allows users to browse all the information and details of tokens and smart contracts that are generated and issued on-chain with which it is compatible.

Visit Etherscan and you will first see a search box:0G9nUlsGyG9Vwa2L4L2ICiiKazsq3M6m1veIgo8Y.png

The Etherscan platform is quite mature, and now you can easily find results by simply searching for the common name of the project, without having to memorize a long list of transaction numbers or smart contract addresses. So, let’s try searching for “BAYC”.

Please see!fSI255sduvKvNuq6D2AUD0WhDO7C7TZTfjywwWhb.png

Notice that there is a blue mark in front of the project name, indicating that the project is an official verified project. Because there are so many copycat projects, remember to be careful. Next click on “BAYC”.

Now that we come to the BAYC page of Etherscan, we can see some specific information about the project at the top of the page, such as the project’s maximum total supply, the number of NFT holders, and the number of tokens transferred so far that day.BEuRClF4WTgpmSg3ek6vWOfFyexGpt0jtGDZsAyz.png

Scroll down the screen and you’ll see that there are a lot of clickable options. The main thing we want to see is the smart contract that generates the BAYC NFT token, so we scroll down and click “Contract”.SAgKmxZEus6fgdvTeWwMcHXEjowjeJCJ9l4pYsXO.png

To view the metadata of a token, we need to click View tokenURI. Let’s scroll down to option 20, which is tokenURI. There is a search box here for a specific NFT token. Because this is a procedural world, numbers start at 0, not 1. So if we want to see the first coin, we need to run a query with an object of 0. Enter “0” and click “Query” to query.kW8sb8NmPxjn5rzrt4azttoRe6ZeF5aAimx3JnG2.png

Etherscan interacts with the smart contract by sending a query request to the smart contract, showing us the smart contract’s response:

What is returned is:

ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0

This is a link to a token metadata file that includes all other information about the NFT being looked up, such as a link to the actual image file, and all NFT properties. Note that it is hosted on IPFS, the link starts with ipfs://, followed by other characters representing the IPFS transaction ID:

(QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/0)。

Now, this is no ordinary link. Clicking on this link does nothing but returns an error page. This is because this link is only readable by IPFS nodes. So, we need to use the gateway to access the file. There are many public gateways available, let’s try it out with Piñata’s.

The Piñata gateway address is https://gateway.pinata.cloud/ipfs/. We just have to take it and use it, appending the IPFS transaction ID that Etherscan returned to us. like this:

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

Typing this address into our browser takes you directly to the metadata page. The content of this metadata page is as follows:

JHejjtJrry7XCAfsZpAJ5qaDpX7bpdqSGmmMDn8N.png

It might seem confusing at first, but if you take a closer look you can see the clues. The IPFS transaction ID leads to the NFT image file, and all the properties of the NFT.

We can see that the image file of NFT is also hosted on IPFS. To access this image file, we have to do the same as the previous operation for the metadata file. Then, we need to:

ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ

transform into:

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

Type it into your browser and you’re done!

1NwQWG0dufuerX0oYIyrWrtP5jxLrQ2syPS4gUPb.png

If your project is hosted on Arweave, you will see “ar://” instead of “ipfs://”.

Or, if your project is hosted on dropbox, you will see http://www.dropbox.com/.

You can do this with any other NFT item and easily see where the metadata is hosted and where your media assets (images, videos, music, etc.) are.

BAYC and Arweave

It is worth noting that in the case of BAYC, its team also runs NFT data on Arweave in order to make their NFTs fully perpetual. You can go to the “Provenance” section of BAYC’s official website and click the link “List of Arweave URIs” (Arweave URI list).

Let’s try accessing it using a random NFT “arweaveId” as an example. E.g:

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

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

http://www.arweave.net/ZQY3ditXQtI10IPb-cMYWrBkD-oIGIif_2uHgLS5UYE

That’s it! It’s that simple.YxmdxabN6qDK8SnwPEUAy5cOAqCfj2Uk4DAJIbov.png

other chains

With the right browser, you can do something similar on most chains. For example, on Solana, you can use the Solscan browser to view metadata attribute information.

Posted by:CoinYuppie,Reprinted with attribution to:https://coinyuppie.com/how-to-query-your-nft-metadata/
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.

Like (0)
Donate Buy me a coffee Buy me a coffee
Previous 2022-07-16 23:29
Next 2022-07-17 10:26

Related articles