Hello! Welcome back to our module on working with Solana tokens.
In our last few lessons, you've gained hands-on experience with the entire lifecycle of a standard fungible token—from creating a mint and token accounts to minting new supply and transferring tokens between users. These are the fundamental building blocks for creating any kind of currency or digital asset on Solana.
Today, we shift our focus to a special and very popular type of token: the Non-Fungible Token, or NFT. While a standard token is interchangeable (one token is the same as any other), an NFT is unique and represents ownership of a specific digital item.
This lesson will focus on the conceptual foundation of NFTs on Solana. Our goal is to describe the role of the Metaplex Token Metadata program for NFTs. This is the cornerstone program that makes the entire Solana NFT ecosystem possible. We will explore what it is, why it's necessary, and how it works at a high level. Understanding this is crucial before we dive into writing the code to create NFTs in our next session.
What Makes a Token an NFT on Solana?
First, let's clarify what an NFT actually is in the context of the Solana network. At its core, an NFT is just a standard SPL Token with a very specific configuration. The Metaplex documentation provides a precise definition.
Let's start with the official definition of an NFT on Solana from the Metaplex documentation.
Please read the short section titled 'NFTs'. It clearly outlines the three characteristics of a Mint Account that define it as a Non-Fungible Token.
As you just read, an NFT on Solana is simply a token from a mint with:
- A supply of 1: There is only one token of this kind in existence.
- Zero decimals: The token is indivisible. You can't own 0.5 of it.
- No mint authority: Once the single token is minted, the authority is revoked, guaranteeing that no more can ever be created.
This creates uniqueness and scarcity. However, this alone doesn't make for a very interesting NFT. A token with a supply of 1 is still just a number on the blockchain. It lacks a name, an image, a description, or any other attributes. The standard SPL Token Mint Account simply doesn't have fields to store this kind of rich information.
So, how do we attach all the data that makes an NFT a recognizable digital collectible?
The Solution: The Metaplex Token Metadata Program
This is where Metaplex comes in. Instead of trying to reinvent the wheel, the Solana ecosystem developed a standard, composable solution: a separate program that augments existing SPL tokens with additional data.
This program is the Token Metadata program. Its sole purpose is to associate rich data with any SPL token, whether it's an NFT or a fungible token (like a memecoin).
Let's explore the core mechanism it uses to achieve this.
The following sections from the Metaplex documentation explain how the Token Metadata program attaches data to a Mint Account using a special account and a Program Derived Address (PDA).
Please read the 'Introduction' and the section immediately following it. Focus on understanding what a 'Metadata Account' is and how a PDA creates a deterministic link between it and the original 'Mint Account'.
The Metadata Account
As the reading explained, the Token Metadata program introduces a new account type: the Metadata Account.
Here’s the key idea:
- You have your standard SPL
Mint Account, owned by the SPL Token Program. - The Metaplex Token Metadata program creates a separate
Metadata Accountthat holds all the extra information (name, symbol, etc.). - This Metadata Account's address is a Program Derived Address (PDA) derived from the address of the
Mint Account.
This use of a PDA is a powerful pattern you've seen before. It creates a canonical, unbreakable link between a token mint and its metadata. Given any mint's address, anyone can programmatically find the address of its corresponding Metadata Account.
The following diagram provides a clear visual representation of this relationship.

On-Chain vs. Off-Chain Data
The Metadata Account itself stores some data directly on the blockchain, such as:
Name(e.g., "Solana Space Cat")Symbol(e.g., "CAT")Creatorsand their royalty shares- The
Is Mutableflag
However, storing large amounts of data on-chain, like high-resolution images or detailed attributes, is prohibitively expensive. This is where your web development background becomes particularly relevant. The Token Metadata program uses a hybrid approach, much like a web app fetching large assets from a server or CDN.
Let's look at how Metaplex handles large data assets like images and detailed traits. This section discusses the most important field in the Metadata Account: the URI.
Please read the section titled 'A JSON standard'. Focus on what the URI attribute points to and how the Is Mutable flag provides a guarantee of permanence.
As you just saw, the URI field in the Metadata Account points to an off-chain JSON file. This JSON file follows a standard format that wallets and marketplaces can parse to display the NFT's full details:
image: A URL to the NFT's image.description: A longer text description.attributes: A list of traits (e.g., "background: space", "color: orange").
To ensure the NFT is truly permanent, this JSON file and its assets are typically stored on decentralized storage solutions like Arweave or IPFS.
Furthermore, by setting the Is Mutable flag on the on-chain Metadata Account to false, the creator can make it impossible to ever change the URI field. This locks the link between the on-chain token and its off-chain metadata, guaranteeing the asset's authenticity and permanence.
Test your understanding!
Imagine an NFT marketplace needs to display an NFT. The marketplace knows the mint address of the NFT. In what order would it retrieve the information needed to display the NFT's name, symbol, and image?
Show answer
- Find the Metadata Account PDA: The marketplace would use the mint address to derive the PDA of the associated Metadata Account.
- Fetch the On-Chain Data: It would then fetch and deserialize the data from the Metadata Account to get the on-chain
nameandsymbol. This account's data also contains theURI. - Fetch the Off-Chain JSON: The marketplace would then make an HTTP request to the
URIto get the off-chain JSON file. - Display the NFT: Finally, it would parse the JSON to find the
imageURL and other attributes, and use all this information to render the NFT in its UI.
Proving Non-Fungibility: The Master Edition Account
Metaplex provides one final piece to the puzzle to certify that a token is a true, one-of-a-kind original: the Master Edition account.
This is another PDA-based account, also derived from the mint address. Its purpose is simple: its existence is proof of non-fungibility.
The Token Metadata program will only allow a Master Edition account to be created if the mint fulfills the NFT criteria (supply of 1, 0 decimals). When it's created, the Metaplex program takes over the mint and freeze authorities, moving them to the Master Edition PDA itself. This acts as a final lock, ensuring that no one can ever mint more tokens or alter the supply.
For this lesson, it's enough to know that the Master Edition account is the final stamp of approval that turns an SPL token into a certified, original NFT.
Conclusion
You now have a solid conceptual map of how NFTs work on Solana. It's not magic, but rather a clever, composable system built on top of the primitives you've already learned.
Let's summarize the key takeaways:
- NFTs are standard SPL tokens configured with a supply of 1 and 0 decimals.
- The Metaplex Token Metadata program is used to attach rich data to tokens.
- It does this by creating a Metadata Account whose address is a PDA derived from the token's mint address.
- This Metadata Account stores a
URIpointing to an off-chain JSON file that holds the NFT's image, description, and attributes. - The Master Edition account is an additional account that serves as a final, on-chain proof that the token is a unique, non-fungible original.
In our next lesson, we will put this theory into action. We'll write an Anchor instruction that makes a Cross-Program Invocation (CPI) to the Token Metadata program to create a Metadata account for a new mint, officially turning it into our very first NFT.
Can't find a good explanation? Sign up and we'll make it for you
Sign up