How to view and download an NFT on the blockchain
If you recently bought an NFT, you may wonder where exactly that NFT is stored. Exchanges like OpenSea display the NFT image and other information about the NFT, like its name, ID, and attributes, but where does OpenSea gather this information?
When an NFT project mints (creates) an NFT, a contract adds metadata about that NFT to the blockchain.
This post will teach you how to look up the details about an NFT directly on the Ethereum blockchain. You will do this by interacting with an NFT project's Ethereum contract.
When you finish reading, you will understand how NFT projects and artists store information about an NFT and how to download the highest quality image of your NFT possible directly from the blockchain.
How to read an Ethereum NFT contract
Step 1: Find the contract address
First, you will need to locate the Ethereum contract address of your NFT. The easiest way to do it is to look it up on OpenSea.
How to find a contract address on OpenSea
Go to your NFTs listing page on OpenSea. (Like this example)
Click the Details dropdown
Click the link in the Contract Address field
Clicking the contract address will take you directly to the contract on Etherscan, which is where we want to go. Although this is the easiest method, you can also usually find the contact address of an NFT project on the project's website, Twitter, or Discord.
The contract address is a long alphanumeric value like:
0x8943C7bAC1914C9A7ABa750Bf2B6B09Fd21037E0
You can enter this value directly into the search field on Etherscan to go to the contract.
Step 2: Find the Token ID
The token ID is also in the Details area on OpenSea right below the contract address.
Step 3: Write the contract
After clicking the contract address link in OpenSea, you should now be on Etherscan. The page should look similar to this contract for Lazy Lions. :
Etherscan is a blockchain explorer that allows you to view transactions on the Ethereum blockchain and interact with contracts directly.
You should see a table displaying Transactions if you scroll down a bit. Click the Contract tab.
Then click Read Contract.
Then find a field called tokenURI. Enter your Token ID in this field, then click Query.
The contract should generate a URI that looks like a URL for a website.
In the above example, the Lazy Lions URI is:
Copy this URI, paste it into your browser's address bar, and press Enter.
Step 4: Read the NFT metadata
You should now see a JSON output of your NFT metadata. JSON is a way to organize information for coding. The output should look something like this:
{"name":"#2862","tokenId":2862,"image":"https://gateway.pinata.cloud/ipfs/Qme6rBzYrvv2rnXBbv1dbjCvjEs3Mu4PgafMs6eyCkaxw4","external_url":"https://www.lazylionsnft.com/","attributes":[{"trait_type":"Background","value":"Adamant"},{"trait_type":"Body","value":"Pink"},{"trait_type":"Bodygear","value":"Ethereum Shirt"},{"trait_type":"Earring","value":"Nothing"},{"trait_type":"Eyes","value":"Raised Eyebrow"},{"trait_type":"Headgear","value":"Nothing"},{"trait_type":"Mane","value":"Top Knot - Ice"},{"trait_type":"Mouth","value":"Yawning"}]}
You can drop this into a JSON pretty print tool to make it easier to read.
Now you can view all the information stored on the Ethereum blockchain about your NFT! In the example above, you can see that the lion:
Has a pink body: {"trait_type":"Body","value":"Pink"}
Is wearing an Ethereum shirt: {"trait_type":"Bodygear","value":"Ethereum Shirt"}
Is yawning: {"trait_type":"Mouth","value":"Yawning"}
But most importantly, we can also download the highest quality image from the project's contract on the Ethereum blockchain.
How to download an NFT image
You can find the image of an NFT in the NFT's tokenURI. You should see an image value in the JSON metadata output that links directly to the NFT image.
In our example tokenURI the image value is:
Navigating to this image will open a majestic Lazy Lion. You can download the image file by right-clicking on the image and saving it on your computer.
You now know how to:
Find the Contract Address of your NFT
Find the tokenID of your NFT
Read an NFT contract
View the metadata of an NFT directly on the Ethereum blockchain
Download the highest-quality version of an NFT image from the blockchain
Reply