// the find
solana-developers/compressed-nfts
Example code to use compressed NFTs (using state compression) on Solana
A set of standalone TypeScript scripts from the Solana devrel team showing how to mint, read, and transfer compressed NFTs using state compression and the Metaplex Bubblegum program. It's for Solana devs who already know the normal NFT minting flow and want to see what changes when you move to compressed trees instead of per-NFT accounts.
Scripts are ordered to mirror a real workflow (create tree + mint, fetch by owner/collection, transfer) rather than being a grab-bag of disconnected snippets. It includes a hand-rolled ReadApi wrapper (WrapperConnection.ts) that shows the actual RPC calls for fetching compressed assets and proofs, plus client-side proof verification code — the part most tutorials skip and that actually trips people up. Having both a raw/manual implementation and a parallel Metaplex SDK implementation of the same operations is genuinely useful for understanding what the SDK is abstracting away.
No automated tests — the scripts are meant to be run by hand in a specific order, and the README literally warns that running them out of order breaks things because state gets stashed in a .local_keys folder. Last push was January 2024, so this predates ~2 years of Bubblegum program and Read API changes; given how fast the compression tooling moved, there's a real chance the exact RPC methods or account layouts here are stale. It depends on an RPC provider that implements the Read API (not all do), which is an easy thing to get stuck on if you don't already know to check for that. The hand-rolled compression.ts/types.ts utilities also mean you're trusting example code for Merkle proof handling rather than a maintained library — fine for learning, risky to copy into production as-is.