Features
Minting Compressed NFTs
Last updated June 19, 2026
Summary
Minting compressed NFTs adds new cNFTs to a Bubblegum Tree using the mintV2 instruction. This page covers minting with and without MPL-Core collections, and retrieving the asset ID from mint transactions.
- Mint cNFTs to a Bubblegum Tree using the mintV2 instruction
- Mint directly into an MPL-Core collection with the BubblegumV2 plugin
- Retrieve the asset ID and leaf schema from the mint transaction
- Configure metadata including name, URI, creators, and royalties
- Inherit seller fee basis points from an MPL-Core collection's Royalties plugin
In the previous page, we saw that we need a Bubblegum Tree to mint Compressed NFTs, and we saw how to create one. Now, let's see how to mint compressed NFTs from a given Bubblegum Tree.
The Bubblegum program offers multiple minting instructions for the different leaf schema versions. Bubblegum V2 introduces a new minting instruction called mintV2 that is used to mint Compressed NFTs either to a given Collection or without a Collection.
Minting without a Collection
The Bubblegum program provides the mintV2 instruction that enables us to mint Compressed NFTs from a Bubblegum Tree. If the Bubblegum Tree is public, anyone will be able to use this instruction. Otherwise, only the Tree Creator or the Tree Delegate will be able to do so.
The main parameters of the mintV2 instruction are:
- Merkle Tree: The Merkle Tree address from which the Compressed NFT will be minted.
- Tree Creator Or Delegate: The authority allowed to mint from the Bubblegum Tree — this can either be the creator or the delegate of the tree. This authority must sign the transaction. In the case of a public tree, this parameter can be any authority, but must still be a signer.
- Leaf Owner: The owner of the Compressed NFT that will be minted. It defaults to the payer of the transaction.
- Leaf Delegate: A delegate authority allowed to manage the minted cNFT, if any. Otherwise, it is set to the Leaf Owner.
- Collection Authority: The authority allowed to manage the given Collection.
- Core Collection: The MPL-Core Collection NFT to which the Compressed NFT will be added.
- Metadata: The metadata of the Compressed NFT that will be minted. It contains information such as the Name of the NFT, its URI, its Collection, its Creators, etc. In Bubblegum V2 the metadata is using
MetadataArgsV2which excludes unneeded fields likeusesand theverifiedflag for the collection.
Mint a Compressed NFT without a Collection
import { none } from '@metaplex-foundation/umi';
import { mintV2 } from '@metaplex-foundation/mpl-bubblegum';
await mintV2(umi, {
leafOwner: umi.identity.publicKey,
merkleTree: merkleTree.publicKey,
metadata: {
name: 'My NFT',
uri: 'https://example.com/my-nft.json',
sellerFeeBasisPoints: 550,
collection: none(),
creators: [],
},
}).sendAndConfirm(umi);
Minting to a Collection
While it is possible to set and verify a Collection for a Compressed NFT after it is minted, Bubblegum V2 allows you to mint a Compressed NFT directly to a given Collection. Bubblegum V2 uses MPL-Core Collections to group the compressed NFTs. The same mintV2 instruction is used for that. In addition to the parameters described above, you need to pass in the core collection and sign as collection authority or delegate:
- Core Collection: The mint address passed to the
coreCollectionparameter, pointing to the MPL-Core Collection NFT… - Collection Authority: The authority allowed to manage the given Collection NFT. This can either be the update authority of the Collection NFT or a delegated collection authority. This authority must sign the transaction regardless of whether the Bubblegum Tree is public or not.
Note that the Metadata parameter must contain the Collection Public Key.
Mint a Compressed NFT to a Collection
import { some } from '@metaplex-foundation/umi';
import { mintV2 } from '@metaplex-foundation/mpl-bubblegum';
await mintV2(umi, {
collectionAuthority: umi.identity,
leafOwner: umi.identity.publicKey,
merkleTree: merkleTree.publicKey,
coreCollection: collectionSigner.publicKey,
metadata: {
name: 'My NFT',
uri: 'https://example.com/my-nft.json',
sellerFeeBasisPoints: 550, // 5.5%
collection: some(collectionSigner.publicKey),
creators: [],
},
}).sendAndConfirm(umi);
Inheriting royalties from the collection
When minting to an MPL-Core collection, you can store a sentinel seller fee basis points value on the leaf (65535, exported as SELLER_FEE_BASIS_POINTS_INHERIT / 0xffff) instead of copying the collection's royalty percentage into every cNFT. DAS puts the collection-resolved rate on royalty.basis_points / creators for display and the leaf sentinel on royalty.basis_points_raw / creators_raw (with royalty.inherited: true), while the on-chain leaf keeps the sentinel for hashing.
Clients that read DAS responses (wallets, marketplaces, indexers, and apps) should follow Reading Inherited Royalties.
The JavaScript SDK's mintV2 helper defaults to this behavior when coreCollection is provided and metadata.sellerFeeBasisPoints is omitted.
Requirements:
- The MPL-Core collection must have both the
BubblegumV2andRoyaltiesplugins. metadata.creatorsmust be an empty array when using inherited seller fees. Creator splits come from the collection's Royalties plugin instead of leaf-level creators.- Inherited seller fees are only valid for cNFTs in a collection. Collectionless mints must use an explicit value between
0and10000.
1import { createTreeV2, mintV2, mplBubblegum } from '@metaplex-foundation/mpl-bubblegum'
2import { createCollection, mplCore, ruleSet } from '@metaplex-foundation/mpl-core'
3import { generateSigner, some } from '@metaplex-foundation/umi'
4import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
5
6const umi = createUmi('https://api.devnet.solana.com')
7 .use(mplBubblegum())
8 .use(mplCore())
9
10const merkleTree = generateSigner(umi)
11const collectionSigner = generateSigner(umi)
12
13await createTreeV2(umi, {
14 merkleTree,
15 maxDepth: 5,
16 maxBufferSize: 8,
17}).sendAndConfirm(umi)
18
19// The collection must include BubblegumV2 and Royalties plugins.
20await createCollection(umi, {
21 collection: collectionSigner,
22 name: 'My Collection',
23 uri: 'https://example.com/collection.json',
24 plugins: [
25 { type: 'BubblegumV2' },
26 {
27 type: 'Royalties',
28 basisPoints: 500, // 5%
29 creators: [{ address: umi.identity.publicKey, percentage: 100 }],
30 ruleSet: ruleSet('None'),
31 },
32 ],
33}).sendAndConfirm(umi)
34
35// sellerFeeBasisPoints is omitted — the SDK sends the inherit sentinel (65535).
36await mintV2(umi, {
37 collectionAuthority: umi.identity,
38 leafOwner: umi.identity.publicKey,
39 merkleTree: merkleTree.publicKey,
40 coreCollection: collectionSigner.publicKey,
41 metadata: {
42 name: 'My NFT',
43 uri: 'https://example.com/my-nft.json',
44 collection: some(collectionSigner.publicKey),
45 creators: [], // must be empty when inheriting royalties
46 },
47}).sendAndConfirm(umi)
48
49// cNFT minted with SELLER_FEE_BASIS_POINTS_INHERIT (65535) on the leaf
You can still pass an explicit sellerFeeBasisPoints to override the collection default for a single mint.
Collection removal
A cNFT with inherited seller fees cannot be removed from its collection until the seller fee is updated to an explicit value. See Managing Collections and Updating Compressed NFTs.
Get Asset ID and Leaf Schema from mint transaction
You can retrieve the leaf and determine the asset ID from the mintV2 transaction using the parseLeafFromMintV2Transaction helper. This function parses the Transaction, therefore you have to make sure that it has been finalized before calling parseLeafFromMintV2Transaction.
Transaction finalization
Please make sure that the transaction has been finalized before calling parseLeafFromMintV2Transaction.
Get leaf schema from mint transaction
import {
mintV2,
parseLeafFromMintV2Transaction,
} from '@metaplex-foundation/mpl-bubblegum';
const { signature } = await mintV2(umi, {
// ... see details above
}).sendAndConfirm(umi);
const leaf = await parseLeafFromMintV2Transaction(umi, signature);
const assetId = leaf.id;
Notes
- The Bubblegum Tree must be created before minting. See Creating Trees.
- For collection mints, the MPL-Core collection must have the
BubblegumV2plugin enabled. - To inherit royalties from a collection, the collection must also have the
Royaltiesplugin and the leaf'screatorsarray must be empty. - The collection authority must sign the transaction when minting to a collection, regardless of whether the tree is public or private.
- Use
parseLeafFromMintV2Transactiononly after the transaction is finalized, not just confirmed.
FAQ
How do I mint a compressed NFT to a collection?
Use the mintV2 instruction with the coreCollection parameter set to your MPL-Core collection address and provide the collectionAuthority signer. The collection must have the BubblegumV2 plugin enabled.
How do I get the asset ID after minting?
Use the parseLeafFromMintV2Transaction helper after the transaction is finalized. It parses the transaction and returns the leaf schema including the asset ID via leaf.id.
Can anyone mint from my tree?
Only if the tree was created with public: true. For private trees, only the Tree Creator or Tree Delegate can mint cNFTs.
What metadata fields are required for minting?
The MetadataArgsV2 struct requires: name (string), uri (string pointing to JSON metadata), sellerFeeBasisPoints (0-10000, or omit when minting to a collection to inherit from its Royalties plugin), collection (public key or none), and creators (array of creator objects; must be empty when inheriting royalties).
Can a cNFT inherit royalties from its MPL-Core collection?
Yes. When minting with coreCollection, omit metadata.sellerFeeBasisPoints and leave metadata.creators empty. The SDK stores SELLER_FEE_BASIS_POINTS_INHERIT (65535) on the leaf. The collection must have the Royalties plugin. See Inheriting royalties from the collection.
Glossary
| Term | Definition |
|---|---|
| mintV2 | The Bubblegum V2 instruction for minting compressed NFTs, replacing the V1 mint instructions |
| MetadataArgsV2 | The metadata structure passed to mintV2, containing name, URI, royalties, collection, and creators |
| SELLER_FEE_BASIS_POINTS_INHERIT | Sentinel value 65535 (0xffff) stored on-chain to indicate royalties are inherited from the MPL-Core collection |
| Collection Authority | The signer authorized to manage the MPL-Core collection — required when minting to a collection |
| BubblegumV2 Plugin | An MPL-Core collection plugin that enables Bubblegum V2 features (freeze, soulbound, royalties) |
| Asset ID | A PDA derived from the merkle tree address and leaf index, uniquely identifying a compressed NFT |
| Leaf Schema | The data structure stored as a leaf in the merkle tree, containing the cNFT's hashed metadata and ownership info |
