feat: hdwallet-trezor Zcash support#766
Conversation
Add Zcash-specific transaction parameters to Trezor signing: - Add ZCASH_VERSION_GROUP_ID constants (v4, v5) - Add ZCASH_CONSENSUS_BRANCH_ID constant (NU6.1) - Pass version, versionGroupId, and branchId to Trezor Connect Implementation follows native wallet pattern (PR #760): - Defaults to version 5 (NU5) if not specified - Calculates versionGroupId based on transaction version - Uses consensus branch ID 0x4dec4df0 for NU6.1 Fixes broadcast error: "transaction uses an incorrect consensus branch id" when signing Zcash transactions with Trezor. Requires Trezor firmware v1.11.1+ (T1) or v2.5.1+ (TT) for NU5 support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit 389dc3b.
|
Warning Rate limit exceeded@gomesalexandre has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 28 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (28)
📝 WalkthroughWalkthroughThe Bitcoin transaction signing module for Trezor devices is extended with Zcash support. New constants map Zcash version numbers to group IDs and branch IDs. The signing function detects Zcash transactions and conditionally adds version, versionGroupId, and branchId fields to the payload. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/hdwallet-trezor/src/bitcoin.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-20T11:04:44.808Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 737
File: packages/hdwallet-trezor/src/ethereum.ts:122-138
Timestamp: 2025-11-20T11:04:44.808Z
Learning: In packages/hdwallet-trezor/src/ethereum.ts, the ethSignTypedData function correctly returns the signature from res.payload.signature without adding a "0x" prefix. This works correctly in practice and has been tested, despite appearing inconsistent with ethSignMessage which does add the prefix. The Trezor Connect ethereumSignTypedData response already provides the signature in the correct format for consumption.
Applied to files:
packages/hdwallet-trezor/src/bitcoin.ts
📚 Learning: 2025-08-07T15:47:29.207Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/src/transport.ts:10-10
Timestamp: 2025-08-07T15:47:29.207Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the code works locally without TypeScript errors but has issues in CI environment. Using ts-expect-error would fail locally since there are no actual errors to suppress.
Applied to files:
packages/hdwallet-trezor/src/bitcoin.ts
📚 Learning: 2025-08-07T15:47:26.835Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/src/transport.ts:12-12
Timestamp: 2025-08-07T15:47:26.835Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the CI environment has different type checking behavior than local development. The code works locally without errors, but CI reports type issues, so ts-ignore is necessary to suppress the inconsistent type checking across environments.
Applied to files:
packages/hdwallet-trezor/src/bitcoin.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build and Release
🔇 Additional comments (1)
packages/hdwallet-trezor/src/bitcoin.ts (1)
34-37: No issues identified. The version group ID values match official Zcash protocol specifications: version 4 uses 0x892f2085 (Sapling/Overwinter format per ZIP-2003) and version 5 uses 0x26a7270a (NU5/Orchard format per ZIP-225).

Description
Does what it says on the box - Claude deets below
Add Zcash-specific transaction parameters to Trezor signing:
Implementation follows native wallet pattern (PR #760):
Fixes broadcast error: "transaction uses an incorrect consensus
branch id" when signing Zcash transactions with Trezor.
Requires Trezor firmware v1.11.1+ (T1) or v2.5.1+ (TT) for NU5 support.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Screenshots
https://jam.dev/c/673911a2-c6f6-45f3-baa9-e9d59a0535a4
Issue
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.