Compressed NFTs
View all compressed NFTs (cNFTs) owned by a wallet using the getAssetsByOwner DAS API. Filter by compression.compressed === true.
About Compressed NFTs
Compressed NFTs (cNFTs) use Solana's state compression to store NFT data off-chain in a Merkle tree, dramatically reducing minting costs. Popular sources include DRiP (drip.haus), Helium Mobile, and various gaming projects.
Try It
Tip: Try a wallet that has received DRiP NFTs or Helium Mobile rewards.
Code Example
// Get only compressed NFTs for a wallet address
import { Helius } from 'helius-sdk';
const helius = new Helius('YOUR_API_KEY');
async function getCompressedNFTs(ownerAddress: string) {
const response = await helius.rpc.getAssetsByOwner({
ownerAddress,
page: 1,
limit: 1000,
displayOptions: {
showFungible: false,
showCollectionMetadata: true,
},
});
// Filter for NFTs that are compressed
const nftInterfaces = ['V1_NFT', 'V1_PRINT', 'V2_NFT', 'ProgrammableNFT'];
return response.items
.filter(asset =>
nftInterfaces.includes(asset.interface) &&
asset.compression?.compressed === true
)
.map(asset => ({
id: asset.id,
name: asset.content?.metadata?.name || 'Unnamed NFT',
image: asset.content?.files?.[0]?.cdn_uri || asset.content?.files?.[0]?.uri,
tree: asset.compression?.tree,
leafId: asset.compression?.leaf_id,
}));
}
// Usage
const cNFTs = await getCompressedNFTs('86xCnPeV69n...');
console.log(`Found ${cNFTs.length} compressed NFTs`);API Tips
- Identifying cNFTs: Check
compression.compressed === truein the response to identify compressed NFTs. - Compression data: The
compressionobject includestree(Merkle tree address) andleaf_id(position in tree). - Asset IDs: Unlike standard NFTs, cNFTs use virtual asset IDs, not mint addresses. Use these IDs with getAsset to get full details.
Frequently Asked Questions
How do I list only compressed NFTs in a wallet?
Use getAssetsByOwner and filter the response for items where compression.compressed === true. This separates cNFTs from standard NFTs.
Where do compressed NFTs come from?
Popular cNFT sources include DRiP (drip.haus) for art drops, Helium Mobile for subscriber NFTs, and various gaming projects. They use Solana state compression to reduce minting costs.
How do I get details for a specific compressed NFT?
Use the asset ID from getAssetsByOwner with the getAsset method. Unlike regular NFTs, cNFTs use virtual asset IDs derived from the Merkle tree, not mint addresses.