The problem: distributing at scale
Rewarding thousands (or millions) of users by sending assets to each address proactively looks simple until the network fees add up. Network fees scale fast when the sender pays for every transfer.The twist: let users claim
An airdrop flips the model. Instead of the distributor paying all fees, each eligible user claims their allocation and covers the network fees themselves. The straightforward approach is to keep a precomputed mapping of recipient → allocation in the contract. When a user sends a claim message, the contract releases the preassigned drop for that user.The naive approach and its limit
Keep a precomputed mapping of recipient → allocation in the contract. When a user sends a claim message, the contract releases the preassigned amount. This works until the list becomes too large. Starting at roughly 3,000 entries, problems begin to surface with the external limit (see more in limits).Scalable airdrop architecture
A scalable airdrop consists of two independent modules:- Double-claim prevention ensures each user can claim only once
- Eligibility verification proves the user is entitled to claim a specific drop
Double-claim prevention
Markers
The airdrop has a small per-user marker contract that records whether the user has already claimed. This marker blocks any subsequent attempts.Eligibility verification
Merkle proof
The airdrop contract stores a root hash of a dictionary (see hashmap) containing all allocations. Users present a Merkle proof to verify their allocation against this root. On-chain state:- Root hash (256 bits)
- Prepare a list of eligible recipients and their allocations, and construct a dictionary.
- Store the root hash in the airdrop contract.
- Provide each user with their Merkle proof.
Signed proof
The airdrop contract stores a backend public key. The backend signs authorization messages for eligible users. Users present the signature to claim. On-chain state:- Backend public key (256 bits)
- Deploy airdrop contract with backend public key.
- Backend validates eligibility criteria on demand.
- Backend signs authorization messages for eligible users.
Claim flow
The claim process combines both modules.- User sends a message that deploys their marker contract along with proof.
- Marker contract checks it has not been deployed before (double-claim prevention).
- Airdrop contract verifies proof (eligibility verification).
- Airdrop contract transfers assets to recipient.
Choosing an approach
Merkle proof fits when:- Trustless, verifiable distribution is required.
- Eligibility list is static or changes infrequently.
- Backend control over claims is not desired.
- Eligibility rules change frequently or depend on external data.
- Trust in the backend is acceptable (centralized projects, known organizations).
- Lower gas costs per claim are a priority.