FIX: hw wallets with taproot integration#8166
Conversation
f0ab77d to
42adf77
Compare
There was a problem hiding this comment.
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
BlueWallet/class/wallets/watch-only-wallet.ts
Lines 243 to 246 in 42adf77
42adf77 to
23c19fe
Compare
23c19fe to
3623d00
Compare
| 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()); |
There was a problem hiding this comment.
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());There was a problem hiding this comment.
I think we can add a test for
Use with Hardware Walletswitch button.something like this
w.setUseWithHardwareWalletEnabled(true) assert.ok(w.useWithHardwareWalletEnabled()); w.setUseWithHardwareWalletEnabled(false); assert.ok(!w.useWithHardwareWalletEnabled());
good catch!
|
Wake the fuck up samurai, we have PRs to merge [all PRs for @limpbrains] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/limpbrains |

Note
Enable Taproot (BIP86) watch-only flows using
zpub/descriptors and fixzpubhandling in Taproot wallet; add logs and update tests.class/wallets/hd-taproot-wallet.ts, handlezpubby converting to traditionalxpubbeforebip32.fromBase58()in_getNodePubkeyByIndex.class/wallets/watch-only-wallet.ts, selectHDTaprootWalletwhen path starts withm/86'(BIP86) regardless ofxpub/ypub/zpub; broadenallowMasterFingerprint()toxpub|ypub|zpub.screen/send/SendDetails.tsxfor PSBT creation/sign failures.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.