> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# merkle tree voucher info (client‑side) | TRON

> Retrieve merkle tree voucher information client‑side. Public TRON nodes generally do not expose an RPC for wallet/getmerkletreevoucherinfo.

Retrieve merkle tree voucher information client‑side. Public TRON nodes generally do not expose an RPC for `wallet/getmerkletreevoucherinfo`; attempting to POST to that route returns HTTP 405. Build voucher data locally from shielded commitments and anchors.

## Inputs

* `output_point` — the output commitment/point for which you need a Merkle path.
* `ak` — authentication key (64‑hex) used in verification.
* `nk` — nullifier key (64‑hex) used in verification.
* `position` — leaf index in the commitment tree.

## Outputs

* `voucher_info` — voucher data structure used in verification circuits.
* `paths[]` — Merkle path elements (sibling hashes) from leaf to root.
* `anchors[]` — accepted anchor(s) (tree roots) for the proof context.
* `rt` — Merkle root.
* `output_point_info` — metadata about the output commitment.

## How to build it locally

1. Maintain or query a local view of the shielded commitment tree (from blocks and shielded notes).
2. Locate the `position` (leaf index) for `output_point`.
3. Ascend the tree computing sibling hashes to assemble `paths[]` and the root `rt`.
4. Package `voucher_info` with `ak`, `nk`, `position`, `paths[]`, and `rt` according to your proof/verifier requirements.

Consider using or extending an existing Sapling tree implementation. The derivation follows other Sapling‑based systems: compute diversifyHash where applicable, hash pairs per level, and collect siblings up to the root.

### Pseudocode sketch

```python theme={"system"}
# Given: output_point (leaf), position, and a commitment tree abstraction
def merkle_path(tree, position):
    path = []
    node = tree.leaf(position)
    while node.parent is not None:
        path.append(node.sibling.hash)
        node = node.parent
    return path, node.hash  # path elements, root

paths, rt = merkle_path(commitment_tree, position)
voucher = {
  'voucher_info': { 'output_point': output_point },
  'paths': paths,
  'anchors': [rt],
  'rt': rt,
  'output_point_info': { 'position': position }
}
```

<Info>
  Public nodes typically return HTTP 405 for this route. Build voucher data client‑side using a local tree or a dedicated indexer, then submit proofs with your transaction flows.
</Info>
