524cc2e979
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. |
||
---|---|---|
.github/workflows | ||
components/equihash | ||
librustzcash | ||
zcash_client_backend | ||
zcash_client_sqlite | ||
zcash_history | ||
zcash_primitives | ||
zcash_proofs | ||
.gitignore | ||
.gitlab-ci.yml | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
rust-toolchain |
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
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.