33 releases (20 breaking)
Uses new Rust 2024
| 0.21.2 | Mar 10, 2026 |
|---|---|
| 0.21.0 | Nov 5, 2025 |
| 0.20.1 | Feb 26, 2026 |
| 0.19.1 | Jul 21, 2025 |
| 0.1.0 | Oct 8, 2019 |
#7 in #shielded
3,153 downloads per month
Used in 11 crates
(10 directly)
3MB
53K
SLoC
A crate for implementing Zcash light clients.
zcash_client_backend contains Rust structs and traits for creating shielded Zcash
light clients.
Design
Wallet sync
The APIs in the data_api::chain module can be used to implement the following
synchronization flow:
┌─────────────┐ ┌─────────────┐
│Get required │ │ Update │
│subtree root │─▶│subtree roots│
│ range │ └─────────────┘
└─────────────┘ │
▼
┌─────────┐
│ Update │
┌────────────────────────────────▶│chain tip│◀──────┐
│ └─────────┘ │
│ │ │
│ ▼ │
┌─────────────┐ ┌────────────┐ ┌─────────────┐ │
│ Truncate │ │Split range │ │Get suggested│ │
│ wallet to │ │into batches│◀─│ scan ranges │ │
│rewind height│ └────────────┘ └─────────────┘ │
└─────────────┘ │ │
▲ ╱│╲ │
│ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │
┌────────┐ ┌───────────────┐ │ │
│ Choose │ │ │Download blocks│ │
│ rewind │ │ to cache │ │ │
│ height │ │ └───────────────┘ .───────────────────.
└────────┘ │ │ ( Scan ranges updated )
▲ │ ▼ `───────────────────'
│ ┌───────────┐ │ ▲
.───────────────┴─. │Scan cached│ .─────────. │
( Continuity error )◀────│ blocks │──▶( Success )───────┤
`───────────────┬─' └───────────┘ `─────────' │
│ │ │
│ ┌──────┴───────┐ │
▼ ▼ │ ▼
│┌─────────────┐┌─────────────┐ ┌──────────────────────┐
│Delete blocks││ Enhance ││ │Update wallet balance │
││ from cache ││transactions │ │ and sync progress │
└─────────────┘└─────────────┘│ └──────────────────────┘
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
Feature flags
zcash_client_backend
This library contains Rust structs and traits for creating shielded Zcash light clients.
Building
Note that in order to (re)build the GRPC interface, you will need protoc on
your $PATH. This is not required unless you make changes to any of the files
in ./proto/.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~29–83MB
~1M SLoC