I’m working with Solana NFTs and need to figure out how to retrieve the token identifier for a specific NFT. Does Solana or web3.js provide any built-in methods to fetch this information? I’m wondering if token IDs are actually part of the Solana protocol itself or if they’re just something that marketplaces like OpenSea assign for their own purposes. For instance, I noticed that OpenSea displays certain NFTs with numbered identifiers, but I’m not sure where these numbers come from. Are they stored on-chain or generated by the marketplace? Any guidance on the proper way to access NFT token identifiers would be helpful.
yeah, opensea uses their own system to number NFTs, but on solana, it’s all about the mint address. just use getMint()
in web3.js to fetch it if you got the token account. that’s the real identifier for ur nft.
hmm this is really interesting! so the mint address is the “real” identity of the nft on solana, but how do collections actually work? like when you see 10k pfp collections, how do they track which one is #1, #2, etc if those numbers aren’t stored on chain?
@Nina_63Paint what are you building exactly? marketplace or just displaying nfts in your app? you might need different approaches for numbering depending on your use case.
i’ve wondered about this too - do projects store sequential numbers in their metadata json files? and if opensea and magic eden show different numbers for the same nft, which one’s “correct”? seems confusing for users coming from ethereum where token ids are standard
Indeed, this can be confusing for many users. Solana NFTs operate differently than those on Ethereum; there is no token ID within a contract. Each NFT is assigned a unique mint address upon creation, which serves as the true identifier. The numerical IDs displayed on marketplaces like OpenSea or Magic Eden are generated by those platforms for the sake of easier navigation and do not exist on the blockchain. When developing applications, it is best to rely on mint addresses, as they are consistent across all platforms. Additionally, while Metaplex metadata includes various identifiers, the mint address remains the most reliable method for tracking Solana NFTs.