Crate zcash_client_backend
source ·Expand description
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
lightwalletd-tonic
— Enables thetonic
gRPC client bindings for connecting to alightwalletd
server.lightwalletd-tonic-transport
— Enables thetransport
feature oftonic
producing a fully-featured client and server implementationtransparent-inputs
— Enables receiving transparent funds and shielding them.orchard
— Enables receiving and spending Orchard funds.test-dependencies
— Exposes APIs that are useful for testing, such asproptest
strategies.
§Experimental features
unstable
— Exposes unstable APIs. Their behaviour may change at any time.unstable-serialization
— Exposes APIs for unstable serialization formats. These may change at any time.unstable-spanning-tree
— Exposes thedata_api::scanning::spanning_tree
module.
Modules§
- Structs for handling supported address types.
- Utilities for Zcash wallet construction
- Encoding and decoding functions for Zcash key and address structs.
- keys
orchard
orsapling
ortransparent-inputs
Helper functions for managing light client key material. - Types related to the construction and evaluation of transaction proposals.
- Generated code for handling light client protobuf structs.
- Tools for scanning a compact representation of the Zcash block chain.
- serialization
unstable-serialization
- Structs representing transaction data scanned from the block chain by a wallet or light client.
- Reference implementation of the ZIP-321 standard for payment requests.
Structs§
- A decrypted shielded output.
Enums§
- A value pool in the Zcash protocol.
- A Zcash shielded transfer protocol.
- An enumeration of the possible relationships a TXO can have to the wallet.
Functions§
- Scans a
Transaction
for any information that can be decrypted by the set ofUnifiedFullViewingKey
s.