Chainlens supports two types of NFT token. Those that support the original ERC-721 standard, and those that support the ERC-1155 multi-token standard.
You can access the NFT view in Chainlens by clicking the navigation item.
Common issues with NFTs
In order for NFTs to be rendered correctly in Chainlens, there are a few details that the creators need to get correct. Chainlens helps creators understand where the errors lies in the event that NFTs are not deployed correctly on the network.
Clicking this link takes you to the listing page for all NFTs.
From here you can click on a specific NFT and view information the collection its from.
If you click on a specific NFT you see information about it including its name, image, description and any attributes.
Additionally, we recognise that sometimes information is missing from NFTs preventing from them rendering correctly in explorers. To address this we've added additional information in Chainlens for users.
To unpack this, its helpful to discuss how NFTs are implemented on Ethereum networks.
Components of an NFT
NFTs are created by smart contracts implementing the ERC-721 or ERC-1155 standards.
ERC-721 is the original NFT standard. ERC-1155 came along later adding the ability to use a single smart contract for managing multiple collections of fungible and non-fungible tokens.
You'll see both types of tokens in Chainlens, where ERC-721 tokens are labelled Non-Fungible, whereas ERC-1155 are labelled Hybrid.
NFT Metadata
Both standards contain an optional metadata extension which is used to provide information about the assets contained by NFTs.
These interfaces are below.
ERC-721 Metadata Interface
ERC-1155 Metadata Interface
This metadata extension, named tokenURI(uint256 _tokenId)
and function uri(uint256 _id)
in ERC-721 and ERC-1155 contracts respectively returns a URI string which can be used to obtain additional data about an NFT encoded in JSON.
This URI string will usually resolve to a URL. The URL is often hosted on the decentralised IPFS network, but it could be a location on a traditional storage location, such as an AWS S3 bucket.
The format of the JSON schemas is as per the below.
ERC-721 URI schema
ERC-1155 URI schema
Correct NFT Deployment
When NFTs are minted on a network, for them to render correctly, they all need to be present in the smart contract creating the NFTs:
- Lookup by token id returns a metadata URI
- The metadata URI is accessible
- The metadata URI contains an image URI property
- This image URI is accessible and contains a valid image format
If any of the above steps fail then an NFT will not render correctly.
Given the series of stages required to render NFTs correctly, Chainlens now makes it clear where the problems lie when NFTs aren't being rendered correctly.
Digging Deeper into NFTs in Chainlens Blockchain Explorer
When you navigate to an NFT collection page, the Collections tab displays the NFTs in the collection. Provided the NFT has been deployed correctly you will see preview images for individual NFTs in the collection.
Clicking on one of the NFTs will show you information about that specific NFT. In the below example, we have the name, NFT type, address, metadata URL and attributes.
If you click on the metadata URL hyperlink you will be able to see the metadata associated with the NFT.
In this instance, it's hosted on IPFS.
If there are any issues with the rendering of the NFT, it's straightforward to see where the problem lies.
- If there is no metadata for the token, the metadata URL will be blank
- If the metadata URL is not accessible, a No Metadata image is displayed
- If the image URI is not accessible, a blank image is displayed