Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: hw wallets with taproot integration#8166

Merged
Overtorment merged 1 commit into
masterfrom
fix-hw-wallets-with-taproot-integration
Nov 17, 2025
Merged

FIX: hw wallets with taproot integration#8166
Overtorment merged 1 commit into
masterfrom
fix-hw-wallets-with-taproot-integration

Conversation

@Overtorment

@Overtorment Overtorment commented Nov 16, 2025

Copy link
Copy Markdown
Member

Note

Enable Taproot (BIP86) watch-only flows using zpub/descriptors and fix zpub handling in Taproot wallet; add logs and update tests.

  • Wallets:
    • Taproot: In class/wallets/hd-taproot-wallet.ts, handle zpub by converting to traditional xpub before bip32.fromBase58() in _getNodePubkeyByIndex.
    • Watch-only: In class/wallets/watch-only-wallet.ts, select HDTaprootWallet when path starts with m/86' (BIP86) regardless of xpub/ypub/zpub; broaden allowMasterFingerprint() to xpub|ypub|zpub.
  • Send:
    • Add error logging in screen/send/SendDetails.tsx for PSBT creation/sign failures.
  • Tests:
    • Update e2e expected receive address/URI.
    • Add unit tests for importing BIP86 with zpub (Keystone JSON and descriptors), address generation, and transaction creation; extend xpub PSBT test to handle purged internals.

Written by Cursor Bugbot for commit 3623d00. This will update automatically on new commits. Configure here.

Comment thread screen/send/SendDetails.tsx
Comment thread screen/send/SendDetails.tsx
Comment thread screen/send/SendDetails.tsx
@Overtorment Overtorment force-pushed the fix-hw-wallets-with-taproot-integration branch from f0ab77d to 42adf77 Compare November 16, 2025 00:59

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Master Fingerprint Support Broken for Taproot Wallets

The allowMasterFingerprint() method only checks if getSecret() starts with 'zpub', but doesn't delegate to _hdWalletInstance. With the new logic that detects Taproot wallets by derivation path, a Taproot wallet with xpub prefix would incorrectly return false instead of true, breaking hardware wallet master fingerprint support for such wallets.

class/wallets/watch-only-wallet.ts#L243-L246

if (this._hdWalletInstance) return this._hdWalletInstance.weOwnAddress(address);
throw new Error('Not initialized');
}

Fix in Cursor Fix in Web


@Overtorment Overtorment force-pushed the fix-hw-wallets-with-taproot-integration branch from 42adf77 to 23c19fe Compare November 16, 2025 11:50
@Overtorment Overtorment force-pushed the fix-hw-wallets-with-taproot-integration branch from 23c19fe to 3623d00 Compare November 16, 2025 13:20
@Overtorment Overtorment requested a review from ojokne November 16, 2025 19:20
assert.strictEqual(w.getDerivationPath(), "m/86'/0'/0'");
assert.ok(w._getExternalAddressByIndex(0).startsWith('bc1p'), `not taproot address generated: ${w._getExternalAddressByIndex(0)}`);
assert.ok(w.allowMasterFingerprint());
// assert.ok(w.useWithHardwareWalletEnabled());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can add a test for Use with Hardware Wallet switch button.

something like this

w.setUseWithHardwareWalletEnabled(true)
assert.ok(w.useWithHardwareWalletEnabled());

w.setUseWithHardwareWalletEnabled(false);
assert.ok(!w.useWithHardwareWalletEnabled());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we can add a test for Use with Hardware Wallet switch button.

something like this

w.setUseWithHardwareWalletEnabled(true)
assert.ok(w.useWithHardwareWalletEnabled());

w.setUseWithHardwareWalletEnabled(false);
assert.ok(!w.useWithHardwareWalletEnabled());

good catch!

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @limpbrains] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/limpbrains

@Overtorment Overtorment merged commit 5c82b19 into master Nov 17, 2025
15 checks passed
@Overtorment Overtorment deleted the fix-hw-wallets-with-taproot-integration branch November 17, 2025 11:00
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.

4 participants