fix: zcash transparent is not signing
What changed, and why it matters
This is a one-line build-configuration fix for the Keystone hardware wallet's Zcash transparent transaction signing. Previously, the code that signs the transparent (non-shielded) part of a Zcash PCZT transaction was only compiled when the 'multi_coins' feature was enabled. The change also enables that signing code when the 'cypherpunk' feature is enabled. Without this fix, a device built with only the 'cypherpunk' feature could produce an incomplete or invalid Zcash transaction signature, likely causing the transaction to be rejected by the network rather than stealing funds.
Verify the fix with a cypherpunk-only build by signing a Zcash transaction that contains transparent inputs and confirming the resulting PCZT includes valid transparent signatures. Review other #[cfg(feature = "multi_coins")] guards in the Zcash app for similar omissions. Consider whether the cypherpunk feature should imply multi_coins or whether all signing paths need explicit dual gating.
Security signals we found
Functional bug in cryptographic signing path
Build-feature conditional compilation error
Could produce invalid/incomplete transaction signatures
No explicit security claim in commit message
Evidence from the diff
In rust/apps/zcash/src/pczt/sign.rs, the conditional compilation guard for pczt_ext::sign_transparent was changed from #[cfg(feature = “multi_coins”)] to #[cfg(any(feature = “multi_coins”, feature = “cypherpunk”))]. The cypherpunk feature block immediately below it presumably handles shielded signing. When cypherpunk is enabled without multi_coins, transparent inputs would not be signed, producing an incomplete PCZT. The patch ensures transparent signing is included in cypherpunk builds.
Changed components
rust/apps/zcash/src/pczt/sign.rsZcash transparent PCZT signingcypherpunk firmware build variantInspect captured patch +1 / −1
diff --git a/rust/apps/zcash/src/pczt/sign.rs b/rust/apps/zcash/src/pczt/sign.rs
index 0134843..d8fadf8 100644
--- a/rust/apps/zcash/src/pczt/sign.rs
+++ b/rust/apps/zcash/src/pczt/sign.rs
@@ -105,7 +105,7 @@ impl PcztSigner for SeedSigner<'_> {
pub fn sign_pczt(pczt: Pczt, seed: &[u8]) -> crate::Result<Vec<u8>> {
let signer = low_level_signer::Signer::new(pczt);
- #[cfg(feature = "multi_coins")]
+ #[cfg(any(feature = "multi_coins", feature = "cypherpunk"))]
let signer = pczt_ext::sign_transparent(signer, &SeedSigner { seed })
.map_err(|e| ZcashError::SigningError(e.to_string()))?;
#[cfg(feature = "cypherpunk")]
Why this scored 41/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.