E

EVM & Solana Utility Tools · Merkle Build

by EVM & Solana Utility Tools

POSTBaseArbitrumPolygon

$0.01

per call · USD Coin on Base

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

Endpoint

POST https://chain-tools.use.x402atlas.com/merkle/build

2

Calls / 30d

1

Unique payers / 30d

Sep 1

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://chain-tools.use.x402atlas.com/merkle/build", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "leaves": [
      "0x616c706861",
      "0x62657461",
      "0x67616d6d61"
    ]
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://chain-tools.use.x402atlas.com/merkle/build" \
  -H "Content-Type: application/json" \
  -d '{"leaves":["0x616c706861","0x62657461","0x67616d6d61"]}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "algorithm_version": "keccak256-sorted-pairs-v1",
  "leaf_count": 3,
  "leaf_hashes": [
    "0x180a512e153366b1510bf090b11069c19394ab868093ef5290ead07f1fbb3386",
    "0x5b3931176fc5f22736bfc5393315c63244f57e672b5017c675220ec7de504ae6",
    "0xe51a809d0bd7c39f11aa7f9ff0ba85099028c7d56f42313f3bb5495a7b967146"
  ],
  "operation": "merkle-build",
  "proofs": [
    {
      "index": 0,
      "steps": [
        {
          "hash": "0x5b3931176fc5f22736bfc5393315c63244f57e672b5017c675220ec7de504ae6"
        },
        {
          "hash": "0xe51a809d0bd7c39f11aa7f9ff0ba85099028c7d56f42313f3bb5495a7b967146"
        }
      ]
    },
    {
      "index": 1,
      "steps": [
        {
          "hash": "0x180a512e153366b1510bf090b11069c19394ab868093ef5290ead07f1fbb3386"
        },
        {
          "hash": "0xe51a809d0bd7c39f11aa7f9ff0ba85099028c7d56f42313f3bb5495a7b967146"
        }
      ]
    },
    {
      "index": 2,
      "steps": [
        {
          "hash": "0xbfa0350c48ccd55fb3a8315a6d6bfc41877772eaebfcba73cb195984df5b3d32"
        }
      ]
    }
  ],
  "root": "0x40a0fa2d0ce898ef138c3403645be77705df9d485ecc137b02b35eb9fdeaaf94",
  "warnings": []
}

Payment details

Pay to0x8c128f1ee62bb5e47867cfbae2ad89be325df1b2
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Arbitrum, Polygon
Schemesexact

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from EVM & Solana Utility Tools & similar services