Go to file
Jack Grigg 524cc2e979 zcash_client_sqlite: Read rcm correctly from data DB after Canopy
ZIP 212 alters the note plaintext to store a seed from which rcm is
derived, rather than storing rcm directly. In the mobile SDKs we only
need rcm, so for post-ZIP 212 notes, we derive rcm from the seed and
store rcm in the data DB.

However, when selecting notes to spend, `create_to_address` was using the
transaction's target height to determine if Canopy is active, and parsing
the rcm value as the seed if so. This effectively applied a seed->rcm
derivation to all selected notes' rcms once Canopy activated on the
chain. As a result, the note commitments were incorrect, and thus the
anchors derived from the witness paths were also incorrect. This caused
two kinds of observed failures:

- If more than one note was selected, the builder would fail with
  "anchor mismatch", as the note commitments would be effectively
  randomised, causing the derived anchors to also randomise.
- If a single note was selected, the transaction would be built using
  the randomised anchor, and then rejected when sent to the network.

The fix is to "pretend" in `create_to_address` that all notes are
pre-ZIP 212 notes. This works fine because we never need to serialize
back to the note plaintext while spending a note.
2020-10-24 00:23:05 +01:00
.github/workflows Bump protobuf dependencies 2020-09-09 00:32:16 +01:00
components/equihash equihash: Test vectors for expand_array and indices_from_minimal 2020-07-10 21:12:39 +12:00
librustzcash Remove librustzcash crate 2020-03-14 10:50:04 +13:00
zcash_client_backend Version bump 0.4.0 for crates 2020-09-09 14:41:19 -06:00
zcash_client_sqlite zcash_client_sqlite: Read rcm correctly from data DB after Canopy 2020-10-24 00:23:05 +01:00
zcash_history zcash_history: quickcheck 0.9 2020-08-14 17:44:17 +01:00
zcash_primitives Version bump 0.4.0 for crates 2020-09-09 14:41:19 -06:00
zcash_proofs Version bump 0.4.0 for crates 2020-09-09 14:41:19 -06:00
.gitignore Add Cargo.lock to .gitignore 2020-03-25 17:24:50 +13:00
.gitlab-ci.yml Remove duplicate test stage for rust lastest 2018-10-09 09:34:10 -07:00
Cargo.toml Remove subtree crates 2020-08-27 23:25:47 +01:00
LICENSE-APACHE Add license files. 2017-03-17 11:09:05 -06:00
LICENSE-MIT Electric Coin Company 2019-05-09 20:32:39 +03:00
README.md Set up a Cargo workspace 2018-08-23 21:10:04 +01:00
rust-toolchain Bump protobuf dependencies 2020-09-09 00:32:16 +01:00

README.md

Zcash Rust crates

This repository contains a (work-in-progress) set of Rust crates for working with Zcash.

Security Warnings

These libraries are currently under development and have not been fully-reviewed.

License

All code in this workspace is licensed under either of

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.