Hi all,
Arlo Byrne here (idky137), lead developer of Zaino for the last few years. Today I’m announcing Zaino 0.11.0-rc1, the first Zaino release published by Umbriel Systems Ltd rather than ZingoLabs.
- Repository: GitHub - umbriel-sys/zaino: Zaino is an indexer for the Zcash blockchain implemented in Rust. · GitHub
- Tag:
v0.11.0-rc1 - Licence: Apache-2.0
TLDR:
- Zaino continues, in a new home, as a general-purpose Zcash indexer: light wallets, full-node wallets, block explorers, and Rust applications that embed it.
- v0.11.0 supports NU7 and Zebra 7, and moves the daemon onto the architecture the Zaino team has been building all year, with a new store underneath.
- A full mainnet sync of the light-client indexes took 33.5 minutes on a laptop, and Zaino was serving wallets 40 seconds after it started (full benchmarks to come).
- Two new experimental gRPC methods serve block headers and ZIP 221 history proofs to light clients.
- This is a release candidate. Please test it and tell me what breaks.
Why Zaino has a new home
Operators who rely on Zaino are owed an explanation, so here it is, briefly.
Zaino 0.10.x stalled at NU7 activation on mainnet. The NU7 changes had been ready on a branch for weeks, but could not be reviewed, merged and released. I’m sorry to everyone that affected, and grateful to the operators who ran the feature branch in the meantime and reported back.
The cause was a disagreement inside ZingoLabs about Zaino’s technical direction and about how those decisions were made. This came to a head in late October, when the Zaino codebase was replaced on the development branch with a completly new implementation, a change that was reverted immediately by the wider zaino and zingolabs team. The disagreement was not resolved, and review and release of the existing codebase stopped.
ZingoLabs has since released that implementation as its own indexer, zingod. For these reasons I am moving the development and maintenance of Zaino to Umbriel Systems Ltd, so that it can continue unhindered by the inner politics of Zingolabs.
I have no wish to argue this out in public. Zaino exists because of years of work by many people at ZingoLabs and in the wider community, and two independently maintained indexers are good for Zcash. What matters to me is that anyone running Zaino has a maintained, released, NU7-ready implementation and a clear answer about who is responsible for it.
What v0.11.0 is
This is not a fork that only renames things. Through 0.8 to 0.10 the Zaino team moved the subsystems behind stable interfaces one at a time: validator access, the mempool, the chain head, ChainView. V0.11.0 finishes that work. The store is rebuilt, a single service composes the parts, and zainod runs on it directly.
Zaino still sits between a validator you run and the clients you serve:
- light wallets, through the lightwallet protocol gRPC service (v0.6.0) that lightwalletd serves today;
- full-node wallets and block explorers, through the subset of the zcash JSON-RPC they need;
- Rust applications, as a library.
Sync performance
A full mainnet sync, from an empty store to every answer served from Zaino’s own indexes:
| Total time | 33 min 24 s to 33 min 54 s (measured by 30 s polling) |
| Serving wallets | about 40 s after start, with the validator answering what was not yet built |
| Chain height | 3,600,081 |
| Disk used | about 38 GB |
| Indexes built | headers, txids, transaction locations, transparent data, compact blocks, chain metadata, tree state, ZIP 221 history tree |
| Machine | laptop: AMD Ryzen 7 7840U (8 cores), 64 GB RAM, NVMe SSD |
| Validator | zebrad 7.1.0 on the same machine, read through the zebra source |
| Stretch of the chain | Time | Average rate |
|---|---|---|
| Genesis to 1.73M | about 10 min 45 s | ~2,700 blocks/s |
| 1.73M to 1.88M | about 12 min | ~205 blocks/s |
| 1.88M to the tip | about 11 min | ~2,600 blocks/s |
This is one run from my own internal testing, with ingest concurrency raised above the defaults. Proper, reproducible benchmarks will follow. Two things to keep in mind until then:
- This build indexes more than a compact-block server needs. It stores every full block header, the note commitment trees at every height, and the ZIP 221 history tree, so that it can serve headers and history proofs (below). As far as I know, no other current indexer builds these.
- It is not the full index set. This is the light-client set plus full block headrs and the history tree. The
fullset adds spent, full transparent address-history and UTXO-set indexes; its numbers will come with the full benchmarks.
What has changed since 0.10.x
NU7 and Zebra 7
- NU7 is recognised on mainnet (height 3,543,405) and testnet. Zaino is built against the Zebra 7.1 crates and needs zebrad 7.
- At start-up Zaino checks the validator’s activation schedule against the configured network, and refuses to start if the validator is on a consensus branch this build does not know. A Zaino that is behind its validator now says so instead of stalling.
A new store, with the indexes you choose
The single LMDB database is replaced by a store of independent indexes on a storage engine written for this workload. Each index has its own directory, with a checksum on every page and a stamp naming its chain and layout. One index can be added, dropped, rebuilt, or moved to another disk without touching the others.
There are eleven indexes, and you pick a set in the config:
| Set | Built for | Served from Zaino’s own state |
|---|---|---|
lightclient (default) |
wallets | compact blocks, headers, treestates, subtree roots |
zcash_rpc |
JSON-RPC consumers | spends, transparent address history, the UTXO set, treestates |
full |
both | everything, including the ZIP 221 history tree |
empty |
a thin proxy | nothing: every read goes to the validator |
Single indexes can be added to a set (enable = ["history_tree"]). A wallet operator no longer pays the disk and sync time for indexes only an explorer needs, and an explorer operator can have all of them.
Also new:
- Treestates and subtree roots are served from Zaino. In 0.10.x they came from the validator.
- Transparent address history is a standard index, no longer behind an experimental build feature, and it covers the most recent blocks as well as finalised history.
getspentinfois answered from Zaino’s own spend index, including spends still in the mempool. zebrad does not implement this method.CompactTx.feeis filled in for mined transactions.- The build is a concurrent pipeline: blocks are fetched, their spent outputs resolved, and each index written by its own writer, all at once. Zaino also has its own block parser, which skips work only a validator needs and is about 29 times faster on shielded-heavy blocks.
- The store checks itself at start-up. Each index’s tip is compared with the validator’s block at that height. An index on another chain, with an old layout, or corrupted is rebuilt, not served.
Serving from the first second
Zaino answers a read by asking who holds that height: the store (finalised history, on disk), the chain head (the most recent 1,001 blocks, in memory, with competing branches), or the validator.
zainodserves as soon as it has connected to the validator and loaded the recent blocks. While the store builds, the validator answers what Zaino does not hold yet.- The chain head and the store advance independently, so a slow disk no longer holds the chain tip back.
- Every request reads from one pinned snapshot of the chain. A reorg in the middle of a request cannot give you a height from one chain and a block from another.
- The chain head follows the branch with the most work, and keeps competing branches so that switching between them needs no refetch.
No placeholder data, no silent failures
Two rules were applied across the whole codebase:
- A field carries the real value or it is absent. No zeros, defaults or empty objects standing in for data Zaino does not have.
- Zaino never waits without end and never serves through a failed component. Every background task is supervised, and every wait and retry has a bound. When Zaino cannot continue it exits, and the last log line names the cause. Panicking code is denied by lint in every production crate.
Light-client serving
GetBlockRangeandGetBlockRangeNullifiersare served from pre-encoded frames: each block is encoded once and the bytes are shared by every wallet syncing that range.- Ranges stream in either direction, in chunks sized by bytes rather than block count, and only as fast as the client reads. Memory per client stays bounded.
- Per-connection limits are configurable: concurrent requests, HTTP/2 streams, keep-alive, and a time bound on every stream. This also closes the remaining resource-exhaustion findings from the security reports we received this year.
GetStandardFeeis served (lightwallet protocol v0.6.0).
JSON-RPC
- Parameters, result shapes and error codes follow zebrad 7, and are pinned by tests to JSON captured from zebrad.
getblockheader,getblockdeltas,getspentinfoandgetaddressdeltasare now answered from Zaino’s indexes.- Each method keeps its legacy error code, where 0.10.x collapsed them into one generic code.
docs/rpc_api.md lists every served method and where its answer comes from.
Running it
- New config layout.
zainod generate-configwrites it with every setting commented, and every key can also be set from the environment. - Two validator sources:
zebra(reads zebrad’s state directly as well as its JSON-RPC; same host, faster) andzcash_rpc(JSON-RPC only; works across hosts, with any node that speaks the zcash JSON-RPC). /readyzreports everything: each component’s state, and how far each index has built. Start-up logs name each step, and the store build reports height, percent, blocks per second and time remaining.
Under the hood
- Zebra is isolated. Everything is written against ports: one small trait per question Zaino can ask a validator. Only the source adapters link Zebra’s crates, and a lint enforces it. Zebra upgrades stay contained, and supporting another validator means writing an adapter, not a rewrite.
- Tests. Unit tests run against one shared fake validator, which is held to the same contract suite as the real adapters and produces real consensus bytes. A separate live suite drives a real zebrad, compares Zaino’s answers with the validator’s (reorgs included), and syncs a librustzcash wallet through Zaino end to end.
- Documentation. Each of the 27 crates has a usage guide, alongside architecture, running, RPC and testing docs.
New, experimental: headers and history proofs for light clients
[0.11.0] adds a small gRPC service next to the lightwallet protocol, zaino.lightclient.v1.LightClientService:
GetBlockHeadersstreams the full serialized block headers for a range, under the same range rules asGetBlockRange.GetHistoryProofreturns the ZIP 221 proof that a block is in the chain a given tip’s header commits to: the block’s leaf, its path, and the tree’s peaks.
Today a light wallet takes its server’s word for which chain it is on. With headers it can check proof of work itself, and with a history proof it can check that any earlier block belongs to the chain its tip commits to, without downloading everything in between. The lightwallet protocol has long reserved a header field in CompactBlock that is always left empty; this is a step towards wallets that verify more and trust less.
Both methods are experimental in this release and their shapes may change. I will open PRs against the lightwallet protocol soon to propose adding them officially, and I would welcome feedback from wallet developers before then.
Three ways to use Zaino
Zaino is a set of libraries as well as a daemon. You can enter at three levels:
1. The server: zainod. The daemon: configuration, the gRPC and JSON-RPC servers, admin endpoints.
2. The service: zaino-service. The whole indexer as one Rust library, without the servers. It composes the chain and the mempool, pins one chain state per request, and publishes a manifest that says, for each capability, whether the answer is local, the validator’s, still building, or unavailable until an index is enabled. This is the entry point for a wallet or application that embeds Zaino.
3. The components. Each subsystem is usable on its own, behind its own ports:
zaino-chain-store: finalised history, on diskzaino-chain-head: the recent, non-finalised window, with competing brancheszaino-mempool: a mirror of the validator’s mempool, with a tip coherence mode designed to safely serve the get_mempool_stream api.zaino-chain(ChainView): one read surface over the store, the head and the validator
Library users get a snapshot API at every level. You take a snapshot, which is cheap and cannot fail, and ask it as many questions as you like. Every answer describes the same instant of the chain:
let chain = view.snapshot();
let hash = chain.block_hash(height).await?;
let block = chain.block(BlockId::Height(height)).await?;
zaino-state, the pre-0.11 library surface (ChainIndex), is still there as a deprecated thin wrapper over zaino-service, so existing consumers keep working while they migrate. It should be noted that this is planned for deprecation and removal over the next few releases (roadmap to come).
Zaino and zingod
People will ask how the two differ. This is my reading of zingod’s published documentation; its team is the authority on their project, and operators should evaluate both.
| Zaino 0.11 | zingod 1.x | |
|---|---|---|
| Serves | light wallets, full-node wallets, explorers, embedding applications | light wallets |
| Interfaces | lightwallet gRPC, zcash JSON-RPC, Rust library | lightwallet gRPC |
| Coming from Zaino 0.10 | the same codebase; the library surface is kept | “a new daemon, not an upgrade” |
| Where data comes from | one validator that you run | one or more validators |
| First start | serves the whole chain at once; the validator fills in what is not built | serves up to the height its indexes have reached |
| An index that is off | where possible the validator answers | the method is unimplemented |
| Bootstrap | sync from your own validator | sync, or download a published index snapshot |
The two projects have chosen different problems, Zaino’s direction is the one it has always had:
- A general indexer. With zcashd being retired, the spent, address and UTXO indexes that explorers and full-node wallets depend on need a home outside the validator, and wallets such as Zallet need an indexer they can embed. Index sets mean this breadth costs a light-wallet operator nothing.
- Your validator is the only source of truth. Zaino takes chain data from the validator you run and nowhere else, and checks its own store against it.
- Continuity. [0.11.0] is an evolution of the code operators and library users already run.
- Light clients that verify more. Headers and history proofs are the first step.
Upgrading from 0.10.x
- Upgrade zebrad to 7 first. If you use the
zebrasource, let zebrad migrate its state before starting Zaino. - Zaino resyncs. The 0.10.x database is not read. By default it is deleted at first start; set
delete_stale = falsebeforehand if you want to keep it. Zaino serves through the validator while the new store builds. - The config layout is new. A key from the old layout is refused at start-up with an error naming its replacement.
zainod generate-configgives you a commented starting point. - Containers: the image is built from
docker/Dockerfile, and two environment variables are renamed (ZAINO_PERSISTENCE__PATH,ZAINO_SERVE__JSONRPC__COOKIE_DIR). - Metrics: the store’s metrics are now
zaino.store; the oldzaino.dbandzaino.syncare gone. GetLightdInfo.vendoris now “Umbriel Systems ZainoD”.- Some JSON-RPC shapes changed to match zebrad 7 (
getmininginfo,getpeerinfo,z_validateaddressand others). The changelog has the full list.
This is a release candidate, all feedback is appreciated.
What’s next
- Full v0.22.0 release, once the release candidate has had testing from operators and wallet developers.
- Published, reproducible benchmarks: sync for each index set, and serving under load.
- Lightwallet protocol PRs for
GetBlockHeadersandGetHistoryProof. - A Zcash Community Grants application for Zaino’s continued development and maintenance under Umbriel Systems.
Feedback
Please run it, and report what you find at Issues · umbriel-sys/zaino · GitHub. For security issues, use the repository’s private security advisories.
I’d particularly like to hear from:
- operators on 0.10.x or the NU7 feature branch, about the upgrade;
- wallet developers, about the headers and history proof services;
- anyone embedding Zaino as a library, about the service and snapshot APIs.
Thank you to everyone who built Zaino to this point, and to everyone who stayed patient through the last few weeks.
Arlo Byrne (idky137)
Umbriel Systems Ltd