# Ztreamer v0.2.0: Indexing less, but better!

**URL:** <https://forum.zcashcommunity.com/t/ztreamer-v0-2-0-indexing-less-but-better/59450>\
**Category:** Zcash Apps\
**Created:** [November 18, 2026, 9:02pm UTC](https://forum.zcashcommunity.com/t/ztreamer-v0-2-0-indexing-less-but-better/59450 "2026-11-18T21:02:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![distractedm1nd](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/distractedm1nd/32/48255_2.png) [@distractedm1nd](https://forum.zcashcommunity.com/u/distractedm1nd)\
**Post date:** [November 18, 2026, 9:02pm UTC](https://forum.zcashcommunity.com/t/ztreamer-v0-2-0-indexing-less-but-better/59450/1 "2026-11-18T21:02:56Z")

</div>

We have been actively pacing the development of [ztreamer](https://x.com/distractedm1nd/status/2095277862647439394), and are really proud to share our new release [v0.2.0](https://github.com/zcashlabs/ztreamer/releases/tag/v0.2.0).

For this version of ztreamer, we had 2 main goals:

1. Support the use of a remote node, while preserving fast sync

2. Serve tree states faster, without bloating the index

We pursue these goals with a simple philosophy: Saturate resources to sync as fast as possible, and optimize solely for serving light wallets.

Instead of naively building full indexes of everything, we navigate the pareto frontier of the protocol to be faster, with less.

Remote mode now allows users or providers to sync without having an archival node present: sync from snapshots, over p2p with another ztreamer node, or over the wire with a remote zakura node.

Our new tree state storage absolutely rips with very little overhead. By adding only ~300MB, we crank concurrent `GetTreeState` throughput over 3,000x, and drop p99 latency ~76,400x.

## **Why remote mode?**

When running infrastructure, remote mode lets you put more instances on the edge with fewer resources. By decoupling the indexer from local node storage, deployment overhead drops significantly, allowing edge instances to handle traffic closer to end users without requiring heavy disk or memory footprints. It also lets normal users run a full stack easily, even when a dedicated archive node isn’t available locally.

 ![image](https://global.discourse-cdn.com/zcash/original/3X/9/5/9581933fe90493ef2a7fa104afe62e1ee3a57f0d.jpeg)

We completely redesigned our internal interfaces to support running ztreamer without an embedded node process. This architecture provides flexible synchronization options, enabling users to sync from either a remote zakura node over the network, an existing data snapshot, or directly over P2P from another ztreamer peer.

Huge shoutout to [@hievalir](https://x.com/hievalir) who designed and implemented remote-mode end to end, making distributed and lightweight deployments possible across diverse environments.

## **Serve tree states faster?**

In previous versions of ztreamer, we focused on building a performant index for the request that needs the highest throughput from light wallets: GetBlockRange. Optimizing this call alone is what enabled us to have the fastest sync available. **But we can go even faster.**

Not every sync engine is created equally. The two other most important calls for (shielded) sync are GetTreeState and GetSubtreeRoots. These calls are used differently depending on the underlying wallet implementation, but ztreamer was previously _really bad_ at serving tree states compared to other implementations.

Wallets need a tree state before a scan range, and some implementations request another state at each batch boundary. Slow tree-state responses can therefore delay scanning even when compact blocks arrive quickly.

 ![image](https://global.discourse-cdn.com/zcash/original/3X/0/4/04e2071b5ec76dc6e98f8df607e018f98258115f.jpeg)

Instead of indexing full tree states across all blocks, ztreamer saves nodes from level 8 up and stores the remaining frontier below level 8 for blocks with commitments. Fetching a TreeState requires only one seek per pool and a node lookup per set position bit.

Completed upper nodes are stored once and shared across heights, while new commitments only record the compact frontier below level 8. Queries retrieve the lower frontier and fetch upper hashes using its position index. Because these bits trace the tree path, the response combines pre-indexed hashes without recalculating Merkle trees.

 ![image](https://global.discourse-cdn.com/zcash/original/3X/9/d/9d56b5efa7ae4a435ead3125b8a36ca76ebb7669.jpeg)

The extra work is all hashing, which lets us use the previously unsaturated CPU we gain from our last releases to carry out the building work while the rest of the sync occurs. This means that sync wall time should not meaningfully increase on modern CPUs.

Using @dismad’s cbb tool, we go from a measly 142 req/s p50 6.7s with 6% errors, to 6,278 req/s p50 1.7ms with 0 errors. GetBlockRange performance was unchanged.

Using ghz, we go from ~30 req/s to 61,000-91,000 req/s with 256 gRPC workers.

 ![image](https://global.discourse-cdn.com/zcash/original/3X/a/d/ade54a600087467c43b269e224c876338985398d.jpeg)

## 2^64 EPK Shift

@valardragon came to us with a brilliant idea: What if indexers precomputed an extra point per ephemeral key? The core concept here is to strategically trade a slight increase in network bandwidth for a substantial reduction in client-side CPU overhead during trial decryption. Point doubling represents the single most computationally expensive operation during the trial decryption process. By having the indexer precompute and deliver this additional point alongside each ephemeral key, light wallets can eliminate half of the required point doublings for every single trial decryption attempt. This dramatically reduces CPU load and thermal throttling on lower-power mobile devices, resulting in significantly faster overall scan times.

 ![image](https://global.discourse-cdn.com/zcash/original/3X/e/1/e10c6edf7bea16521cad7ad76f8e068b1294b4fa.jpeg)

We have shipped this optional performance optimization behind the `epk-shift` build flag, primarily because introducing this extra point breaks compatibility with standard protobuf definitions. By making it an opt-in feature, wallet developers and infrastructure operators can easily test, integrate, and benchmark the `epk-shift` flag to quantify exact sync speed improvements and CPU savings across diverse end-user hardware.

## Other Goodies

- Zero TLS termination at the load balancer

- Full Network Upgrade 7 (NU7) support

- Upgraded to lightwallet-protocol v0.6.0

- gRPC reflection, active health checks, and expanded runtime concurrency

- Enhanced system observability and telemetry

For a more complete list, see our [changelog](https://github.com/zcashlabs/ztreamer/releases/tag/v0.2.0).

We are actively working to further improve ztreamer. The next steps will be less about the indexer itself, and more about creating a next-generation lightwallet-protocol that is PIR-aware and Tachyon-ready. For active updates on the project, follow [Zcash Labs](https://x.com/ZcashLabs).

---

<div class="post-metadata">

**Author:** ![dismad](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/dismad/32/18432_2.png) [@dismad](https://forum.zcashcommunity.com/u/dismad)\
**Post date:** [November 18, 2026, 9:06pm UTC](https://forum.zcashcommunity.com/t/ztreamer-v0-2-0-indexing-less-but-better/59450/2 "2026-11-18T21:06:21Z")

</div>

Thanks for sharing numbers, will dig into the updates! 🛡
