Skip to content

Add request-derived Zcash testnet support#29

Closed
czarcas7ic wants to merge 6 commits into
zcash-upstreamfrom
adam/zcash-pczt-testnet-network
Closed

Add request-derived Zcash testnet support#29
czarcas7ic wants to merge 6 commits into
zcash-upstreamfrom
adam/zcash-pczt-testnet-network

Conversation

@czarcas7ic

@czarcas7ic czarcas7ic commented Jul 14, 2026

Copy link
Copy Markdown

Summary

  • Derive the signing network from the PCZT Global coin type and reject unsupported or mixed-network requests.
  • Keep receive and wallet-connection testnet switches local to their pages, with testnet viewing keys cached only in RAM.
  • Show a Network / Testnet row during testnet review while leaving mainnet review unchanged.

Design

Signing never reads mutable UI network state. The contained PCZT Global prefix decoder is pinned by compatibility tests, which avoids requiring a librustzcash dependency release for this firmware change.

czarcas7ic and others added 6 commits July 14, 2026 12:51
The standard-receive more menu is only reachable for the Zcash card
(HasMoreBtn), but its tutorial button was hardcoded to the Ethereum
derivation-path tutorial - dead code until the menu became reachable.
Drop the button and its handler, and shrink the menu to the single
testnet switch row.
PcztNetwork::from_pczt cloned and re-serialized the entire PCZT just to
read the six-field Global prefix. The only raw-sign entry point,
app_zcash::sign_pczt, already holds the original bytes, so decode the
network there (after the envelope parse) and pass it down through
pczt::sign::sign_pczt and sign_and_redact_pczt, deleting from_pczt.
The Global prefix decoder skipped the eight-byte envelope header
blindly, relying on every caller having parsed the PCZT first. Verify
the magic and a known version (1 or 2, both of which serialize Global
first) in the decoder itself, and pin the v1 envelope in the
compatibility test since wallets on released librustzcash still send
v1 while Pczt::serialize emits v2.

Also reject transparent inputs whose declared derivation path is too
short to name a coin type, instead of skipping the network comparison
for them.
@czarcas7ic czarcas7ic closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant