Add Electrum & BlueWallet instructions#53
Conversation
added Electrum & BlueWallet instructions (but I question the use of "XPUB" for native SegWit accounts, as everywhere I see a native SegWit MPK, it starts with zpub - p2pkh starts with xpub)
added Electrum & BlueWallet instructions (but I question the use of "XPUB" for native SegWit accounts, as everywhere I see a native SegWit (p2wpkh) MPK, it starts with zpub - every p2pkh MPK I see starts with xpub)
📝 WalkthroughWalkthroughThis PR adds setup instructions to ChangesWallet Descriptor Setup Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/wallet-descriptors.md (1)
79-79: ⚡ Quick winSimplify the conditional instruction.
The current phrasing has nested conditionals that may confuse users in a hurry. Consider breaking this into clearer steps or simplifying the language.
As per coding guidelines: "Write for real people with busy wallets and limited Bitcoin descriptor context."
📝 Proposed simplification
-3. Press Export/Backup if it is a watch-only wallet OR if seeded, select Show Wallet XPUB under Options. +3. For a watch-only wallet, press Export/Backup. For a wallet with a seed, open Options and select Show Wallet XPUB.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/wallet-descriptors.md` at line 79, The line "Press Export/Backup if it is a watch-only wallet OR if seeded, select Show Wallet XPUB under Options." is confusing due to nested conditionals; simplify into two clear alternatives by replacing it with either a single sentence like "If the wallet is watch-only, press Export/Backup; if the wallet is seeded, open Options and select Show Wallet XPUB." or two separate steps: "If watch-only: Press Export/Backup." and "If seeded: Open Options → Show Wallet XPUB." Target the existing sentence starting "Press Export/Backup..." for this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/wallet-descriptors.md`:
- Around line 80-81: Clarify that the descriptor example wpkh(YOUR_XPUB/0/*)
expects an xpub-format extended public key and that zpub/ypub encodings must be
converted to the xpub encoding before pasting (or instruct users to export the
xpub variant from their wallet); update the docs to state explicitly whether
zpub can be pasted directly or must be converted and point users to a conversion
tool or the wallet's export-xpub option, referencing the descriptor example
wpkh(YOUR_XPUB/0/*).
---
Nitpick comments:
In `@docs/wallet-descriptors.md`:
- Line 79: The line "Press Export/Backup if it is a watch-only wallet OR if
seeded, select Show Wallet XPUB under Options." is confusing due to nested
conditionals; simplify into two clear alternatives by replacing it with either a
single sentence like "If the wallet is watch-only, press Export/Backup; if the
wallet is seeded, open Options and select Show Wallet XPUB." or two separate
steps: "If watch-only: Press Export/Backup." and "If seeded: Open Options → Show
Wallet XPUB." Target the existing sentence starting "Press Export/Backup..." for
this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6c06ce6a-8674-4c51-9139-b9cff268ae27
📒 Files selected for processing (1)
docs/wallet-descriptors.md
| 4. Copy the account's xpub or zpub. | ||
| 5. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account. |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Clarify whether zpub can be used directly in the descriptor.
The instructions mention copying "xpub or zpub" but the next line shows only wpkh(YOUR_XPUB/0/*) as the descriptor format. Users who copy a zpub won't know whether they can paste it directly as YOUR_XPUB or if they need to convert it first. Native SegWit accounts typically export zpub, but Bitcoin Core descriptor format expects xpub encoding regardless of the account type.
Specify exactly what to do with a zpub, or clarify that users should look for the xpub export option in their wallet. As per coding guidelines: "avoid assuming users understand derivation indexes, script types, account paths, or wallet internals unless the docs explain exactly what to do."
📝 Proposed clarification
One option is to tell users to paste any extended public key (xpub, zpub, ypub, etc.) directly:
-4. Copy the account's xpub or zpub.
-5. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account.
+4. Copy the account's extended public key (may start with xpub, zpub, or ypub).
+5. Use `wpkh(YOUR_KEY/0/*)` replacing YOUR_KEY with the copied value.Or, if zpub requires conversion, provide the conversion step or tool.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 4. Copy the account's xpub or zpub. | |
| 5. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account. | |
| 4. Copy the account's extended public key (may start with xpub, zpub, or ypub). | |
| 5. Use `wpkh(YOUR_KEY/0/*)` for a native SegWit account, replacing YOUR_KEY with the copied value. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/wallet-descriptors.md` around lines 80 - 81, Clarify that the descriptor
example wpkh(YOUR_XPUB/0/*) expects an xpub-format extended public key and that
zpub/ypub encodings must be converted to the xpub encoding before pasting (or
instruct users to export the xpub variant from their wallet); update the docs to
state explicitly whether zpub can be pasted directly or must be converted and
point users to a conversion tool or the wallet's export-xpub option, referencing
the descriptor example wpkh(YOUR_XPUB/0/*).
There was a problem hiding this comment.
Exactly. If qpayd is looking for a xpub only, the zpub will need to be converted/encoded into an xpub in the case of native SegWit master public keys? I'm fine with whatever, my intent was mainly to get Electrum & BlueWallet instructions in, inclusive of all prefixes.
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for xpub/zpub handling in the descriptor parsing code
rg -n --type rust "zpub|ypub|xpub|version_bytes|extended_public_key|Xpub|Zpub" -C3
# Also look for any descriptor parsing logic
rg -n --type rust "descriptor|Descriptor|parse_descriptor" -C2 | head -80Length of output: 11226
@TheButterZone — yes, that's correct. qpayd delegates descriptor parsing to the miniscript crate (miniscript::Descriptor<miniscript::DescriptorPublicKey>, see src/config.rs Line 349), and that crate only accepts xpub (mainnet) / tpub (testnet) version bytes in its key parser. A zpub uses different version bytes and will be rejected at startup with a parse error.
So the BlueWallet step needs to either:
- Tell users to look for the xpub export variant specifically, or
- Tell users with a zpub to convert it to xpub first (e.g. via jlopp's xpub converter).
Here's a suggested update:
-4. Copy the account's xpub or zpub.
-5. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account.
+4. Copy the account's extended public key. BlueWallet may show a zpub for
+ native SegWit accounts. qpayd requires xpub encoding — if you see a zpub,
+ convert it to xpub first (e.g. using https://jlopp.github.io/xpub-converter/).
+5. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account.It's also worth adding a similar note to the Electrum section, since Electrum also exports zpub for native SegWit wallets:
3. Copy the Master Public Key.
-4. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account.
+4. Electrum exports a zpub for native SegWit (p2wpkh) wallets. Convert it to
+ xpub encoding before use (e.g. https://jlopp.github.io/xpub-converter/),
+ then use `wpkh(YOUR_XPUB/0/*)`.
Summary
I added Electrum & BlueWallet instructions
(but I question the use of "XPUB" for native SegWit accounts, as everywhere I see a native SegWit (p2wpkh) MPK, it starts with zpub - every p2pkh MPK I see starts with xpub)
Not sure what the stuff below is...
Checks
cargo fmt -- --checkcargo testcargo clippy --all-targets -- -D warningsRelease Notes
ignore-for-release.Summary by CodeRabbit