Build an OpenZeppelin-compatible Merkle tree for airdrops and allowlists, with root and per-leaf proofs.
Loading tool
About Merkle Tree Generator
Build a Merkle tree from CSV rows (for example address,amount), with the leaf encoding given as Solidity types. Leaves are double-hashed and pairs sorted the same way as OpenZeppelin's StandardMerkleTree, so the root and proofs work with MerkleProof.verify. You can view the proof for any row, verify a leaf and proof against a root, and export the StandardMerkleTree dump JSON or a Solidity verifier contract.
Common uses
- Generate the Merkle root and proofs for a token airdrop
- Build an NFT mint allowlist
- Check a proof that a claim contract rejects
- Export a tree dump to load with StandardMerkleTree.load() in a backend
FAQ
- How do Merkle airdrops work?
- The contract stores only the Merkle root. Each claimer submits their leaf data and a proof, a list of sibling hashes, and the contract recomputes the root to check that the leaf is in the tree.
- Why does OpenZeppelin's StandardMerkleTree hash leaves twice?
- Leaves are keccak256(bytes.concat(keccak256(abi.encode(...)))). Double hashing ensures a leaf can never equal an internal node hash, which prevents second-preimage attacks.
- Why does my proof fail in Solidity?
- The leaf in the contract must be built with the same types, column order and encoding (abi.encode, double-hashed) as the tree. A mismatch in any of them gives a different leaf hash.