Network
Launch Date
Consensus
Note
Sepolia
Oct 2021
PoW
Like-for-like representation of Ethereum
Görli
Jan 2019
PoA
Proof-of-Authority
Kiln
Mar 2022
PoS
Post-Merge (for ETH2), shadow fork of the mainnet
Kintsugi
Dec 2021
PoS
DEPRECATED, use Kiln; post-Merge (for ETH2)
Ropsten
Nov 2016
PoW
DEPRECATED, use Sepolia; the Merge to happen on Jun 8, 2022
Rinkeby
Apr 2017
PoA
DEPRECATED, use Görli and Görli Faucet
Kovan
Mar 2017
PoA
DEPRECATED, use Sepolia or Görli
List of active and deprecated Ethereum testnets, including Kintsugi.
Features
Optimistic rollup 
ZK-rollup 
Proof
Uses fraud proofs to prove transaction validity. 
Uses validity (zero-knowledge) proofs to prove transaction validity. 
Capital efficiency
Requires waiting through a 1-week delay (dispute period) before withdrawing funds. 
Users can withdraw funds immediately because validity proofs provide incontrovertible evidence of the authenticity of off-chain transactions. 
Data compression
Publishes full transaction data as calldata to Ethereum Mainnet, which increases rollup costs. 
Doesn't need to publish transaction data on Ethereum because ZK-SNARKs and ZK-STARKs already guarantee the accuracy of the rollup state. 
EVM compatibility
Uses a simulation of the Ethereum Virtual Machine (EVM), which allows it to run arbitrary logic and support smart contracts. 
Doesn't widely support EVM computation, although a few EVM-compatible ZK-rollups have appeared. 
Rollup costs
Reduces costs since it publishes minimal data on Ethereum and doesn't have to post proofs for transactions, except in special circumstances. 
Faces higher overhead from costs involved in generating and verifying proofs for every transaction block. ZK proofs require specialized, expensive hardware to create and have high on-chain verification costs. 
Trust assumptions
Doesn't require a trusted setup. 
Requires a trusted setup to work. 
Liveness requirements
Verifiers are needed to keep tabs on the actual rollup state and the one referenced in the state root to detect fraud. 
Users don't need someone to watch the L2 chain to detect fraud. 
Security properties 
Relies on cryptoeconomic incentives to assure users of rollup security. 
Relies on cryptographic guarantees for security. 
Start building
on Alchemy.
Sign up for free
Start building on Optimism.
Sign up for free
Start building on Arbitrum.
Sign up for free
Start building on Ethereum.
Sign up for free
Start building on Polygon.
Sign up for free
Start building on Starknet.
Sign up for free
Start building on Flow.
Sign up for free
kiln faucet
Get free Kiln ETH.
Start building today
Goerli faucet
Get free Goerli ETH.
Start building today
SEPOLIA FAUCET
Get free Sepolia ETH.
Start Building Today
mumbai faucet
Get free Mumbai Matic.
Start building today
rinkeby faucet
Get free Rinkeby
ETH.
Start building today
Start building on Ethereum.
Get started for free
Start building on Ethereum.
Get started for free
Start building on Flow.
Get started for free
Start building on Polygon.
Get started for free
Start building on Starknet.
Get started for free
Start building on Optimism.
Get started for free
Start building on Solana.
Get started for free
Start building on Solana.
Sign up for beta access
Start building on Solana.
Join the waitlist
Arbitrum logo
Start building on Arbitrum.
Get started for free
Learn
Solidity at
Alchemy
University
Get started today
curl 
https://release.solana.com/v1.10.32/solana-install-init-x86_64-pc-windows-msvc.exe 
--output 
C:\solana-install-tmp\solana-install-init.exe 
--create-dirs
Solana
COMPRESSED NFTS OVERVIEW

What are compressed NFTs?

Learn About Compressed NFTs and How They Work
Last Updated:
January 26, 2023
Table of Contents
Table of Contents
Table of Contents

{{get-started-solana}}

Compressed NFTs on Solana reduce the costs of minting and managing large numbers of NFTs by storing data in the ledger itself. Minting compressed NFTs is significantly more cost-effective than minting conventional NFTs, which creates a range of new use cases and ways to onboard more Solana active users.

This article will explain what compressed NFTs are, how they work, and how to compress your existing or new NFTs.

What are compressed NFTs?

Compressed NFTs are NFTs on Solana that store their data in a Merkle tree structure where the Merkle root is on-chain in an account and the Merkle leaves are stored in the Solana ledger (which is off-chain, but subject to consensus), rather than fully on-chain like conventional NFTs.

As with ordinary NFTs, compressed NFTs are issued and confirmed on-chain, however, Solana RPC providers are used to store and handle data off-chain to minimize storage costs.

Compressed NFTs use indexers to manage transaction data and facilitate data queries between RPCs and on-chain smart contracts. Existing smart contracts must be modified in order to interact with compressed NFTs. Alternatively, compressed NFTs may be decompressed to work with unmodified Solana programs.

Who created compressed NFTs?

Compressed NFTs are the combined creation of Solana Labs’s Merkle tree program (known as account-compression) and the Metaplex Foundation’s compressed NFTs program (known as Bubblegum).

Metaplex created the NFT standards for Solana, and the founding team was spun out of Solana Labs. Since its launch in 2021, Metaplex has facilitated the minting of more than 22 million NFTs and generated $3.36 billion in NFT sales. The Merkle tree program on Solana enables compressed NFTs created via Metaplex to be encoded into the Solana blockchain’s ledger.

What are common use cases for compressed NFTs?

Compressed NFTs enable businesses and individuals to mint NFTs on a massive scale without incurring the prohibitive associated costs compared to conventional NFTs. Industries that could make use of compressed NFTs include: gaming, music, events, metaverses, and enterprises.

1. Gaming

Compressed NFTs could potentially serve as in-game assets for millions of players. Because of the potential scale of web3 games, compressed NFTs can save web3 game development companies costs while issuing millions of in-game NFTs.

2. Music and Events

With millions of concert and events tickets sold every year, compressed NFTs can save ticketing companies money and act as digital collectibles for event goers all while providing the security and authenticity of web3 products.

3. Metaverse

With the growing popularity of metaverses and metaverse-like games, compressed NFTs enable metaverse development companies to digitize large numbers of in-game collectibles for millions of people globally.

4. Enterprise level systems

From tracking merchandise across supply chains to digitizing public records, compressed NFTs could allow large organizations to mint, store, and retrieve NFTs in massive volumes at a fraction of the cost of today's NFT implementations.

When should compressed NFTs be used?

Compressed NFTs should be used when minting NFTs at scale, as storing data off-chain significantly reduces the cost to rent account space which every Solana account is required to pay to manage data.

Compressed NFTs vs Uncompressed NFTs

Both compressed NFTs and uncompressed NFTs are issued and verified on chain, but the main difference is where the NFT metadata is stored. Compressed NFTs store metadata off-chain, and traditional Solana NFTs store data on-chain.

How are compressed NFTs different from NFTs?

Compressed NFTs are different from conventional NFTs in four key ways:

1. NFT Metadata Storage

Compressed NFTs store their data off-chain in a Merkle tree and are accessed via Solana RPC providers.

2. Cost

Because they store data off-chain, compressed NFTs are significantly more cost-effective.

3. Data Ownership

When you want to modify a compressed NFT, you must cryptographically prove your authority to change the off-chain data, which ensures off-chain data storage can be trusted.

4. Program Interactions

Existing programs (i.e. Solana smart contracts) must be modified to interact with compressed NFTs, unless the NFTs themselves are de-compressed.

How much money do compressed NFTs save?

To mint 1 million conventional NFTs, it would roughly 12,000 SOL, and minting the same number of compressed NFTs would cost just 5 SOL, or 99.9% cost savings.

In fact, the larger the collection of NFTs, the greater the reduction in minting costs with compression, as demonstrated in the image below:

Cost of minting compressed and uncompressed NFTs.

Because the most significant outlay when minting conventional NFTs is paying for storage space on Solana, which compressed NFTs remove, the majority of the remaining costs are simple transaction fees.

What is the cost to mint a 10k Solana NFT collection?

To mint 10,000 compressed NFTs, which is the standard NFT collection size for new projects, is roughly 3.5 SOL. The table below provides a detailed look on the cost of minting compressed NFT collections from quantities ranging from 10k to 1 billion NFTs:

Quantity Tree rent
(SOL)
Tree TX cost
(SOL)
Total cost
(SOL)
Cost per NFT
(SOL)
10k 3.48 0.01 3.49 0.000349
100k 4.17 0.05 4.22 0.0000422
1m 4.85 0.5 5.35 0.0000053
100m 6.45 50 56.45 6e-7
1b 7.13 500 507.13 5e-7

How do compressed NFTs work?

Here's a how NFTs get compressed:

  1. Metaplex’s Bubblegum program is used to verify the metadata associated with an NFT
  2. Bubblegum calls account-compression to append a new leaf to the Merkle tree
  3. Account-compression updates the Merkle tree on-chain to reflect the new state of the world
  4. Any changes to the Merkle tree, such as the addition of new NFTs, are written to the Solana blockchain

Off-chain indexers keep track of modifications to the Merkle tree and manage the information and authorizations necessary to support dapps and programs.

What are compressed NFT authorities? 

Authorities are attributes associated with an NFT account which specify what the account can do. Every NFT account has three other accounts under it:

  1. A mint account
  2. An associated token account
  3. A wallet account

Each of these subordinate accounts have different attributes associated with it.

1. Tree Authority

This authority is typically a program that is authorized to add new leaves to the tree via the account-compression program, and that program also handles encoding the cryptographic hashes.

2. Leaf Authority

This is an attribute given to a wallet account that owns a leaf. The wallet account can be used to replace, remove and decompress a leaf.

Where are compressed NFTs stored?

Compressed NFT metadata is stored in a Merkle tree off-chain with Solana RPC service providers, and this data is monitored by an indexer. This is more cost effective than storing the same data on-chain. In effect, the data is off-chain, while the much smaller proof of the data is on-chain in the form of the Merkle tree root.

How to Compress NFTs

Compressing NFTs is a fairly straightforward task, but the process varies slightly depending on whether you’re compressing new or existing NFTs.

Compressing New NFTs

Here are the four steps to compress new NFTs (NFTs that have not been minted yet):

  1. Metaplex’s Bubblegum software is used to create a Gummyroll Merkle tree
  2. The Bubblegum mintNFT instruction is called
  3. The mintNFT instruction is retrieved from the ledger by the off-chain indexer, and the leaf metadata is saved.
  4. The get_assets_for_owner instruction is called by the dapp through an RPC node to return the NFT

Compressing Existing NFTs

Here are the three steps to compress existing NFTs (NFTs that have already been minted):

  1. The transfer instruction on is called on Bubblegum program along with the NFT information
  2. The Bubblegum program makes a cross-program invocation to Gummyroll to add a new Merkle tree root
  3. An off-chain indexer retrieves the transfer instruction from the blockchain and updates the leaf's owner property.

Step three ensures that the ownership of the NFT represented by the leaf is transferred to the new owner.

To compress existing NFTs it is not necessary to create the Gummyroll tree from scratch, instead read Metaplex's compressed NFT documentation for more information.

How does NFT decompression work?

The decompression process removes an NFT from the off-chain Merkle tree dataset. Here is a simple breakdown:

Once the Token Metadata Program has verified the integrity of the leaf on the merkle tree that corresponds to the NFT, the program creates the following accounts:

  1. Mint Account
  2. Associated Token Account (ATA)
  3. Token Metadata Account
  4. Master Edition Account

The Token Metadata Program then updates the Merkle tree to remove the leaf.

ALCHEMY SUPERNODE - ETHEREUM NODE API

Scale to any size, without any errors

Alchemy Supernode finally makes it possible to scale blockchain applications without all the headaches. Plus, our legendary support will guide you every step of the way.

Get started for free
Supernode footer
Solana
COMPRESSED NFTS OVERVIEW

What are compressed NFTs?

Learn About Compressed NFTs and How They Work
Last Updated:
January 26, 2023
Don't miss an update
Sign up for our newsletter to get alpha, key insights, and killer resources.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Table of Contents
Table of Contents

{{get-started-solana}}

Compressed NFTs on Solana reduce the costs of minting and managing large numbers of NFTs by storing data in the ledger itself. Minting compressed NFTs is significantly more cost-effective than minting conventional NFTs, which creates a range of new use cases and ways to onboard more Solana active users.

This article will explain what compressed NFTs are, how they work, and how to compress your existing or new NFTs.

What are compressed NFTs?

Compressed NFTs are NFTs on Solana that store their data in a Merkle tree structure where the Merkle root is on-chain in an account and the Merkle leaves are stored in the Solana ledger (which is off-chain, but subject to consensus), rather than fully on-chain like conventional NFTs.

As with ordinary NFTs, compressed NFTs are issued and confirmed on-chain, however, Solana RPC providers are used to store and handle data off-chain to minimize storage costs.

Compressed NFTs use indexers to manage transaction data and facilitate data queries between RPCs and on-chain smart contracts. Existing smart contracts must be modified in order to interact with compressed NFTs. Alternatively, compressed NFTs may be decompressed to work with unmodified Solana programs.

Who created compressed NFTs?

Compressed NFTs are the combined creation of Solana Labs’s Merkle tree program (known as account-compression) and the Metaplex Foundation’s compressed NFTs program (known as Bubblegum).

Metaplex created the NFT standards for Solana, and the founding team was spun out of Solana Labs. Since its launch in 2021, Metaplex has facilitated the minting of more than 22 million NFTs and generated $3.36 billion in NFT sales. The Merkle tree program on Solana enables compressed NFTs created via Metaplex to be encoded into the Solana blockchain’s ledger.

What are common use cases for compressed NFTs?

Compressed NFTs enable businesses and individuals to mint NFTs on a massive scale without incurring the prohibitive associated costs compared to conventional NFTs. Industries that could make use of compressed NFTs include: gaming, music, events, metaverses, and enterprises.

1. Gaming

Compressed NFTs could potentially serve as in-game assets for millions of players. Because of the potential scale of web3 games, compressed NFTs can save web3 game development companies costs while issuing millions of in-game NFTs.

2. Music and Events

With millions of concert and events tickets sold every year, compressed NFTs can save ticketing companies money and act as digital collectibles for event goers all while providing the security and authenticity of web3 products.

3. Metaverse

With the growing popularity of metaverses and metaverse-like games, compressed NFTs enable metaverse development companies to digitize large numbers of in-game collectibles for millions of people globally.

4. Enterprise level systems

From tracking merchandise across supply chains to digitizing public records, compressed NFTs could allow large organizations to mint, store, and retrieve NFTs in massive volumes at a fraction of the cost of today's NFT implementations.

When should compressed NFTs be used?

Compressed NFTs should be used when minting NFTs at scale, as storing data off-chain significantly reduces the cost to rent account space which every Solana account is required to pay to manage data.

Compressed NFTs vs Uncompressed NFTs

Both compressed NFTs and uncompressed NFTs are issued and verified on chain, but the main difference is where the NFT metadata is stored. Compressed NFTs store metadata off-chain, and traditional Solana NFTs store data on-chain.

How are compressed NFTs different from NFTs?

Compressed NFTs are different from conventional NFTs in four key ways:

1. NFT Metadata Storage

Compressed NFTs store their data off-chain in a Merkle tree and are accessed via Solana RPC providers.

2. Cost

Because they store data off-chain, compressed NFTs are significantly more cost-effective.

3. Data Ownership

When you want to modify a compressed NFT, you must cryptographically prove your authority to change the off-chain data, which ensures off-chain data storage can be trusted.

4. Program Interactions

Existing programs (i.e. Solana smart contracts) must be modified to interact with compressed NFTs, unless the NFTs themselves are de-compressed.

How much money do compressed NFTs save?

To mint 1 million conventional NFTs, it would roughly 12,000 SOL, and minting the same number of compressed NFTs would cost just 5 SOL, or 99.9% cost savings.

In fact, the larger the collection of NFTs, the greater the reduction in minting costs with compression, as demonstrated in the image below:

Cost of minting compressed and uncompressed NFTs.

Because the most significant outlay when minting conventional NFTs is paying for storage space on Solana, which compressed NFTs remove, the majority of the remaining costs are simple transaction fees.

What is the cost to mint a 10k Solana NFT collection?

To mint 10,000 compressed NFTs, which is the standard NFT collection size for new projects, is roughly 3.5 SOL. The table below provides a detailed look on the cost of minting compressed NFT collections from quantities ranging from 10k to 1 billion NFTs:

Quantity Tree rent
(SOL)
Tree TX cost
(SOL)
Total cost
(SOL)
Cost per NFT
(SOL)
10k 3.48 0.01 3.49 0.000349
100k 4.17 0.05 4.22 0.0000422
1m 4.85 0.5 5.35 0.0000053
100m 6.45 50 56.45 6e-7
1b 7.13 500 507.13 5e-7

How do compressed NFTs work?

Here's a how NFTs get compressed:

  1. Metaplex’s Bubblegum program is used to verify the metadata associated with an NFT
  2. Bubblegum calls account-compression to append a new leaf to the Merkle tree
  3. Account-compression updates the Merkle tree on-chain to reflect the new state of the world
  4. Any changes to the Merkle tree, such as the addition of new NFTs, are written to the Solana blockchain

Off-chain indexers keep track of modifications to the Merkle tree and manage the information and authorizations necessary to support dapps and programs.

What are compressed NFT authorities? 

Authorities are attributes associated with an NFT account which specify what the account can do. Every NFT account has three other accounts under it:

  1. A mint account
  2. An associated token account
  3. A wallet account

Each of these subordinate accounts have different attributes associated with it.

1. Tree Authority

This authority is typically a program that is authorized to add new leaves to the tree via the account-compression program, and that program also handles encoding the cryptographic hashes.

2. Leaf Authority

This is an attribute given to a wallet account that owns a leaf. The wallet account can be used to replace, remove and decompress a leaf.

Where are compressed NFTs stored?

Compressed NFT metadata is stored in a Merkle tree off-chain with Solana RPC service providers, and this data is monitored by an indexer. This is more cost effective than storing the same data on-chain. In effect, the data is off-chain, while the much smaller proof of the data is on-chain in the form of the Merkle tree root.

How to Compress NFTs

Compressing NFTs is a fairly straightforward task, but the process varies slightly depending on whether you’re compressing new or existing NFTs.

Compressing New NFTs

Here are the four steps to compress new NFTs (NFTs that have not been minted yet):

  1. Metaplex’s Bubblegum software is used to create a Gummyroll Merkle tree
  2. The Bubblegum mintNFT instruction is called
  3. The mintNFT instruction is retrieved from the ledger by the off-chain indexer, and the leaf metadata is saved.
  4. The get_assets_for_owner instruction is called by the dapp through an RPC node to return the NFT

Compressing Existing NFTs

Here are the three steps to compress existing NFTs (NFTs that have already been minted):

  1. The transfer instruction on is called on Bubblegum program along with the NFT information
  2. The Bubblegum program makes a cross-program invocation to Gummyroll to add a new Merkle tree root
  3. An off-chain indexer retrieves the transfer instruction from the blockchain and updates the leaf's owner property.

Step three ensures that the ownership of the NFT represented by the leaf is transferred to the new owner.

To compress existing NFTs it is not necessary to create the Gummyroll tree from scratch, instead read Metaplex's compressed NFT documentation for more information.

How does NFT decompression work?

The decompression process removes an NFT from the off-chain Merkle tree dataset. Here is a simple breakdown:

Once the Token Metadata Program has verified the integrity of the leaf on the merkle tree that corresponds to the NFT, the program creates the following accounts:

  1. Mint Account
  2. Associated Token Account (ATA)
  3. Token Metadata Account
  4. Master Edition Account

The Token Metadata Program then updates the Merkle tree to remove the leaf.

Compressed NFTs on Solana reduce the costs of minting and managing large numbers of NFTs by storing data in the ledger itself. Minting compressed NFTs is significantly more cost-effective than minting conventional NFTs, which creates a range of new use cases and ways to onboard more Solana active users.

This article will explain what compressed NFTs are, how they work, and how to compress your existing or new NFTs.

What are compressed NFTs?

Compressed NFTs are NFTs on Solana that store their data in a Merkle tree structure where the Merkle root is on-chain in an account and the Merkle leaves are stored in the Solana ledger (which is off-chain, but subject to consensus), rather than fully on-chain like conventional NFTs.

As with ordinary NFTs, compressed NFTs are issued and confirmed on-chain, however, Solana RPC providers are used to store and handle data off-chain to minimize storage costs.

Compressed NFTs use indexers to manage transaction data and facilitate data queries between RPCs and on-chain smart contracts. Existing smart contracts must be modified in order to interact with compressed NFTs. Alternatively, compressed NFTs may be decompressed to work with unmodified Solana programs.

Who created compressed NFTs?

Compressed NFTs are the combined creation of Solana Labs’s Merkle tree program (known as account-compression) and the Metaplex Foundation’s compressed NFTs program (known as Bubblegum).

Metaplex created the NFT standards for Solana, and the founding team was spun out of Solana Labs. Since its launch in 2021, Metaplex has facilitated the minting of more than 22 million NFTs and generated $3.36 billion in NFT sales. The Merkle tree program on Solana enables compressed NFTs created via Metaplex to be encoded into the Solana blockchain’s ledger.

What are common use cases for compressed NFTs?

Compressed NFTs enable businesses and individuals to mint NFTs on a massive scale without incurring the prohibitive associated costs compared to conventional NFTs. Industries that could make use of compressed NFTs include: gaming, music, events, metaverses, and enterprises.

1. Gaming

Compressed NFTs could potentially serve as in-game assets for millions of players. Because of the potential scale of web3 games, compressed NFTs can save web3 game development companies costs while issuing millions of in-game NFTs.

2. Music and Events

With millions of concert and events tickets sold every year, compressed NFTs can save ticketing companies money and act as digital collectibles for event goers all while providing the security and authenticity of web3 products.

3. Metaverse

With the growing popularity of metaverses and metaverse-like games, compressed NFTs enable metaverse development companies to digitize large numbers of in-game collectibles for millions of people globally.

4. Enterprise level systems

From tracking merchandise across supply chains to digitizing public records, compressed NFTs could allow large organizations to mint, store, and retrieve NFTs in massive volumes at a fraction of the cost of today's NFT implementations.

When should compressed NFTs be used?

Compressed NFTs should be used when minting NFTs at scale, as storing data off-chain significantly reduces the cost to rent account space which every Solana account is required to pay to manage data.

Compressed NFTs vs Uncompressed NFTs

Both compressed NFTs and uncompressed NFTs are issued and verified on chain, but the main difference is where the NFT metadata is stored. Compressed NFTs store metadata off-chain, and traditional Solana NFTs store data on-chain.

How are compressed NFTs different from NFTs?

Compressed NFTs are different from conventional NFTs in four key ways:

1. NFT Metadata Storage

Compressed NFTs store their data off-chain in a Merkle tree and are accessed via Solana RPC providers.

2. Cost

Because they store data off-chain, compressed NFTs are significantly more cost-effective.

3. Data Ownership

When you want to modify a compressed NFT, you must cryptographically prove your authority to change the off-chain data, which ensures off-chain data storage can be trusted.

4. Program Interactions

Existing programs (i.e. Solana smart contracts) must be modified to interact with compressed NFTs, unless the NFTs themselves are de-compressed.

How much money do compressed NFTs save?

To mint 1 million conventional NFTs, it would roughly 12,000 SOL, and minting the same number of compressed NFTs would cost just 5 SOL, or 99.9% cost savings.

In fact, the larger the collection of NFTs, the greater the reduction in minting costs with compression, as demonstrated in the image below:

Cost of minting compressed and uncompressed NFTs.

Because the most significant outlay when minting conventional NFTs is paying for storage space on Solana, which compressed NFTs remove, the majority of the remaining costs are simple transaction fees.

What is the cost to mint a 10k Solana NFT collection?

To mint 10,000 compressed NFTs, which is the standard NFT collection size for new projects, is roughly 3.5 SOL. The table below provides a detailed look on the cost of minting compressed NFT collections from quantities ranging from 10k to 1 billion NFTs:

Quantity Tree rent
(SOL)
Tree TX cost
(SOL)
Total cost
(SOL)
Cost per NFT
(SOL)
10k 3.48 0.01 3.49 0.000349
100k 4.17 0.05 4.22 0.0000422
1m 4.85 0.5 5.35 0.0000053
100m 6.45 50 56.45 6e-7
1b 7.13 500 507.13 5e-7

How do compressed NFTs work?

Here's a how NFTs get compressed:

  1. Metaplex’s Bubblegum program is used to verify the metadata associated with an NFT
  2. Bubblegum calls account-compression to append a new leaf to the Merkle tree
  3. Account-compression updates the Merkle tree on-chain to reflect the new state of the world
  4. Any changes to the Merkle tree, such as the addition of new NFTs, are written to the Solana blockchain

Off-chain indexers keep track of modifications to the Merkle tree and manage the information and authorizations necessary to support dapps and programs.

What are compressed NFT authorities? 

Authorities are attributes associated with an NFT account which specify what the account can do. Every NFT account has three other accounts under it:

  1. A mint account
  2. An associated token account
  3. A wallet account

Each of these subordinate accounts have different attributes associated with it.

1. Tree Authority

This authority is typically a program that is authorized to add new leaves to the tree via the account-compression program, and that program also handles encoding the cryptographic hashes.

2. Leaf Authority

This is an attribute given to a wallet account that owns a leaf. The wallet account can be used to replace, remove and decompress a leaf.

Where are compressed NFTs stored?

Compressed NFT metadata is stored in a Merkle tree off-chain with Solana RPC service providers, and this data is monitored by an indexer. This is more cost effective than storing the same data on-chain. In effect, the data is off-chain, while the much smaller proof of the data is on-chain in the form of the Merkle tree root.

How to Compress NFTs

Compressing NFTs is a fairly straightforward task, but the process varies slightly depending on whether you’re compressing new or existing NFTs.

Compressing New NFTs

Here are the four steps to compress new NFTs (NFTs that have not been minted yet):

  1. Metaplex’s Bubblegum software is used to create a Gummyroll Merkle tree
  2. The Bubblegum mintNFT instruction is called
  3. The mintNFT instruction is retrieved from the ledger by the off-chain indexer, and the leaf metadata is saved.
  4. The get_assets_for_owner instruction is called by the dapp through an RPC node to return the NFT

Compressing Existing NFTs

Here are the three steps to compress existing NFTs (NFTs that have already been minted):

  1. The transfer instruction on is called on Bubblegum program along with the NFT information
  2. The Bubblegum program makes a cross-program invocation to Gummyroll to add a new Merkle tree root
  3. An off-chain indexer retrieves the transfer instruction from the blockchain and updates the leaf's owner property.

Step three ensures that the ownership of the NFT represented by the leaf is transferred to the new owner.

To compress existing NFTs it is not necessary to create the Gummyroll tree from scratch, instead read Metaplex's compressed NFT documentation for more information.

How does NFT decompression work?

The decompression process removes an NFT from the off-chain Merkle tree dataset. Here is a simple breakdown:

Once the Token Metadata Program has verified the integrity of the leaf on the merkle tree that corresponds to the NFT, the program creates the following accounts:

  1. Mint Account
  2. Associated Token Account (ATA)
  3. Token Metadata Account
  4. Master Edition Account

The Token Metadata Program then updates the Merkle tree to remove the leaf.

Build web3 with Alchemy

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

 Start building