From 8bc4f725120cd3632305e5065569a7af31a93c64 Mon Sep 17 00:00:00 2001 From: roman Date: Fri, 10 Apr 2026 11:10:01 -0600 Subject: [PATCH] pczt: Add public getter for shielded sighash Backports the `Signer::shielded_sighash` accessor from main (added in zcash/librustzcash#2047) to the 0.5.x series, enabling downstream consumers to obtain the sighash for producing signatures externally (e.g. via a hardware wallet). Made-with: Cursor --- pczt/CHANGELOG.md | 3 +++ pczt/src/roles/signer/mod.rs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/pczt/CHANGELOG.md b/pczt/CHANGELOG.md index c49193adca..a96a1c954f 100644 --- a/pczt/CHANGELOG.md +++ b/pczt/CHANGELOG.md @@ -10,6 +10,9 @@ workspace. ## [Unreleased] +### Added +- `pczt::roles::signer::Signer::shielded_sighash` getter. + ## [0.4.1, 0.5.1] - 2026-02-26 ### Fixed diff --git a/pczt/src/roles/signer/mod.rs b/pczt/src/roles/signer/mod.rs index 7fcd603ec3..8307e2db96 100644 --- a/pczt/src/roles/signer/mod.rs +++ b/pczt/src/roles/signer/mod.rs @@ -95,6 +95,14 @@ impl Signer { }) } + /// Returns the shielded (Orchard + Sapling) sighash. + /// + /// This can be used to produce signatures externally (e.g. via a + /// hardware wallet) for authorizing shielded spends. + pub fn shielded_sighash(&self) -> [u8; 32] { + self.shielded_sighash + } + /// Signs the transparent spend at the given index with the given spending key. /// /// It is the caller's responsibility to perform any semantic validity checks on the