# NFT and metadata decoders (Carbon 2.0)

> Decode 3 Solana NFT and metadata programs in Rust, including Metaplex Core, Bubblegum and Metaplex Token Metadata, with Carbon decoder crates.

Carbon 2.0.0 has decoder crates for 3 NFT and metadata programs on Solana: 117 instructions, 22 account types and 0 events in all. Use them to index NFT and compressed NFT mints, transfers and burns, collections and token metadata as typed Rust values instead of parsing raw bytes. Each program's page lists every instruction with its discriminator, data fields and accounts, every account and event, and a complete program that runs against the public RPC.

## Programs

Program IDs are the mainnet addresses compiled into each crate as `PROGRAM_ID`. Instruction counts exclude the `CpiEvent` wrapper.

| Program                                                                                | Crate                               | Program ID                                     | Instructions | Accounts | Events |
| -------------------------------------------------------------------------------------- | ----------------------------------- | ---------------------------------------------- | -----------: | -------: | -----: |
| [Bubblegum](https://carbon.sevenlabs.org/decoders/bubblegum.md)                        | `carbon-bubblegum-decoder`          | `BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY` |           17 |        2 |      0 |
| [Metaplex Core](https://carbon.sevenlabs.org/decoders/mpl-core.md)                     | `carbon-mpl-core-decoder`           | `CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d` |           42 |        6 |      0 |
| [Metaplex Token Metadata](https://carbon.sevenlabs.org/decoders/mpl-token-metadata.md) | `carbon-mpl-token-metadata-decoder` | `metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s`  |           58 |       14 |      0 |

## Decode several in one pipeline

Add `carbon-core` and the decoder crates you need, all at the same version. For every program in this category:

```sh
cargo add carbon-core@2.0.0 carbon-bubblegum-decoder@2.0.0 carbon-mpl-core-decoder@2.0.0 carbon-mpl-token-metadata-decoder@2.0.0
```

Register each decoder with a processor for its instruction enum. This fragment goes in your pipeline setup; the processors are yours, one per program, each implementing `Processor` for that program's instruction input (see [processors](https://carbon.sevenlabs.org/concepts/processors.md)):

```rust
use carbon_mpl_core_decoder::MplCoreDecoder;
use carbon_bubblegum_decoder::BubblegumDecoder;
use carbon_mpl_token_metadata_decoder::MplTokenMetadataDecoder;

Pipeline::builder()
    .datasource(datasource) // a datasource that emits these programs' transactions
    .instruction(MplCoreDecoder, MplCoreProcessor)
    .instruction(BubblegumDecoder, BubblegumProcessor)
    .instruction(MplTokenMetadataDecoder, MplTokenMetadataProcessor)
    .build()?
    .run()
    .await
```

Each decoder only returns instructions whose program ID matches its own `PROGRAM_ID`, so one pipeline can hold all of them. For datasource filters that follow several programs, and one processor that sees every program's instructions in a transaction, see [index multiple programs](https://carbon.sevenlabs.org/guides/multiple-programs.md).

## A program that is not listed

Generate a decoder from the program's Anchor or Codama IDL with the Carbon CLI: see [generate a decoder](https://carbon.sevenlabs.org/guides/generate-a-decoder.md). Every crate above was generated the same way. The [full catalog](https://carbon.sevenlabs.org/decoders.md) lists decoders in every category.

---

Carbon 2.0.0 documentation · Web: https://carbon.sevenlabs.org/decoders/nfts · Last updated 2026-11-09 · Index of all pages: https://carbon.sevenlabs.org/llms.txt
