# AgentsToolsHub Merkle Tree Builder

> AgentsToolsHub Merkle Tree Builder is a paid API for AI agents from agentstoolshub.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-17).

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.

## Facts

- Endpoint: GET https://agentstoolshub.com/api/v1/security/merkle-tree?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentstoolshub-merkle-tree-builder-f8c1b627
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dLzG-Kx2HhuNIgqSDqZhD

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentstoolshub-merkle-tree-builder-f8c1b627
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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().

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentstoolshub-merkle-tree-builder-f8c1b627/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentstoolshub.com](https://www.zero.xyz/host/agentstoolshub.com/llms.txt)
