diff --git a/zcash_primitives/CHANGELOG.md b/zcash_primitives/CHANGELOG.md index b017d7909..7dedd1b59 100644 --- a/zcash_primitives/CHANGELOG.md +++ b/zcash_primitives/CHANGELOG.md @@ -7,6 +7,11 @@ and this library adheres to Rust's notion of ## [Unreleased] +## [0.10.2] - 2023-03-16 +### Added +- `zcash_primitives::sapling::note`: + - `NoteCommitment::temporary_zcashd_derive` + ## [0.10.1] - 2023-03-08 ### Added - Sapling bundle component constructors, behind the `temporary-zcashd` feature diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index d0e7e8e38..75c1eda48 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zcash_primitives" description = "Rust implementations of the Zcash primitives" -version = "0.10.1" +version = "0.10.2" authors = [ "Jack Grigg ", "Kris Nuttycombe " diff --git a/zcash_primitives/src/sapling/note/commitment.rs b/zcash_primitives/src/sapling/note/commitment.rs index e23dff10c..613537ec9 100644 --- a/zcash_primitives/src/sapling/note/commitment.rs +++ b/zcash_primitives/src/sapling/note/commitment.rs @@ -25,6 +25,17 @@ impl NoteCommitment { } impl NoteCommitment { + /// Derives a Sapling note commitment. + #[cfg(feature = "temporary-zcashd")] + pub fn temporary_zcashd_derive( + g_d: [u8; 32], + pk_d: [u8; 32], + v: NoteValue, + rcm: jubjub::Fr, + ) -> Self { + Self::derive(g_d, pk_d, v, NoteCommitTrapdoor(rcm)) + } + /// $NoteCommit^Sapling$. /// /// Defined in [Zcash Protocol Spec ยง 5.4.8.2: Windowed Pedersen commitments][concretewindowedcommit].