Creating Compressed NFTs with Metaplex Bubblegum
1 Billion NFTs at 0.0000005 SOL per NFT - Craaaaaaazy!
One of the challenges when creating NFTs is the cost of minting (not the price set by the creators) — the transaction costs / gas fees involved on the blockchain itself).
We all know that transaction fees are already cheap in Solana (compared to other chains) but there’s still way to make it cheaper especially when you are aiming for millions or even billions in terms of the amount of NFTs that you are going to mint.
Enter Bubblegum
Bubblegum is Metaplex’s solution to creating NFTs cheaper! It does it by using a different approach on saving the “data” of your NFTs. It doesn’t store those data in Accounts like what they do in Token Metadata approach (in Candy Machine, etc) but rather make use of merkle trees.
How To Create Compressed NFTs
It’s very easy to create compressed NFTs - thanks to Metaplex’s awesome documentation.
For starters, you have to create a Bubblegum Tree. You have to decided what’s the maximum number of cNFTs you are going to make since that’s the parameters involved when creating the tree.
Next step, is the actual minting of the cNFTs. One of the options you have here is whether you have to make it as part of a collection. If it does, then you have to create a collection first using a standard approach. Here’s a quick example if you need one.
And for the actual minting, here’s an example of one that is minted to a collection. For a complete reference code, you can take a look at my repository (kimerran/bubblegum-compressed-nfts).
Gotchas
Since the data is not stored in Accounts, fetching it might be not as straightforward. So, you have to make use of what we call DAS API or Digital Asset Standard API. You should be aware of this since not all RPCs support this API.