{"uid":"cap_dLzG-Kx2HhuNIgqSDqZhD","slug":"agentstoolshub-merkle-tree-builder-f8c1b627","name":"AgentsToolsHub Merkle Tree Builder","description":"Build a keccak-256 sorted-pair merkle tree (OpenZeppelin convention) from a list of leaves and get the root plus a verification proof for any leaf — the standard construction for token airdrops and allowlists. Fully deterministic: same leaves, same root. Use this when an agent needs to root + proofs for airdrops and whitelists.","url":"https://agentstoolshub.com/api/v1/security/merkle-tree?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["leaves"],"properties":{"leaves":{"type":"string","description":"Leaves (one per line)"},"proofFor":{"type":"string","description":"Exact line to generate the inclusion proof for"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Pac_-YQ38VkGv3cVppiUz","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Builds a keccak-256 sorted-pair Merkle tree (OpenZeppelin convention) from a list of leaf values and returns the Merkle root plus an inclusion proof for any specified leaf.","exampleAgentPrompt":"Build an OpenZeppelin-compatible keccak-256 sorted-pair merkle tree from these wallet addresses — one per line — and give me the merkle root plus an inclusion proof for 0xAbC123: 0xAbC123, 0xDeF456, 0x789GhI, 0xJkL012.","exampleUseCases":[{"title":"Token airdrop allowlist root","prompt":"I have a list of 500 wallet addresses that should receive my ERC-20 airdrop. Can you build a keccak-256 sorted-pair merkle tree from them and give me the merkle root I can deploy in my smart contract? The addresses are: 0xAAA..., 0xBBB..., 0xCCC..."},{"title":"NFT whitelist inclusion proof","prompt":"My NFT mint contract uses an OpenZeppelin merkle allowlist. Can you take these whitelisted addresses and generate a merkle tree, then give me an inclusion proof specifically for 0x1234abcd so the user can pass it to the contract's mint function?"},{"title":"DAO membership verification proof","prompt":"I need to set up a DAO where only approved members can vote. Here's my list of approved wallet addresses — can you build the merkle tree and return both the root hash and a proof for 0xDEADBEEF so they can prove membership on-chain?"}],"resultDescription":"Returns the computed Merkle root (a 32-byte hex hash) of the keccak-256 sorted-pair tree, and if a `proofFor` leaf is specified, also returns the ordered array of sibling hashes forming the inclusion proof for that leaf — fully compatible with OpenZeppelin's MerkleProof.verify().","failureModes":["Missing or empty `leaves` parameter returns an error","Requested `proofFor` value not found among supplied leaves returns proof-not-found error","Malformed or non-string leaf values may cause hash computation errors","Very large leaf lists may hit query string length limits for GET requests","Payment failure or invalid x402 token returns 402 or 401 error"],"whenToPreferThis":"Choose this endpoint when you need a fully deterministic, OpenZeppelin-compatible keccak-256 sorted-pair Merkle tree — the exact construction expected by Solidity contracts using OZ's MerkleProof library. Prefer this over generic hash utilities when building token airdrops, NFT allowlists, DAO membership lists, or any on-chain allowlist that requires Solidity-verifiable proofs without running a local Node.js/Hardhat environment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T12:38:24.457Z","isFirstParty":false,"canonicalSlug":"agentstoolshub-merkle-tree-builder-f8c1b627"}