Expand description
An SQLite-based Zcash light client.
zcash_client_sqlite
contains complete SQLite-based implementations of the WalletRead
,
WalletWrite
, and BlockSource
traits from the zcash_client_backend
crate. In
combination with zcash_client_backend
, it provides a full implementation of a SQLite-backed
client for the Zcash network.
§Design
The light client is built around two SQLite databases:
-
A cache database, used to inform the light client about new
CompactBlock
s. It is read-only within all light client APIs except forinit_cache_database
which can be used to initialize the database. -
A data database, where the light client’s state is stored. It is read-write within the light client APIs, and assumed to be read-only outside these APIs. Callers MUST NOT write to the database without using these APIs. Callers MAY read the database directly in order to extract information for display to users.
§Feature flags
multicore
(enabled by default) — Enables multithreading support for creating proofs and building subtrees.orchard
— Enables support for storing data related to the sending and receiving of Orchard funds.test-dependencies
— Exposes APIs that are useful for testing, such asproptest
strategies.transparent-inputs
— Enables receiving transparent funds and sending to transparent recipientsserde
— Enablesserde
derives for certain types.
§Experimental features
unstable
— Exposes unstable APIs. Their behaviour may change at any time.expensive-tests
— A feature used to isolate tests that are expensive to run. Test-only.pczt-tests
— A feature used to enable PCZT-specific tests without interfering with the protocol-specific flags. Test-only.
Modules§
- chain
- Functions for enforcing chain validity and handling chain reorgs.
- error
- Error types for problems that may arise when reading or storing wallet data to SQLite.
- util
- Types that should be part of the standard library, but aren’t.
- wallet
- Functions for querying information in the wallet database.
Structs§
- Account
Uuid - Unique identifier for a specific account tracked by a
WalletDb
. - BlockDb
- A handle for the SQLite block source.
- FsBlock
Db unstable
- A block source that reads block data from disk and block metadata from a SQLite database.
- GapLimits
transparent-inputs
- A data structure that can be used to configure custom gap limits for use in transparent address rotation.
- Received
Note Id - An opaque type for received note identifiers.
- SqlTransaction
- A wrapper for a SQLite transaction affecting the wallet database.
- UtxoId
- A newtype wrapper for sqlite primary key values for the utxos table.
- Wallet
Db - A wrapper for the SQLite connection to the wallet database, along with a capability to read the
system from the clock. A
WalletDb
encapsulates the full set of capabilities that are required in order to implement theWalletRead
,WalletWrite
andWalletCommitmentTrees
traits.
Enums§
- FsBlock
DbError unstable
- Errors that can be generated by the filesystem/sqlite-backed block source.