librustzcash/zcash_client_backend
Kris Nuttycombe 24e8c82546 zcash_client_backend: Get commitment tree depth for a given number of confirmations from the database.
This fixes the following bug:

Due to complexities related to non-linear scanning, checkpoints are only
added to the wallet's commitment tree in cases where there are notes
discovered within a scanned block. At present, the `shardtree` API only
makes it possible to add multiple checkpoints of the same tree state
when adding checkpoints at the chain tip, and this functionality is not
used by `zcash_client_backend` because we perform checkpoint insertion
in batches that may contain gaps in the case that multiple blocks
contain no Sapling notes. While it would be possible to fix this by
altering the `shardtree` API to permit explicit insertion of multiple
checkpoints of the same tree state at a given note position, this fix
takes a simpler approach.

Instead of ensuring that a checkpoint exists at every block and
computing the required checkpoint depth directly from the minimum number
of confirmations required when attempting a spend, we alter the
`WalletCommitmentTrees` API to allow internal information of the note
commitment tree to be used to determine this checkpoint depth, given the
minimum number of commitments as an argument. This allows us to select a
usable checkpoint from the sparse checkpoint set that resulted from the
sparse insertion of checkpoints described above.
2023-09-11 18:38:54 -06:00
..
examples Remove redundant TryFrom/TryInto imports. 2022-09-02 12:05:15 -06:00
proptest-regressions ZIP 321 Reference Implementation (#294) 2020-10-15 14:03:40 +01:00
proto Implement `suggest_scan_ranges` and `update_chain_tip` 2023-07-07 20:13:45 -06:00
src zcash_client_backend: Get commitment tree depth for a given number of confirmations from the database. 2023-09-11 18:38:54 -06:00
CHANGELOG.md zcash_client_backend 0.10.0-rc.1 2023-09-08 19:50:53 +00:00
Cargo.toml zcash_client_backend 0.10.0-rc.1 2023-09-08 19:50:53 +00:00
LICENSE-APACHE Rename zcash_wallet to zcash_client_backend, set to 2018 edition 2019-06-27 16:02:12 +01:00
LICENSE-MIT Rename zcash_wallet to zcash_client_backend, set to 2018 edition 2019-06-27 16:02:12 +01:00
README.md Address feedback about the use of "permissive". 2022-06-28 16:46:13 +01:00
build.rs zcash_client_backend: Remove now-superfluous braces from build script 2023-08-31 20:32:42 +00:00

README.md

zcash_client_backend

This library contains Rust structs and traits for creating shielded Zcash light clients.

License

Licensed under either of

at your option.

Downstream code forks should note that 'zcash_client_backend' depends on the 'orchard' crate, which is licensed under the Bootstrap Open Source License. A license exception is provided allowing some derived works that are linked or combined with the 'orchard' crate to be copied or distributed under the original licenses (in this case MIT / Apache 2.0), provided that the included portions of the 'orchard' code remain subject to BOSL. See https://github.com/zcash/orchard/blob/main/COPYING for details of which derived works can make use of this exception.

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.