---
title: "Merkle inclusion proof"
method: GET
path: "/v1/trees/{tree_index}/proof/{insertion_index}"
tags: ["trees"]
---

# Merkle inclusion proof

`GET /v1/trees/{tree_index}/proof/{insertion_index}`

Generates and returns a Merkle inclusion proof (authentication path) for the
leaf at `insertion_index` in the specified tree.

**Always Protobuf** -- responds with `application/x-protobuf` regardless
of the `Accept` header.

## Proof structure

The proof is an ordered list of 20 sibling hashes (one per level of the
depth-20 tree), ordered from leaf level (index 0) to root level (index 19).
Together with `leaf` and `root`, it can be used to verify membership and
construct a Groth16 zero-knowledge proof compatible with the on-chain
Umbra verifier.

## Hash encoding

All hash values (`root`, `leaf`, each `proof` element) are **little-endian
64-character hex strings** (32 bytes), matching Solana on-chain byte order
and Circom ZK circuit input format.

## Performance

Proof generation traverses 20 tree levels. Operations exceeding 500 ms emit
a slow-operation `WARN` log server-side.

## Path parameters

- `tree_index` integer, required
- `insertion_index` integer, required

## Response `200`

Merkle proof generated successfully.

## Other responses

- `400` — Invalid path parameter.
- `404` — `tree_index` does not exist, or `insertion_index >= num_leaves` (leaf not yet inserted).
- `429` — Rate limit exceeded.
- `500` — Storage backend error.

---

[API](https://skmtc.net/umbra-defi/apis/umbra-indexer-read-service.md) · [All operations](https://skmtc.net/umbra-defi/apis/umbra-indexer-read-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/umbra-defi/umbra-indexer-read-service/revisions/ea7a4ee03e38/schema)
