EVMTools

Merkle Proof Generator

Generate and verify Merkle proofs for whitelists and allowlists. Build Merkle trees with keccak256 hashing.

Enter leaf values above to select one.

How It Works

  • 1. Each leaf is hashed with keccak256.
  • 2. Pairs are sorted lexicographically before hashing (OpenZeppelin style).
  • 3. Pairs are concatenated and hashed to form the next level.
  • 4. This continues until a single root hash remains.
  • 5. A proof is the list of sibling hashes needed to reconstruct the root from a leaf.

How to Use This Merkle Proof Generator

This free online Merkle proof generator helps you build Merkle trees, compute roots, and generate inclusion proofs for smart contract allowlists, airdrops, and data verification.

  1. Enter your leaf values, one per line. These can be Ethereum addresses, hex values, or any data to include in the tree.
  2. View the computed Merkle root — this is the single bytes32 value you store on-chain in your smart contract.
  3. Select a specific leaf to generate its Merkle proof — the array of sibling hashes needed to verify membership.
  4. Verify a proof by entering a leaf, proof, and root to confirm membership without rebuilding the entire tree.
  5. Copy the root or proof for use in your Solidity contract deployment or frontend minting logic.

All tree construction and proof generation run locally in your browser. No data is sent to any server.

Common Use Cases

  • NFT allowlist minting — Generate Merkle roots for whitelist addresses and proofs for individual users to submit during minting.
  • Token airdrops — Create Merkle trees of eligible addresses and amounts for gas-efficient claim-based airdrop contracts.
  • Governance voting — Build trees of eligible voters with their voting power for snapshot-based governance systems.
  • Data integrity verification — Generate Merkle proofs to verify that specific data is included in a committed dataset without revealing the entire dataset.
  • Cross-chain proofs — Generate proofs for verifying state or events across different blockchains using Merkle inclusion proofs.

Related Tools

Frequently Asked Questions

What is a Merkle tree?

A Merkle tree is a binary tree where each leaf node is a hash of a data block, and each non-leaf node is a hash of its two children. The root hash (Merkle root) uniquely represents all the data in the tree. Changing any single leaf changes the root, making Merkle trees ideal for data integrity verification and efficient proofs.

What is a Merkle proof and how does it work?

A Merkle proof is a list of sibling hashes along the path from a leaf to the root. It allows anyone to verify that a specific leaf belongs to the tree by recomputing the root from the leaf and proof hashes. The proof size is O(log n), meaning you only need log2(n) hashes to verify membership in a tree with n leaves.

How are Merkle trees used for NFT allowlists?

NFT projects create a Merkle tree from all whitelisted addresses. The Merkle root is stored on-chain in the smart contract (a single bytes32 value). During minting, a user submits their Merkle proof, and the contract verifies it against the stored root using OpenZeppelin's MerkleProof library. This is far cheaper than storing all addresses on-chain.

What is the difference between a Merkle tree and a Patricia trie?

A standard Merkle tree is a complete binary tree used for membership proofs. Ethereum's state trie is a Modified Merkle Patricia Trie, which is a radix trie where each node includes a hash. The Patricia trie supports key-value lookups and updates, while a standard Merkle tree only supports membership proofs. Allowlists typically use standard Merkle trees.

How do I verify a Merkle proof in Solidity?

Use OpenZeppelin's MerkleProof.verify(proof, root, leaf) function. The leaf should be computed as keccak256(abi.encodePacked(address)) for address allowlists. Pass the proof as a bytes32[] array and the root as a bytes32 value stored in the contract. The function recomputes the root from the leaf and proof and compares it.

How many addresses can a Merkle tree handle efficiently?

Merkle trees scale logarithmically. A tree with 1,000 addresses needs proofs of about 10 hashes (10 x 32 bytes = 320 bytes). A tree with 1,000,000 addresses needs only about 20 hashes. The on-chain cost is the same regardless of tree size - just one bytes32 root stored in the contract. This makes Merkle trees practical for allowlists of any size.