How NFTs work on Solana
In the original Solana NFT model, an NFT is a token with a supply of one. The Token Program owns the mint and the holder’s token account, and a metadata account adds the name, symbol, and URI. A token ID does not exist: each NFT has its own mint address. If you have not read the ERC20 guide, start there. It explains mint accounts and token accounts, which NFTs reuse.| Piece | ERC721 | Solana |
|---|---|---|
| Identifier | Contract address plus tokenId | The NFT’s mint address |
| Ownership | An owner mapping in the contract | The owner of the token account that holds the single unit |
| Metadata | tokenURI() on the contract | A metadata account with the name, symbol, and URI |
| Collection | The contract | A collection NFT that each item references and the collection’s authority verifies |
| Supply limit | Contract logic | Supply of 1 with 0 decimals. The master edition account holds the mint authority, so no more can be minted. |
| Royalties | ERC2981, optional for marketplaces | A seller fee in the metadata. Some standards restrict transfers to programs that pay it. |
Choose an NFT standard
ERC721 is one interface. Solana has several NFT standards, and they trade off wallet support, cost, and features:Metaplex Token Metadata
A Token Program mint with a supply of 1, plus metadata and edition accounts.
Wallets and marketplaces support it widely.
Metaplex Core
One account per NFT, with plugins for royalties, freezing, and attributes.
Minting costs less because fewer accounts are created.
Compressed NFTs
Only a hash of each NFT is stored onchain, in a Merkle tree account managed by
Metaplex Bubblegum. Indexers serve the NFT data. Suited to collections with a
very large number of items.
Token Extensions
A Token Extensions mint that stores its metadata on the mint, with no separate
metadata program.
ERC721 functions on Solana
With Token Metadata, ERC721 functions map to account reads and Token Program instructions.| ERC721 | Solana | How it maps |
|---|---|---|
name(), symbol() | Metadata fields | Read name and symbol from the NFT’s metadata account. |
tokenURI() | Metadata uri | Read uri from the metadata account. It points to the offchain JSON with the image and attributes. |
ownerOf() | Token account owner | Find the token account that holds the NFT’s single unit and read its owner. |
balanceOf() | An indexer query | List a wallet’s NFTs through an RPC provider that supports the Digital Asset Standard (DAS) API. |
transferFrom() | TransferChecked | Transfer 1 unit with 0 decimals to the recipient’s token account. |
safeTransferFrom() | No equivalent | Solana has no receiver callback. A transfer goes to a token account that must already exist, but nothing checks that its owner can move the NFT, so verify the recipient address yourself. |
approve() | A delegate | Approve one delegate on the NFT’s token account. |
setApprovalForAll() | No equivalent | Delegation is per token account. No operator can move every NFT a wallet holds. |
Mint an NFT
Minting an ERC721 token calls a function on the collection contract. Minting with Token Metadata creates the NFT’s accounts in one transaction. SDKs build these instructions for you, and the steps show what they do:1
Create the mint
Create a mint account with 0 decimals. Its address identifies the NFT.
2
Mint one unit
Mint exactly 1 token to the first holder’s token account.
3
Attach metadata
Create the metadata account with the name, symbol, and a URI that points to the
offchain JSON. Set the collection, which is the mint address of a collection
NFT. The collection’s authority then verifies the item, and apps trust only
verified collection references.
4
Create the master edition
The master edition account takes over the mint authority, so the supply stays at
1.
Read NFT data
Fetch the metadata account for the name, symbol, and URI. To find the owner, look up the token account that holds the NFT and read itsowner field. That
lookup calls getTokenLargestAccounts, which the public RPC endpoints reject
with a rate-limit error, so the example uses an RPC provider’s URL:
Use an indexer for owner and collection queriesQuestions such as who owns an NFT, which NFTs a wallet holds, or which NFTs
belong to a collection span many accounts. RPC providers answer them through the
Digital Asset Standard API,
which also covers Core and compressed NFTs.
Transfer and approve
Transferring an NFT is the same token transfer as for a fungible token, with an amount of 1 and 0 decimals. Create the recipient’s associated token account in the same transaction if it does not exist.Some NFTs do not use a plain token transferProgrammable
NFTs are
transferred through the Token Metadata program so that royalty rules apply. Core
and compressed NFTs have their own transfer instructions. Check the standard
before you build the transaction.
setApprovalForAll. Solana marketplaces work
per NFT: the holder approves a PDA of the marketplace program as a
delegate on that NFT’s token
account, or moves the NFT into an escrow account that the program controls.
Tradeoffs
ERC721: A contract per collection
- Each collection can customize minting and transfer logic.
- Token IDs live inside one contract, so that contract’s events and optional enumeration functions cover the whole collection.
- Every collection is a deployment that needs its own review.
- Royalties depend on each marketplace honoring ERC2981.
Solana NFTs: Shared programs, one address per NFT
- Minting is a transaction against audited programs.
- Each NFT is its own set of accounts, so collection queries need an indexer.
- Several standards exist, and wallets and marketplaces must support the one you pick.
- Programmable NFTs and Core plugins can restrict transfers to programs that pay royalties.