> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# ERC721 on Solana: NFTs Without a Contract

> Map ERC721 to Solana NFTs: mint addresses in place of token IDs, Metaplex metadata, NFT standards, transfers, and @solana/kit examples.

An ERC721 collection is a contract that tracks who owns each token ID. A Solana
NFT is its own set of accounts, identified by its own address, and no collection
contract exists. This guide maps each ERC721 concept to its Solana equivalent.

## How NFTs work on Solana

In the original Solana NFT model, an NFT is a token with a supply of one. The
[Token Program](/developers/docs/tokens) 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](/developers/docs/migrate-to-solana/ethereum/standards/erc20), 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:

<Columns cols={2}>
<Card title="Metaplex Token Metadata" href="/developers/docs/tokens/metaplex" arrow>

A Token Program mint with a supply of 1, plus metadata and edition accounts.
Wallets and marketplaces support it widely.

</Card>
<Card title="Metaplex Core" href="https://www.metaplex.com/docs/smart-contracts/core">

One account per NFT, with plugins for royalties, freezing, and attributes.
Minting costs less because fewer accounts are created.

</Card>
<Card title="Compressed NFTs" href="https://www.metaplex.com/docs/smart-contracts/bubblegum-v2">

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.

</Card>
<Card title="Token Extensions" href="/developers/docs/tokens/extensions/dynamic-metadata-nft" arrow>

A Token Extensions mint that stores its metadata on the mint, with no separate
metadata program.

</Card>
</Columns>

The rest of this guide uses Metaplex Token Metadata, the closest match to how
ERC721 developers think about mints and transfers. Core and compressed NFTs use
their own instructions for the same operations.

## 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:

<Steps>
<Step title="Create the mint">

Create a mint account with 0 decimals. Its address identifies the NFT.

</Step>
<Step title="Mint one unit">

Mint exactly 1 token to the first holder's token account.

</Step>
<Step title="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.

</Step>
<Step title="Create the master edition">

The master edition account takes over the mint authority, so the supply stays at
1.

</Step>
</Steps>

## 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 its `owner` 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:

```ts
import { address, createSolanaRpc } from "@solana/kit";
import { fetchToken } from "@solana-program/token";
import { fetchMetadataFromSeeds } from "@metaplex-foundation/mpl-token-metadata-kit";

const rpc = createSolanaRpc("<RPC_PROVIDER_URL>");
const mint = address("<NFT_MINT_ADDRESS>");

// name(), symbol(), and tokenURI()
const metadata = await fetchMetadataFromSeeds(rpc, { mint });
console.log(metadata.data.name, metadata.data.symbol, metadata.data.uri);

// ownerOf(): the owner of the token account that holds the single unit
const { value } = await rpc.getTokenLargestAccounts(mint).send();
const [largest] = value;
if (largest?.amount !== "1") throw new Error("No token account holds this NFT");
const tokenAccount = await fetchToken(rpc, largest.address);
console.log(tokenAccount.data.owner);
```

<Note>

**Use an indexer for owner and collection queries**

Questions 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](https://www.metaplex.com/docs/dev-tools/das-api),
which also covers Core and compressed NFTs.

</Note>

## Transfer and approve

Transferring an NFT is the same [token
transfer](/developers/docs/migrate-to-solana/ethereum/standards/erc20#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.

```ts
getTransferCheckedInstruction({
  source, // the current holder's token account
  mint,
  destination, // the recipient's token account
  authority: holder,
  amount: 1n,
  decimals: 0,
});
```

<Warning>

**Some NFTs do not use a plain token transfer**

[Programmable
NFTs](https://www.metaplex.com/docs/smart-contracts/token-metadata/pnfts) 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.

</Warning>

Marketplaces on Ethereum ask for `setApprovalForAll`. Solana marketplaces work
per NFT: the holder approves a PDA of the marketplace program as a
[delegate](/developers/docs/tokens/basics/approve-delegate) on that NFT's token
account, or moves the NFT into an escrow account that the program controls.

## Tradeoffs

<Columns cols={2}>
<Card title="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.

</Card>
<Card title="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.

</Card>
</Columns>

## Next steps

<Columns cols={3}>
<Card title="ERC20 on Solana" href="/developers/docs/migrate-to-solana/ethereum/standards/erc20">

Learn mint accounts, token accounts, and transfers.

</Card>
<Card title="Metaplex metadata" href="/developers/docs/tokens/metaplex" arrow>

Create and update a token's metadata account.

</Card>
<Card title="Complete Guide" href="/developers/docs/migrate-to-solana/ethereum/complete-guide">

Review accounts, programs, and PDAs.

</Card>
</Columns>
