Skip to main content
Merkle tree metadata
curl --request GET \
  --url http://localhost:3001/v1/trees/{tree_index}
{
  "tree_index": 0,
  "num_leaves": 1024,
  "root": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
  "utxo_count": 1024
}
The root hash changes every time a new leaf is inserted. Use this endpoint to check the current state of a tree before fetching UTXOs or generating Merkle proofs.
utxo_count may differ from num_leaves if some leaves were inserted without UTXO ciphertext data (e.g. padding leaves).

Path Parameters

tree_index
integer<int64>
required

Zero-based index of the Merkle tree to query.

Required range: x >= 0

Response

Tree metadata retrieved successfully.

Protobuf TreeInfoResponse message returned by GET /v1/trees/{tree_index}.

The root field is a bytes field in the Protobuf encoding containing the raw 32-byte little-endian Poseidon root hash.

Tree capacity: Each tree holds at most MAX_LEAVES_PER_TREE = 1,048,576 leaves (depth-20 Indexed Merkle Tree).

tree_index
integer<int64>
required

Zero-based index identifying the Merkle tree.

Example:

0

num_leaves
integer<int64>
required

Total number of leaf commitments currently inserted into the tree.

Example:

1024

root
string<byte>
required

Raw 32-byte little-endian Poseidon root hash (Protobuf bytes field). In a JSON representation this would be base64-encoded.

Example:

"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="

utxo_count
integer<int64>
required

Number of UTXO records stored for this tree in the UTXO store.

Example:

1024