Airdrops allow you to distribute tokens to many recipients at once. They reward early supporters, attract new users, and help build a strong community. However, each transaction incurs a fee, which means airdrops can quickly become expensive. On Solana, you may also need to create a token account for each new holder, further increasing the cost. Once your recipient list exceeds a few hundred addresses, these expenses can turn an exciting giveaway into a budget challenge.
In this guide, we’ll explore:
- How traditional Solana airdrops work
- Where the costs come from
- How Zero-Knowledge (ZK) compression solves these problems
- How to use AirShip for low-cost, large-scale airdrops
Let’s dive in.
How Traditional Solana Airdrops Work
A standard Solana airdrop involves two steps for each recipient:
- Create an Associated Token Account (ATA) if the recipient doesn’t have one.
- Transfer tokens to that ATA.
Here’s a simplified code example using @solana/web3.js and @solana/spl-token:
// Simple SPL token airdrop script that creates token accounts if they don't exist
import {
Connection,
PublicKey,
Keypair,
Transaction,
sendAndConfirmTransaction,
} from "@solana/web3.js";
import {
createTransferInstruction,
getOrCreateAssociatedTokenAccount,
} from "@solana/spl-token";
import bs58 from 'bs58';
// Configure these values
const TOKEN_MINT = new PublicKey("TOKEN_MINT_ADDRESS");
const recipients = [
{ address: "RECIPIENT_ADDRESS_1", amount: 0.05 },
// Add more recipients as needed
];
async function airdropTokens(connection, senderKeypair) {
const senderATA = await getOrCreateAssociatedTokenAccount(
connection,
senderKeypair,
TOKEN_MINT,
senderKeypair.publicKey
);
for (const recipient of recipients) {
try {
const recipientPubkey = new PublicKey(recipient.address);
const recipientATA = await getOrCreateAssociatedTokenAccount(
connection,
senderKeypair,
TOKEN_MINT,
recipientPubkey
);
const transferIx = createTransferInstruction(
senderATA.address,
recipientATA.address,
senderKeypair.publicKey,
recipient.amount * 10 ** 9 // Adjust for token decimals
);
const tx = new Transaction().add(transferIx);
const signature = await sendAndConfirmTransaction(connection, tx, [senderKeypair]);
console.log(`Sent ${recipient.amount} tokens to ${recipient.address}`);
} catch (err) {
console.error(`Failed to send to ${recipient.address}:`, err);
}
}
}
// Usage
const connection = new Connection("RPC_ENDPOINT");
const secretKey = bs58.decode("WALLET_PRIVATE_KEY");
const senderKeypair = Keypair.fromSecretKey(secretKey);
airdropTokens(connection, senderKeypair)
.then(() => console.log("Airdrop complete!"))
.catch(console.error);Understanding Airdrop Costs on Solana
The primary cost driver in Solana airdrops is the requirement for each recipient to have a dedicated token account. An Associated Token Account (ATA) links a user’s wallet address to a specific token mint. If a recipient doesn’t have an ATA for your token, you must create one for them. This creation costs approximately 0.002 SOL, as you’re paying rent to store data on the blockchain (i.e., address X holds this amount of token Y). For a few hundred recipients, this might be manageable. But for tens of thousands, these fees accumulate quickly.
Cost Breakdown for Traditional Airdrops
- Base transaction fee: 0.000005 SOL per address
- Token account creation: ~0.002 SOL per new account
Let’s calculate costs for 10,000 recipients:
- With new accounts: ~20 SOL total
At $240 per SOL, that’s $4,800 - Without new accounts: ~0.05 SOL (transfers only)
At the same rate, 0.05 SOL equals $12
If SOL’s price increases or you plan to reach 100,000 or 1 million addresses, these costs become prohibitive—especially before considering priority fees.
The Solution: ZK-Compressed Airdrops
With ZK compression, you don’t need to create full on-chain accounts for each user. Instead, you bundle everyone’s data into a single hash (a Merkle root) backed by zero-knowledge proofs. This approach:
- Eliminates rent payments for individual token accounts
- Replaces thousands of on-chain accounts with one on-chain root
For the same 10,000 recipients, the cost drops to approximately 0.01 SOL total—just $2.40 at current rates. Savings increase as you scale beyond this number, all while maintaining Solana’s security.
👉 Explore advanced airdrop strategies
How ZK Compression Reduces Airdrop Costs
Essentially, ZK Compression stores token data off-chain while keeping a small “fingerprint” (hash) on-chain. This fingerprint references ledger data, leveraging Solana’s security. But it avoids creating a standard on-chain account for each wallet, reducing fees by over 95%.
For 10,000 recipients, a ZK-compressed airdrop costs about 0.01 SOL—a dramatic reduction from ~20 SOL. Savings become even more substantial at millions of addresses.
How Does ZK Compression Work?
Let’s break down the key concepts behind ZK compression.
Merkle Trees
A Merkle tree is a data structure that organizes multiple data points (e.g., thousands of user balances) into a single compact hash called a root. Each “leaf” in the tree represents a piece of data (like a compressed account). Leaves are paired and hashed to create “parent” hashes, which are combined until reaching the final root. This root is all you need to verify whether any individual data (like an account balance) is authentic and unaltered.
Instead of storing each user’s token account on-chain, you store only the Merkle root on-chain. The underlying data (e.g., each user’s token balance) is held in Solana’s ledger. This ledger data derives the current state and is verifiable against the Merkle root.
Off-Chain Storage
Here, “off-chain” means the full data (e.g., detailed account info per user) isn’t stored in traditional on-chain accounts. Instead, it’s recorded in Solana’s ledger in a more cost-effective form. Specialized indexers track and manage this data, ensuring it can be efficiently accessed and verified against the on-chain Merkle root.
How Can We Trust Off-Chain/Ledger Data?
Since the Merkle root is stored on-chain, anyone can verify off-chain data by checking it against that root. If someone tries to alter a user’s balance off-chain, the updated balance won’t match the on-chain Merkle root. The proof will fail, and the runtime will reject the transaction.
This lets you store vast amounts of data (e.g., millions of accounts) without paying rent for each account, while ensuring all data remains correct.
Zero-Knowledge Proofs (ZKPs)
Zero-knowledge proofs allow you to prove a statement without revealing all its details. Think of it like showing a friend you know what’s in a sealed box without opening it. They can verify your claim is valid without either of you opening the box. On Solana, this means you can prove an account’s balance matches the Merkle root without uploading any on-chain data.
Why Use ZK Proofs?
- Small proof size: ZK proofs on Solana are becoming increasingly efficient, with many now compact enough to fit within Solana’s transaction size limits (~a few hundred bytes). This efficiency enables scalable, low-cost verification without overloading the network.
- Reduced on-chain load: Instead of storing every account update on-chain, you submit a small proof referencing the Merkle root. When updates occur, the root changes to reflect the new state, but you still avoid storing all detailed data directly on-chain.
- Security: Proofs confirm your off-chain data matches the on-chain root “fingerprint.” If they don’t match, the proof fails, and the transaction is rejected.
ZK proofs tie everything together. You keep only the root on-chain and rely on proofs to confirm any changes to off-chain data are legitimate.
How ZK Compression Saves Money
ZK Compression saves Solana developers money in three main ways:
- No individual token accounts per wallet address: Instead of creating thousands of separate accounts, you batch them into a single Merkle tree.
- Lower rent: The blockchain stores only one Merkle root instead of each user’s full data, drastically reducing state storage costs (“rent”).
Example: ZK-Compressed Airdrop Costs
Suppose you want to airdrop tokens to 10,000 users. Here’s how the costs compare:
Traditional method:
- Create up to 10,000 on-chain token accounts, paying rent for each.
- Each account creation incurs a small but significant fee.
ZK Compression method:
- Build an off-chain Merkle tree covering all 10,000 balances.
- Submit a single “root” of that tree on-chain.
- Maintain and update just one root per airdrop action, proven via ZK proofs.
Even if you need multiple Merkle trees for very large user bases, the data stored on-chain remains far less than setting up individual token accounts for everyone. That’s where the major savings come from.
In Summary:
- Merkle trees compress vast numbers of accounts into a single hash (root).
- Off-chain storage reduces on-chain rent costs.
- ZK proofs guarantee off-chain data is valid without placing all details on-chain.
This combination makes large-scale airdrops or massive user bases much more affordable on Solana by eliminating rent payments for each user’s account.
How to Use AirShip for ZK-Compressed Token Airdrops
AirShip is a free, open-source tool built for ZK-compressed airdrops. It offers two main options:
- Web UI: The easiest way to send airdrops. It runs in your browser—no setup required.
- CLI: Faster and more secure, running locally instead of in a browser.
Both handle ZK compression details for you. They work with RPC endpoints that support compressed tokens. You can get a free endpoint at helius.dev.
Prerequisites
- A Solana wallet holding the tokens you want to distribute.
- Enough SOL to cover minimal fees.
- A list of recipient addresses (e.g., CSV file, NFT holders, token holders). We recommend using DAS (Digital Asset Standard) to efficiently fetch asset holder data.
- An RPC that supports ZK compression and the DAS API.
Using the Web UI
- Go to the AirShip website and click “Create New Airdrop.”
- Enter your private key and RPC URL (e.g.,
https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY).
⚠️ Warning: Use a temporary wallet created explicitly for this airdrop task. The private key is used only to simplify signing and sending transactions. It isn’t stored or shared anywhere, keeping your other assets secure.
- Select recipients: Choose NFT, token, or Saga holders, or upload your own CSV file.
- Set token amounts: Specify the quantity or percentage of tokens to airdrop.
- Review and confirm: Double-check the summary, then confirm the airdrop.
AirShip handles batch sending and ZK proofs in the background. The UI lets you track transaction progress and completion time.
Using the CLI
If you prefer working in the terminal, the CLI is better for larger airdrops.
Install via pnpm:
npm install -g helius-airship
Or build from source:
git clone https://github.com/helius-labs/airship.git
cd airship
pnpm install && pnpm build
cd packages/cli
pnpm link --globalRun the CLI:
helius-airship \ --keypair /path/to/your_wallet.json \ --url "https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY"- Add target list: Follow the prompts to input recipient details (CSV, etc.) and token amounts.
AirShip will now send batch transactions to your airdrop recipients.
Frequently Asked Questions
What is an Associated Token Account (ATA) on Solana?
An ATA is a dedicated account that holds a specific type of SPL token for a user. It associates a user’s wallet address with a token mint, enabling them to receive, hold, and send that token. If a user doesn’t have an ATA for a token, one must be created before they can receive it, incurring a cost.
How does ZK compression reduce costs compared to traditional methods?
ZK compression avoids creating individual on-chain token accounts for each recipient. Instead, it uses Merkle trees to represent multiple balances off-chain, with only a single hash stored on-chain. This eliminates rent costs for thousands of accounts, reducing fees by over 95% for large airdrops.
Is ZK compression secure for large-scale airdrops?
Yes. ZK compression relies on zero-knowledge proofs and Merkle roots to ensure data integrity. Off-chain data is verified against on-chain hashes, maintaining security while reducing costs. The approach leverages Solana’s security model without storing redundant data on-chain.
Can I use AirShip for small airdrops?
Absolutely. AirShip is efficient for both small and large airdrops. However, cost savings are most noticeable at scale. For very small batches (e.g., under 100 recipients), traditional methods may be simpler, but AirShip remains a viable option.
What are the risks of using a browser-based tool like AirShip’s Web UI?
The primary risk involves handling private keys in a browser environment. To mitigate this, use a temporary wallet with only the necessary funds for the airdrop. Never use your main wallet’s private key in a web tool. The CLI is recommended for enhanced security.
Do recipients need to do anything to receive ZK-compressed tokens?
Recipients may need to “decompress” tokens to view them in standard wallets. This process is usually straightforward and can be initiated by the recipient or integrated into wallet interfaces. Some tools, like AirShip, also help with decompression.
Conclusion
By using ZK compression on Solana, you can achieve significant cost savings. Traditional airdrops often cost 20 SOL or more for 10,000 recipients due to token account creation. With ZK compression, this can drop to 0.01 SOL. Tools like AirShip make it easy to launch these airdrops without writing code from scratch. Whether you’re rewarding early supporters or growing your community, compressed airdrops offer a scalable, affordable solution.