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

# ERC1155 on Solana: Multi-Token Collections

> Map ERC1155 token IDs, balances, and batch transfers to Solana mints, token accounts, and multi-instruction transactions.

ERC1155 lets one contract manage many token types, fungible and non-fungible,
and move several of them in one call. On Solana, each token type is a mint under
the Token Program, and one transaction can transfer any number of them.

## What ERC1155 defines

An ERC1155 contract stores balances by token ID and owner. One ID can be a
currency with a large supply, and another can be a unique item.
`safeBatchTransferFrom` moves several IDs at once, which saves gas compared with
one ERC20 or ERC721 call per token.

<Columns cols={2}>
<Card title="ERC1155: One contract, many token IDs">

- Balances live in a nested mapping of ID and owner.
- An ID is fungible or unique, depending on its supply.
- Batch functions move several IDs in one call.

</Card>
<Card title="Solana: One program, one mint per ID">

- Each token type is a mint under the Token Program.
- The supply and decimals of the mint decide whether it is fungible.
- One transaction carries a transfer instruction for each mint.

</Card>
</Columns>

## Token IDs become mints

Create one mint for each ERC1155 token ID. Every mint uses the same Token
Program, so adding a token type is a transaction and needs no deployment. If you
have not read the [ERC20
guide](/developers/docs/migrate-to-solana/ethereum/standards/erc20), it explains
mints and token accounts.

```mermaid
flowchart TD
    P["Token Program<br/>Shared by every token type"]
    P -->|owns| P0["Mint: gold<br/>Supply 1,000,000, fungible"]
    P -->|owns| P1["Mint: potion<br/>Supply 500, 0 decimals"]
    P -->|owns| P2["Mint: sword<br/>Supply 1, unique"]
```

<div className="sol-mermaid" data-fallback="mermaid" data-mermaid="67e6100a05df">
  <img className="block dark:hidden" src="/docs-assets/assets/docs/mermaid/67e6100a05df-light.svg" alt="Three ERC1155 token IDs as three mints." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/mermaid/67e6100a05df.svg" alt="Three ERC1155 token IDs as three mints." />

  <img className="block dark:hidden" src="/docs-assets/assets/docs/mermaid/67e6100a05df-sm-light.svg" alt="Three ERC1155 token IDs as three mints." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/mermaid/67e6100a05df-sm.svg" alt="Three ERC1155 token IDs as three mints." />
</div>

<p className="sol-caption">Three ERC1155 token IDs as three mints.</p>

| ERC1155 token type | Solana mint |
| --- | --- |
| Fungible ID, such as a currency | A mint with decimals and a large supply |
| Semi-fungible ID, such as a stackable item | A mint with 0 decimals and a supply above 1 |
| Non-fungible ID | A mint with 0 decimals and a supply of 1, or a Metaplex Core asset |

## ERC1155 functions on Solana

Replace the token ID argument with the mint address.

| ERC1155 | Solana | How it maps |
| --- | --- | --- |
| `balanceOf(owner, id)` | Token account amount | Read the owner's associated token account for that mint. |
| `balanceOfBatch()` | Several account reads | Fetch several token accounts in one RPC call with `getMultipleAccounts`. |
| `safeTransferFrom()` | `TransferChecked` | Transfer between the two owners' token accounts for the mint. Solana has no receiver callback, so verify the recipient address yourself. |
| `safeBatchTransferFrom()` | Several instructions | Add one transfer instruction per mint to the same transaction. |
| `setApprovalForAll()` | No equivalent | Approve a delegate per token account. No operator covers every token a wallet holds. |
| `uri(id)` | Metadata `uri` | Each mint has its own metadata with a name, symbol, and URI. |

## Batch transfers

A batch transfer is a list of transfer instructions in one transaction. They run
in order and atomically: if one fails, none of them applies.

```ts
const instructions = [
  // Token ID 1: a stackable item with 0 decimals
  getTransferCheckedInstruction({
    source: potionSource,
    mint: potionMint,
    destination: potionDestination,
    authority: sender,
    amount: 50n,
    decimals: 0,
  }),
  // Token ID 2: a unique item
  getTransferCheckedInstruction({
    source: swordSource,
    mint: swordMint,
    destination: swordDestination,
    authority: sender,
    amount: 1n,
    decimals: 0,
  }),
];
```

<Note>

**Watch the transaction size**

Each transfer adds a source account, a destination account, and a mint to the
transaction. A legacy or v0 transaction holds 1,232 bytes, and a v1 transaction
holds 4,096 bytes. Split a very large batch across transactions. In a v0
transaction, you can also use an address lookup table, which stores addresses
onchain so that the transaction references them by index.

</Note>

## Collections and metadata

An ERC1155 contract address groups its token IDs. On Solana, mints are
independent, so you link them with metadata:

<Columns cols={3}>
<Card title="Metaplex metadata" href="/developers/docs/tokens/metaplex" arrow>

Give each mint a metadata account that references the same collection NFT, and
have the collection's authority verify each one.

</Card>
<Card title="Metadata extension" href="/developers/docs/tokens/extensions/metadata" arrow>

Store the name, symbol, and URI on a Token Extensions mint.

</Card>
<Card title="Token groups" href="/developers/docs/tokens/extensions/group-member" arrow>

Make one mint the group and register the other mints as its members.

</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="ERC721 on Solana" href="/developers/docs/migrate-to-solana/ethereum/standards/erc721">

Compare the NFT standards available on Solana.

</Card>
<Card title="Transfer tokens" href="/developers/docs/tokens/basics/transfer-tokens" arrow>

See the full code that signs and sends a transfer.

</Card>
</Columns>
