Skip to content

Conversation

@gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Dec 9, 2025

Description

This PR:

Issue

Testing

  • ZCash derivation is happy with Ledger
  • Zcash sends are happy with Ledger
  • Try at least another UTXO send with Ledger and confirm still happy

Screenshots

https://jam.dev/c/3c325702-6910-45d8-8eed-6fbd4e69e43c

Summary by CodeRabbit

  • New Features

    • Ledger support for Zcash added (ZIP-244 v4/v5) with Zcash addresses and transaction handling.
  • Documentation

    • New Zcash Ledger implementation guide and testing checklist; documents known issues and workarounds.
  • Chores

    • Bumped package versions to 1.62.26 and updated Ledger-related dependencies for improved compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

📝 Walkthrough

Walkthrough

Adds Zcash (ZIP-244 v4/v5) support to the Ledger integration, including network/config entries, signing/PSBT changes with a trusted-input monkey-patch, docs for Ledger implementation, and multiple package version/dependency bumps (including @bitgo/utxo-lib and LedgerHQ libs). Minor KeepKey import and Jest mapping updates.

Changes

Cohort / File(s) Summary
Documentation
ZCASH_LEDGER_IMPLEMENTATION.md
New implementation guide describing Zcash (ZIP-244 v4/v5) Ledger support, technical specs, issues & workarounds, testing checklist, and high-level code change summary.
Ledger: core signing logic
packages/hdwallet-ledger/src/bitcoin.ts
Added Zcash-aware signing flow: conditional BitGo PSBT path, per-input blockHeight/expiry handling, NU6.1/versioning semantics, PSBT finalization for Zcash, and a monkey-patch for getTrustedInputBIP143 to support Zcash TXID/amount trusted-input hashing.
Ledger: network & currency config
packages/hdwallet-ledger/src/utils.ts, packages/hdwallet-ledger/src/currencies.ts
Added network entry for slip44 133 (Zcash) with bitcoinjs params and appName mapping; added Zcash currency entry with xpubVersion 0x0488b21e.
Package metadata & deps (ledger)
lerna.json, packages/hdwallet-ledger/package.json, packages/hdwallet-ledger-webhid/package.json, packages/hdwallet-ledger-webusb/package.json, integration/package.json
Bumped monorepo and package versions to 1.62.26; added @bitgo/utxo-lib and upgraded various @ledgerhq/* dependencies and internal hdwallet packages.
KeepKey & bs58 changes
packages/hdwallet-keepkey/package.json, packages/hdwallet-keepkey/src/eos.ts, packages/.../keepkey*.package.json
KeepKey packages bumped to 1.62.26; added bs58/bs58check deps and switched bs58 import style in EOS code.
Examples & integration tweaks
examples/sandbox/package.json, integration/jest.config.js
Example sandbox deps bumped to 1.62.26; Jest config updated with moduleNameMapper for @brandonblack/musig/base_crypto.
Other packages (version bumps)
packages/*/package.json
Many packages updated from 1.62.25 → 1.62.26 and aligned hdwallet-core dependency versions (metadata-only changes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • packages/hdwallet-ledger/src/bitcoin.ts — Zcash signing path, PSBT handling, and the getTrustedInputBIP143 monkey-patch.
    • packages/hdwallet-ledger/src/utils.ts & currencies.ts — correctness of Zcash network params (slip44, xpub, prefixes).
    • Dependency surface: integration of @bitgo/utxo-lib and LedgerHQ upgrades for compatibility.

Possibly related PRs

Suggested reviewers

  • NeOMakinG
  • kaladinlight

Poem

🐇 Hopping through code, I found a stash,

Ledger learns Zcash — ZIP-244 dash!
BitGo PSBT and a patched little trick,
Coins now signed quick as a flick.
🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: hdwallet-ledger zcash support' directly summarizes the main change: adding Zcash support to hdwallet-ledger. It is concise, specific, and clearly indicates the primary feature addition.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_ledger_zcash

📜 Recent 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 9964e15 and 7268cb5.

📒 Files selected for processing (27)
  • examples/sandbox/package.json (2 hunks)
  • integration/package.json (2 hunks)
  • lerna.json (1 hunks)
  • packages/hdwallet-coinbase/package.json (2 hunks)
  • packages/hdwallet-core/package.json (1 hunks)
  • packages/hdwallet-gridplus/package.json (2 hunks)
  • packages/hdwallet-keepkey-chromeusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-electron/package.json (2 hunks)
  • packages/hdwallet-keepkey-nodehid/package.json (2 hunks)
  • packages/hdwallet-keepkey-nodewebusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-tcp/package.json (2 hunks)
  • packages/hdwallet-keepkey-webusb/package.json (2 hunks)
  • packages/hdwallet-keepkey/package.json (2 hunks)
  • packages/hdwallet-keplr/package.json (2 hunks)
  • packages/hdwallet-ledger-webhid/package.json (2 hunks)
  • packages/hdwallet-ledger-webusb/package.json (2 hunks)
  • packages/hdwallet-ledger/package.json (2 hunks)
  • packages/hdwallet-metamask-multichain/package.json (2 hunks)
  • packages/hdwallet-native-vault/package.json (2 hunks)
  • packages/hdwallet-native/package.json (2 hunks)
  • packages/hdwallet-phantom/package.json (2 hunks)
  • packages/hdwallet-portis/package.json (2 hunks)
  • packages/hdwallet-trezor-connect/package.json (2 hunks)
  • packages/hdwallet-trezor/package.json (2 hunks)
  • packages/hdwallet-vultisig/package.json (2 hunks)
  • packages/hdwallet-walletconnect/package.json (2 hunks)
  • packages/hdwallet-walletconnectV2/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (6)
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-native-vault/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger/package.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-walletconnect/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
📚 Learning: 2025-08-07T15:23:54.858Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.

Applied to files:

  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-walletconnect/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-walletconnect/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
📚 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-keepkey-tcp/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-walletconnect/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
📚 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-keepkey-tcp/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
📚 Learning: 2025-12-09T13:48:55.139Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 764
File: packages/hdwallet-gridplus/package.json:0-0
Timestamp: 2025-12-09T13:48:55.139Z
Learning: In the shapeshiftoss/hdwallet monorepo, the dist/ directory is not version controlled (not tracked in git). Build artifacts are generated during the build/publish workflow, not committed to the repository.

Applied to files:

  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-walletconnect/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
📚 Learning: 2025-08-07T15:24:34.076Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: examples/sandbox/package.json:15-31
Timestamp: 2025-08-07T15:24:34.076Z
Learning: Lerna v6+ supports workspace protocol syntax (workspace:*) but does not automatically convert exact versions to workspace protocol during version bumps. It only preserves existing workspace protocol syntax. Teams using Lerna for automated version bumps would need manual conversion to use workspace protocol, which negates automation benefits.

Applied to files:

  • lerna.json
⏰ 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 (15)
packages/hdwallet-walletconnectV2/package.json (1)

3-3: Version and dependency bump look good.

The version and internal dependency update are aligned with the PR's version-bump strategy across the monorepo for ZCash support. Exact pinning on the internal @shapeshiftoss/hdwallet-core dependency is appropriate.

Also applies to: 18-18

packages/hdwallet-vultisig/package.json (1)

3-3: Version and dependency alignment look correct.

The version bump to 1.62.26 and the matching @shapeshiftoss/hdwallet-core dependency update are consistent with the monorepo's version bump across multiple packages. The exact pinning of the internal dependency (no caret) follows the established convention for sibling package dependencies.

Also applies to: 20-20

packages/hdwallet-keepkey-electron/package.json (1)

3-3: Version bump aligns with monorepo conventions.

The package version is correctly bumped to 1.62.26, and the internal dependency @shapeshiftoss/hdwallet-keepkey is updated to match. This maintains consistency across the monorepo and is appropriate for propagating changes from the keepkey package to its electron wrapper. As per learnings, unpublished dependency versions during PR review are expected in this workflow.

Also applies to: 17-17

packages/hdwallet-gridplus/package.json (1)

3-3: Verify internal dependency pinning strategy.

The version bump from 1.62.25 → 1.62.26 for both the package and its @shapeshiftoss/hdwallet-core dependency is consistent with the repository-wide versioning changes noted in the PR. However, note that @shapeshiftoss/hdwallet-core is pinned to an exact version (1.62.26) without a caret range.

Based on learnings, this may be intentional (similar to how hw-transport is pinned in hdwallet-ledger due to type mismatches), but please confirm whether this exact pinning aligns with monorepo conventions for internal dependencies.

Also applies to: 23-23

packages/hdwallet-keepkey/package.json (1)

28-29: ✓ Base58 dependencies added for Zcash support.

The bs58 and bs58check dependencies are appropriate for Zcash address encoding and checksum validation when constructing PSBTs via @bitgo/utxo-lib. Version constraints are reasonable and modern.

lerna.json (1)

3-3: ✓ Monorepo version synchronized across packages.

Version bump to 1.62.26 is consistent with package-level updates.

packages/hdwallet-keepkey-tcp/package.json (1)

17-18: ✓ Version consistency maintained.

Core dependency versions aligned with monorepo 1.62.26 release.

packages/hdwallet-keepkey-webusb/package.json (1)

3-3: ✓ Version consistency across WebUSB transport.

All dependencies properly bumped to 1.62.26.

Also applies to: 17-18

examples/sandbox/package.json (1)

15-32: ✓ Example sandbox dependencies synchronized.

All 18 hdwallet packages consistently bumped to 1.62.26. This ensures the sandbox reflects the coordinated monorepo release with Zcash Ledger support.

packages/hdwallet-trezor/package.json (1)

3-3: ✓ Trezor package version aligned.

Version bumped consistently with 1.62.26 release.

Also applies to: 20-20

packages/hdwallet-walletconnect/package.json (1)

3-3: ✓ WalletConnect package version synchronized.

Core dependency updated to 1.62.26 as part of coordinated release.

Also applies to: 18-18

packages/hdwallet-metamask-multichain/package.json (1)

3-3: ✓ MetaMask Multichain package version updated.

Version bumped consistently to 1.62.26.

Also applies to: 20-20

integration/package.json (1)

14-14: Verify @bitgo/utxo-lib is added to hdwallet-ledger/package.json with compatible version.

The new @bitgo/utxo-lib dependency at version ^11.18.0 aligns with the PR objective to use it for Zcash PSBT construction. However, the critical hdwallet-ledger package is not provided in this review. Please confirm that:

  1. packages/hdwallet-ledger/package.json also declares @bitgo/utxo-lib with a compatible version
  2. Version 11.18.0 supports ZIP-244 v4/v5 Zcash transaction formats
packages/hdwallet-trezor-connect/package.json (2)

14-24: Verify all package.json files have been built with yarn build before version bumps.

Per the project's established workflow, dist/ artifacts should be regenerated after dependency updates. Please confirm that yarn build has been executed across all affected packages before finalizing the PR.


15-24: Confirm critical hdwallet-ledger and ledger-transport packages are present in PR.

This review set does not include packages/hdwallet-ledger/package.json or related packages (hdwallet-ledger-webusb, hdwallet-ledger-webhid). Per the learnings, hw-transport in those packages must be pinned to an exact version due to type mismatches. Please verify that:

  1. packages/hdwallet-ledger/package.json has hw-transport pinned (not using caret)
  2. All Ledger HQ dependencies have been bumped to latest versions (per PR objective and hw-app-btc changelog)
  3. @bitgo/utxo-lib is properly declared in hdwallet-ledger/package.json

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • ZIP-244: Entity not found: Issue - Could not find referenced Issue.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gomesalexandre gomesalexandre marked this pull request as ready for review December 10, 2025 09:45
@gomesalexandre gomesalexandre requested a review from a team as a code owner December 10, 2025 09:45
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (1)
packages/hdwallet-ledger-webusb/package.json (1)

17-22: WebUSB Ledger version pins consistent; same hw-app-btc alignment question as WebHID

These Ledger dependency bumps look reasonable and match the WebHID package, including the pin of @ledgerhq/hw-transport to 6.31.13. As noted in the WebHID review, @ledgerhq/hw-app-btc is 10.13.0 here while packages/hdwallet-ledger/package.json pins 10.12.0; consider aligning or documenting the difference to avoid multiple hw-app-btc copies.

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 49e30c7 and 639a63d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • ZCASH_LEDGER_IMPLEMENTATION.md (1 hunks)
  • lerna.json (1 hunks)
  • packages/hdwallet-ledger-webhid/package.json (1 hunks)
  • packages/hdwallet-ledger-webusb/package.json (1 hunks)
  • packages/hdwallet-ledger/package.json (1 hunks)
  • packages/hdwallet-ledger/src/bitcoin.ts (6 hunks)
  • packages/hdwallet-ledger/src/currencies.ts (1 hunks)
  • packages/hdwallet-ledger/src/utils.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • ZCASH_LEDGER_IMPLEMENTATION.md
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-08-07T15:23:54.858Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.

Applied to files:

  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
📚 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-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger/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-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-12-09T13:48:55.139Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 764
File: packages/hdwallet-gridplus/package.json:0-0
Timestamp: 2025-12-09T13:48:55.139Z
Learning: In the shapeshiftoss/hdwallet monorepo, the dist/ directory is not version controlled (not tracked in git). Build artifacts are generated during the build/publish workflow, not committed to the repository.

Applied to files:

  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
📚 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-ledger/src/utils.ts
  • packages/hdwallet-ledger/src/bitcoin.ts
🧬 Code graph analysis (1)
packages/hdwallet-ledger/src/bitcoin.ts (2)
packages/hdwallet-core/src/bitcoin.ts (1)
  • BTCSignTxInputLedger (135-139)
packages/hdwallet-ledger/src/utils.ts (1)
  • networksUtil (121-592)
🪛 markdownlint-cli2 (0.18.1)
ZCASH_LEDGER_IMPLEMENTATION.md

43-43: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (5)
lerna.json (1)

11-16: Formatting improvement—no semantic changes.

The ignoreChanges array has been reformatted for readability with no impact on configuration logic.

packages/hdwallet-ledger/src/utils.ts (1)

466-488: Zcash network wiring and appName mapping look consistent

The SLIP‑133 entry (unit/name/apiName, pubKeyHash/scriptHash 0x1cb8/0x1cbd, additionals: ["zcash","sapling"], areTransactionTimestamped: true) and isSegwitSupported: true together give you the right splitTransaction(hex, true, true, ["zcash","sapling"]) behavior, while still only exposing legacy P2PKH at higher layers. Adding 133: "Zcash" to appNameBySlip44 keeps coinToLedgerAppName in sync with the new coin.

Also applies to: 602-602

packages/hdwallet-ledger/src/currencies.ts (1)

22-25: Zcash currency entry completes btcGetPublicKeys mapping

Adding Zcash with xpubVersion: 0x0488b21e matches the standard transparent ZEC HD key versions and keeps currencies[coin] usable for btcGetPublicKeys when coin === "Zcash". No issues here.

packages/hdwallet-ledger-webhid/package.json (1)

17-20: Verify hw-app-btc version alignment across Ledger packages

The version mismatch is real: @ledgerhq/hw-app-btc differs across the workspace—packages/hdwallet-ledger uses 10.12.0, while packages/hdwallet-ledger-webhid and packages/hdwallet-ledger-webusb both use 10.13.0. While the reviewed file is already at the newer version, ensure this split is intentional or align packages/hdwallet-ledger to 10.13.0 as well to avoid duplicate package copies in the workspace.

packages/hdwallet-ledger/src/bitcoin.ts (1)

238-245: Zcash input blockHeight wiring and trusted-input metadata look sound; sequences intentionally defaulted

The Zcash implementation in btcSignTx is coherent:

  • Per‑input blockHeight is collected into blockHeights[] (line 238) and passed as the 5th tuple element exclusively when msg.coin === "Zcash" (lines 357–365), matching Ledger's ZEC API signature [tx, index, redeemScript?, sequence?, blockHeight?].
  • Global blockHeight is set from the first input's height (lines 396–399), mirroring Ledger Live's pattern.
  • expiryHeight defaults to Buffer.alloc(4) (4‑byte zero buffer, line 400) for no expiry.
  • Sequences are deliberately left as an empty array (line 351), allowing all coins—including Zcash—to use Ledger's DEFAULT_SEQUENCE (0xffffffff). The code explicitly warns that setting sequence to 0 would enable RBF/locktime, which causes issues.
  • For Zcash only, _customZcashTxId and _customZcashAmount are attached to each input's transaction object (lines 375–376), exactly what the monkey patch expects, gated behind msg.coin === "Zcash".

Non‑Zcash flows remain unchanged.

- Align @ledgerhq/hw-app-btc to v10.13.0 across all packages
- Fix bare URL markdown lint issue in ZCASH_LEDGER_IMPLEMENTATION.md
- Update expiry height documentation to reflect actual implementation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gomesalexandre gomesalexandre changed the title feat: ledger zcash support feat: hdwallet-ledger zcash support Dec 10, 2025
Add Zcash with SpendAddress (P2PKH) support to the supported script types map.
This ensures path validation and capability checking work correctly for Zcash.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/hdwallet-ledger/src/bitcoin.ts (1)

325-366: Validate required Zcash input metadata (txid, amount, blockHeight) at transaction creation time

For Zcash correctness, three per-input fields are critical:

  • txid and amount for the trusted-input monkey patch (_customZcashTxId, _customZcashAmount)
  • blockHeight for Ledger's consensusBranchId calculation

Currently, all three are optional. If any are missing, the code silently falls back to the original (broken-for-ZEC) getTrustedInputBIP143, potentially yielding invalid ZEC transactions instead of failing loudly.

For the Zcash code path, throw an error if any input is missing txid, amount, or blockHeight. This surfaces upstream integration bugs at creation time rather than at broadcast or validation time.

Also applies to: 368-380

🧹 Nitpick comments (4)
packages/hdwallet-ledger/src/bitcoin.ts (3)

2-3: Consider insulating against BitGo internal path changes

Importing ZcashPsbt / ZcashTransaction from @bitgo/utxo-lib/dist/src/bitgo ties you to an internal file layout that could change in a minor update. If BitGo exposes these types via the top-level entry point (now or in the future), it would be safer to import from there or to wrap this deep import in a tiny local adapter so only one place needs updating if BitGo reorganizes.


19-25: Clarify v4/v5 version-group handling for future maintainers

You use ZcashTransaction.VERSION4_BRANCH_NU6_1 when calling setDefaultsForVersion, then explicitly overwrite versionGroupId with ZCASH_VERSION_GROUP_ID[5] (v5) and consensusBranchId with ZCASH_CONSENSUS_BRANCH_ID. That combination is subtle and easy to “fix” incorrectly later.

I’d suggest adding a short comment explaining why VERSION4_BRANCH_NU6_1 plus the v5 versionGroupId is intentional and what exact header (version + groupId + branchId) the network currently expects. That will prevent accidental regressions if someone tries to “clean this up.”

Also applies to: 288-294


41-82: Validate Zcash-specific txid/amount before constructing the trusted-input buffer

The monkey patch cleanly gates on additionals.includes("zcash") and the presence of _customZcashTxId / _customZcashAmount, which is good. One remaining edge case is malformed data: if either field is present but not well-formed (e.g., txid not 64 hex chars, amount not an integer string), Buffer.from(txid, "hex") / BigInt(amount) will throw in a slightly opaque way.

Consider a minimal guard here (length check on txid, Number.isInteger(BigInt(...)) try/catch, or at least a more specific error) so ZEC integration issues fail with a clear message rather than a generic buffer/BigInt exception.

ZCASH_LEDGER_IMPLEMENTATION.md (1)

1-101: Documentation now accurately reflects the implementation and constraints

This guide lines up well with the code: SLIP-44 path, transparent-only support, NU6.1 branch ID, the strict @ledgerhq/hw-app-btc@10.13.0 pin, the Zcash-specific splitTransaction flags, the trusted-input monkey patch, and the hardcoded expiryHeight = 0 are all correctly captured. It’s a solid reference for anyone touching the ZEC path later.

Only suggestion: when the network or Ledger libs evolve again (new consensusBranchId, v5 support, etc.), this doc should be updated in lockstep with the code so the “Known Limitations” and branch IDs stay authoritative.

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 639a63d and 2116cf6.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • ZCASH_LEDGER_IMPLEMENTATION.md (1 hunks)
  • packages/hdwallet-ledger/package.json (1 hunks)
  • packages/hdwallet-ledger/src/bitcoin.ts (7 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 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-ledger/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-ledger/src/bitcoin.ts
  • ZCASH_LEDGER_IMPLEMENTATION.md
  • packages/hdwallet-ledger/package.json
📚 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-ledger/src/bitcoin.ts
  • ZCASH_LEDGER_IMPLEMENTATION.md
  • packages/hdwallet-ledger/package.json
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
  • ZCASH_LEDGER_IMPLEMENTATION.md
  • packages/hdwallet-ledger/package.json
📚 Learning: 2025-08-07T15:23:54.858Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
  • ZCASH_LEDGER_IMPLEMENTATION.md
  • packages/hdwallet-ledger/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
  • packages/hdwallet-ledger/package.json
📚 Learning: 2025-10-14T20:59:48.768Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/ethereum.ts:117-124
Timestamp: 2025-10-14T20:59:48.768Z
Learning: In packages/hdwallet-gridplus/src/ethereum.ts, the GridPlus SDK's sign method returns v as a number (integer), not a Buffer, so the Buffer.isBuffer(v) check is always false and vRaw = v is used directly.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-10-15T23:22:26.842Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/thormaya.ts:99-105
Timestamp: 2025-10-15T23:22:26.842Z
Learning: In packages/hdwallet-gridplus/src/thormaya.ts, the GridPlus SDK (gridplus-sdk) automatically pads the r and s signature components to 32 bytes, so explicit padding in the code may be redundant but is not required. The thorchainSignTx implementation works without explicit padding because the SDK handles it.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
🧬 Code graph analysis (1)
packages/hdwallet-ledger/src/bitcoin.ts (1)
packages/hdwallet-core/src/bitcoin.ts (1)
  • BTCSignTxInputLedger (135-139)
🔇 Additional comments (4)
packages/hdwallet-ledger/package.json (1)

18-27: Ledger dependency pins and BitGo PSBT lib align with Zcash integration

The new @bitgo/utxo-lib addition and the strict pins on Ledger deps (including @ledgerhq/hw-app-btc@10.13.0 and @ledgerhq/hw-transport@6.31.13) look consistent with the Zcash flow and with the existing convention of pinning hw-transport exactly. No issues from my side here.

Based on learnings, hw-transport is expected to remain an exact pin while other Ledger packages may also be pinned when stability is critical.

packages/hdwallet-ledger/src/bitcoin.ts (3)

84-93: Zcash support matrix (coin + script type) looks consistent

"Zcash" is now included in supportedCoins, and btcSupportsScriptType advertises only SpendAddress for ZEC, which matches the “transparent P2PKH only” constraint from the docs. This keeps capability checks in hdwallet-core aligned with what the adapter actually supports.

Also applies to: 101-110


227-274: BitGo PSBT usage for Zcash and output handling look correct

Using BitGo’s Zcash PSBT (createPsbtForNetwork with ZcashTransaction.VERSION4_BRANCH_NU6_1) and switching to { script, value } outputs via zcashAddress.toOutputScript is the right approach for ZEC. The OP_RETURN handling reuses the same PSBT instance and uses BigInt values consistently, which lines up with modern PSBT expectations. No additional changes suggested here.

Also applies to: 286-307


382-402: Zcash-specific CreateTransactionArg fields align with the documented behavior

The additionals: ["zcash", "sapling"], per-transaction blockHeight derived from the first input, and expiryHeight: Buffer.alloc(4) (no expiry) match what’s described in ZCASH_LEDGER_IMPLEMENTATION.md. Given the comments about Ledger Live using a current-block-height approximation, this shape looks reasonable and keeps non-ZEC coins unchanged.

NeOMakinG
NeOMakinG previously approved these changes Dec 10, 2025
Copy link
Contributor

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://jam.dev/c/05875136-2aef-43ab-ac1c-737b260dff53

Signing/derivations/send seems to be working as expected! 🐐

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between f82a981 and a33e729.

📒 Files selected for processing (27)
  • examples/sandbox/package.json (2 hunks)
  • integration/package.json (2 hunks)
  • lerna.json (1 hunks)
  • packages/hdwallet-coinbase/package.json (2 hunks)
  • packages/hdwallet-core/package.json (1 hunks)
  • packages/hdwallet-gridplus/package.json (2 hunks)
  • packages/hdwallet-keepkey-chromeusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-electron/package.json (2 hunks)
  • packages/hdwallet-keepkey-nodehid/package.json (2 hunks)
  • packages/hdwallet-keepkey-nodewebusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-tcp/package.json (2 hunks)
  • packages/hdwallet-keepkey-webusb/package.json (2 hunks)
  • packages/hdwallet-keepkey/package.json (2 hunks)
  • packages/hdwallet-keplr/package.json (2 hunks)
  • packages/hdwallet-ledger-webhid/package.json (2 hunks)
  • packages/hdwallet-ledger-webusb/package.json (2 hunks)
  • packages/hdwallet-ledger/package.json (2 hunks)
  • packages/hdwallet-metamask-multichain/package.json (2 hunks)
  • packages/hdwallet-native-vault/package.json (2 hunks)
  • packages/hdwallet-native/package.json (2 hunks)
  • packages/hdwallet-phantom/package.json (2 hunks)
  • packages/hdwallet-portis/package.json (2 hunks)
  • packages/hdwallet-trezor-connect/package.json (2 hunks)
  • packages/hdwallet-trezor/package.json (2 hunks)
  • packages/hdwallet-vultisig/package.json (2 hunks)
  • packages/hdwallet-walletconnect/package.json (2 hunks)
  • packages/hdwallet-walletconnectV2/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • lerna.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.
📚 Learning: 2025-08-07T15:23:54.858Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.

Applied to files:

  • integration/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-walletconnect/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-webusb/package.json
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • integration/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-walletconnect/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-webusb/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • integration/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-walletconnect/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-webusb/package.json
📚 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:

  • integration/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-walletconnect/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-webusb/package.json
📚 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:

  • integration/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-coinbase/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-webusb/package.json
📚 Learning: 2025-12-09T13:48:55.139Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 764
File: packages/hdwallet-gridplus/package.json:0-0
Timestamp: 2025-12-09T13:48:55.139Z
Learning: In the shapeshiftoss/hdwallet monorepo, the dist/ directory is not version controlled (not tracked in git). Build artifacts are generated during the build/publish workflow, not committed to the repository.

Applied to files:

  • integration/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-walletconnect/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-webusb/package.json
⏰ 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 (20)
packages/hdwallet-keepkey-nodehid/package.json (1)

3-3: Inconsistency between AI summary and actual code.

The AI summary states that "@shapeshiftoss/hdwallet-core" was updated, but the actual file shows "@shapeshiftoss/hdwallet-keepkey" was updated at line 17.

The version bumps themselves look correct: both the package version and its dependency are consistently bumped from 1.62.25 to 1.62.26. This aligns with standard monorepo version coordination practices.

Also applies to: 17-17

packages/hdwallet-keepkey-electron/package.json (1)

3-3: Version and dependency bump are consistent.

The package version and the @shapeshiftoss/hdwallet-keepkey dependency are both correctly updated from 1.62.25 to 1.62.26. This appears to be part of a coordinated monorepo-wide version bump, which aligns with the expected release workflow.

Also applies to: 17-17

integration/package.json (1)

3-3: Version bump is consistent across all packages.

All @shapeshiftoss/hdwallet-* dependencies are updated to 1.62.26, matching the integration package version. The exact version pinning (no caret ranges) is appropriate for internal monorepo dependencies.

Per learnings from this team's workflow, version bumps across interdependent packages in this monorepo occur in PRs before publishing, and references to unpublished versions during PR review is expected behavior. This follows the established pattern for coordinating feature additions (like Zcash support) across the hdwallet ecosystem.

Also applies to: 14-23

examples/sandbox/package.json (1)

3-3: Version bump aligns with PR objectives.

The sandbox example is correctly updated to v1.62.26 with all @shapeshiftoss/hdwallet-* dependencies pinned to the same exact version. This ensures consistency across the example as the main hdwallet packages are updated for ZCash support. The exact version pins align with the monorepo's release workflow, where unpublished versions are referenced during the PR review phase before publication.

Also applies to: 15-32

packages/hdwallet-portis/package.json (1)

3-3: Version and dependency bumps look good.

The patch-level version bump (1.62.25 → 1.62.26) and the corresponding @shapeshiftoss/hdwallet-core dependency update are consistent with the monorepo's release workflow for this feature addition.

Also applies to: 19-19

packages/hdwallet-phantom/package.json (1)

3-3: Version bumps are consistent with monorepo release cycle.

The patch-level version bump (1.62.25 → 1.62.26) and corresponding update to the internal @shapeshiftoss/hdwallet-core dependency align with the monorepo's release pattern. Since Phantom (Solana support) is unaffected by the ZCash/Ledger changes, no external dependency modifications are required here.

Also applies to: 18-18

packages/hdwallet-walletconnectV2/package.json (1)

3-3: Version and dependency bump aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core dependency. Based on learnings, version bumps in PRs before publishing are expected behavior in this monorepo's release workflow.

Also applies to: 18-18

packages/hdwallet-vultisig/package.json (1)

3-3: Version and dependency bump aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core dependency.

Also applies to: 20-20

packages/hdwallet-walletconnect/package.json (1)

3-3: Version and dependency bump aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core dependency.

Also applies to: 18-18

packages/hdwallet-core/package.json (1)

3-3: Core package version bump consistent with downstream updates.

Patch version update (1.62.25 → 1.62.26) for the foundation package; all dependents correctly updated their hdwallet-core references to match.

packages/hdwallet-keplr/package.json (1)

3-3: Version and dependency bump aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core dependency.

Also applies to: 20-20

packages/hdwallet-keepkey-chromeusb/package.json (1)

3-3: Version and dependency bumps aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core and keepkey dependencies.

Also applies to: 17-17, 18-18

packages/hdwallet-keepkey-webusb/package.json (1)

3-3: Version and dependency bumps aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core and keepkey dependencies.

Also applies to: 17-17, 18-18

packages/hdwallet-keepkey-nodewebusb/package.json (1)

3-3: Version and dependency bumps aligned with monorepo release.

Straightforward patch version update (1.62.25 → 1.62.26) with matching core and keepkey dependencies.

Also applies to: 17-17, 18-18

packages/hdwallet-metamask-multichain/package.json (1)

3-3: Version bump aligns with monorepo release.

The package and its core dependency have been updated consistently to version 1.62.26. The exact pinning of @shapeshiftoss/hdwallet-core matches the monorepo's internal dependency strategy.

Also applies to: 20-20

packages/hdwallet-coinbase/package.json (1)

3-3: Version bump aligns with monorepo release.

The package and @shapeshiftoss/hdwallet-core dependency updated consistently to 1.62.26 with exact pinning matching the monorepo pattern.

Also applies to: 18-18

packages/hdwallet-native-vault/package.json (1)

3-3: Version bump aligns with monorepo release.

Package and @shapeshiftoss/hdwallet-native dependency updated consistently to 1.62.26 with exact pinning.

Also applies to: 18-18

packages/hdwallet-gridplus/package.json (1)

3-3: Version bump aligns with monorepo release.

Package and @shapeshiftoss/hdwallet-core dependency updated consistently to 1.62.26 with exact pinning. Specialized dependency configuration (nohoist for ethereumjs) preserved.

Also applies to: 23-23

packages/hdwallet-native/package.json (1)

3-3: Version bump aligns with monorepo release.

Package and @shapeshiftoss/hdwallet-core dependency updated to 1.62.26 with exact pinning. Other pinned dependencies (@shapeshiftoss/bitcoinjs-lib 7.0.0-shapeshift.2, @shapeshiftoss/proto-tx-builder 0.10.0) remain appropriately unchanged.

Also applies to: 20-20

packages/hdwallet-keepkey-tcp/package.json (1)

3-3: Version and dependency bumps are consistent with the broader release.

The patch version bump to 1.62.26 and synchronized dependency updates align with the expected monorepo release workflow. Based on learnings, version bumping before publishing is standard practice in this repository.

Also applies to: 17-18

Jest v26 doesn't properly support package.json exports field for subpath imports.
Added explicit mapping for @brandonblack/musig/base_crypto to work around this limitation.

This fixes integration test failures where @bitgo/secp256k1 couldn't import from @brandonblack/musig/base_crypto

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
integration/jest.config.js (1)

10-16: Prefer require.resolve for the new musig module alias for robustness.

The mapper looks fine, but hard‑coding the node_modules path is a bit brittle compared to the existing require.resolve usage. Consider aligning this entry with the others for better resilience to layout changes:

-    "^@brandonblack/musig/base_crypto$": "<rootDir>/../../node_modules/@brandonblack/musig/lib/base_crypto.js",
+    "^@brandonblack/musig/base_crypto$": require.resolve("@brandonblack/musig/lib/base_crypto.js"),
📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between a33e729 and 9964e15.

📒 Files selected for processing (2)
  • integration/jest.config.js (1 hunks)
  • integration/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.
📚 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:

  • integration/jest.config.js
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • integration/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • integration/package.json
⏰ 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)
integration/package.json (1)

14-24: Adding @bitgo/utxo-lib to integration looks correct; double‑check version alignment on release.

The new dependency here makes sense given the move to @bitgo/utxo-lib for PSBT construction and keeps the integration package in sync with the Ledger changes. If this release also bumps the monorepo to 1.62.26, ensure this package’s own version and its @shapeshiftoss/hdwallet-* dependency versions are updated in the same sweep so integration tests exercise the latest code paths.

@gomesalexandre gomesalexandre merged commit 9984250 into master Dec 10, 2025
3 checks passed
@gomesalexandre gomesalexandre deleted the feat_ledger_zcash branch December 10, 2025 16:58
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.

3 participants