Merkle Tree Generator
Generate a Merkle tree from a list of addresses or values. Get the Merkle root, proofs for each entry, and Solidity verification code.
Options
Sorting makes the tree deterministic regardless of proof order. OpenZeppelin's MerkleProof uses sorted pairs.
Frequently Asked Questions
What is a Merkle tree?▼
A Merkle tree is a binary tree where each leaf node contains the hash of a data element, and each internal node contains the hash of its two children. The root hash (Merkle root) summarizes the entire dataset. Changing any single leaf changes the root, making it tamper-evident.
How are Merkle trees used in NFT allowlists?▼
NFT projects use Merkle trees to manage allowlists (whitelists) gas-efficiently. Instead of storing thousands of addresses on-chain, only the Merkle root is stored. When a user wants to mint, they provide a Merkle proof (a path of sibling hashes) that their address is in the tree. The contract verifies the proof against the root.
What is a Merkle proof?▼
A Merkle proof is a set of sibling hashes from the leaf to the root. To verify that a leaf is in the tree, you hash the leaf with each proof element in sequence until you reconstruct the root. If the computed root matches the stored root, the leaf is valid.
How does OpenZeppelin's MerkleProof work?▼
OpenZeppelin provides MerkleProof.verify(bytes32[] proof, bytes32 root, bytes32 leaf). The leaf is typically keccak256(abi.encodePacked(address)). You generate the root off-chain, store it in the contract, and generate proofs for each allowlisted address to provide during mint.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
EVM Calldata Decoder
Decode Ethereum transaction calldata from raw hex. Parse function selectors, decode ABI-encoded arguments for all Solidity types, and analyze transaction input data.
Open free tool →
Smart Contract Gas Estimator
Estimate Ethereum smart contract gas costs in USD. Compare operation costs across mainnet, Arbitrum, Optimism, and Base L2 networks.
Open free tool →
NFT Metadata Generator
Generate standard ERC-721 and ERC-1155 NFT metadata JSON following OpenSea metadata standard with attributes and traits.
Open free tool →
More Free Tools
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →