# Keccak Merkle Tree and Proof Builder

> Keccak Merkle Tree and Proof Builder is a paid API for AI agents from chain-tools.use.x402atlas.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Builds a Keccak-based Merkle tree from a list of leaves and returns indexed sorted-pair inclusion proofs with domain separation and odd-node promotion.

## Facts

- Endpoint: POST https://chain-tools.use.x402atlas.com/merkle/build
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/keccak-merkle-tree-and-proof-builder-a4f6496a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UTh2cgHxmYSZwtYc8EE6B

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 keccak-merkle-tree-and-proof-builder-a4f6496a -d '<json body>'
```

Example prompt: Build a Keccak Merkle tree from these leaf values — ['0xabc...', '0xdef...', '0x123...', '0x456...'] — and give me the sorted-pair inclusion proof with domain separation for the leaf at index 2, so I can verify it on-chain.

## When to prefer this

Choose this endpoint when you need to generate a Merkle tree and produce inclusion proofs compatible with Keccak-based Solidity verifiers (e.g. OpenZeppelin MerkleProof), particularly when you require indexed sorted-pair hashing, domain separation, and explicit odd-node promotion. Prefer this over rolling your own implementation when deploying airdrops, allowlists, or governance eligibility checks on EVM chains.

## Known failure modes

- Empty leaf list returns an error — at least one leaf is required
- Duplicate or malformed leaf values may cause unexpected tree structure
- Domain separator mismatch between builder and verifier will cause on-chain verification failure
- Very large leaf sets may time out or exceed payload limits
- Incorrect encoding of leaf values (hex vs raw bytes) leads to wrong root computation

## How this service works

Keccak Merkle tree and proof builder — generate indexed sorted-pair inclusion proofs with domain separation and explicit odd-node promotion.

## Output

Returns the computed Merkle root hash, the leaf's position index within the tree, the ordered array of sibling hashes forming the proof path, and metadata about tree depth and odd-node promotion — everything needed to submit and verify an inclusion proof in a Solidity smart contract.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/keccak-merkle-tree-and-proof-builder-a4f6496a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chain-tools.use.x402atlas.com](https://www.zero.xyz/host/chain-tools.use.x402atlas.com/llms.txt)
