librustzcash/zcash_client_sqlite
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
..
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_sqlite 0.8.0-rc.1 2023-09-08 19:58:46 +00:00
Cargo.toml zcash_client_sqlite 0.8.0-rc.1 2023-09-08 19:58:46 +00:00
README.md Address feedback about the use of "permissive". 2022-06-28 16:46:13 +01:00

README.md

Security Disclaimer

This is a beta build, and is currently under active development. Please be advised of the following:

  • This code currently is not audited by an external security auditor, use it at your own risk.
  • The code has not been subjected to thorough review by engineers at the Electric Coin Company.
  • We are actively changing the codebase and adding features where/when needed.

zcash_client_sqlite

This library contains APIs that collectively implement a Zcash light client in an SQLite database.

License

Licensed under either of

at your option.

Downstream code forks should note that 'zcash_client_sqlite' 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.