From 1a9f3ba9a4f095461cafe6c32742cc69ffadfa88 Mon Sep 17 00:00:00 2001 From: roman Date: Fri, 10 Apr 2026 10:54:19 -0600 Subject: [PATCH] pczt: Add public getters for spend_auth_sig and shielded_sighash These getters enable downstream consumers to read the Orchard spend authorization signature from a PCZT after signing, and to access the cached shielded sighash from the Signer role for external verification. Made-with: Cursor --- pczt/CHANGELOG.md | 4 ++++ pczt/src/orchard.rs | 1 + pczt/src/roles/signer/mod.rs | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/pczt/CHANGELOG.md b/pczt/CHANGELOG.md index c49193adca..e9c5e40c6c 100644 --- a/pczt/CHANGELOG.md +++ b/pczt/CHANGELOG.md @@ -10,6 +10,10 @@ workspace. ## [Unreleased] +### Added +- `pczt::orchard::Spend::spend_auth_sig` getter (via `getset`). +- `pczt::roles::signer::Signer::shielded_sighash` getter. + ## [0.4.1, 0.5.1] - 2026-02-26 ### Fixed diff --git a/pczt/src/orchard.rs b/pczt/src/orchard.rs index ebe4cd7c73..0a9cc8fa5b 100644 --- a/pczt/src/orchard.rs +++ b/pczt/src/orchard.rs @@ -111,6 +111,7 @@ pub struct Spend { /// /// This is set by the Signer. #[serde_as(as = "Option<[_; 64]>")] + #[getset(get = "pub")] pub(crate) spend_auth_sig: Option<[u8; 64]>, /// The [raw encoding] of the Orchard payment address that received the note being spent. diff --git a/pczt/src/roles/signer/mod.rs b/pczt/src/roles/signer/mod.rs index 7fcd603ec3..98188f132c 100644 --- a/pczt/src/roles/signer/mod.rs +++ b/pczt/src/roles/signer/mod.rs @@ -95,6 +95,11 @@ impl Signer { }) } + /// Returns the cached shielded (Orchard + Sapling) sighash. + 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