-
Notifications
You must be signed in to change notification settings - Fork 981
FIX: hw wallets with taproot integration #8166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f0ab77d to
42adf77
Compare
There was a problem hiding this comment.
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
BlueWallet/class/wallets/watch-only-wallet.ts
Lines 243 to 246 in 42adf77
| if (this._hdWalletInstance) return this._hdWalletInstance.weOwnAddress(address); | |
| throw new Error('Not initialized'); | |
| } | |
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.
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());There was a problem hiding this comment.
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 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.