Skip to content

Add Electrum & BlueWallet instructions#53

Open
TheButterZone wants to merge 2 commits into
earonesty:masterfrom
TheButterZone:patch-1
Open

Add Electrum & BlueWallet instructions#53
TheButterZone wants to merge 2 commits into
earonesty:masterfrom
TheButterZone:patch-1

Conversation

@TheButterZone
Copy link
Copy Markdown

@TheButterZone TheButterZone commented Jun 2, 2026

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 -- --check
  • cargo test
  • cargo clippy --all-targets -- -D warnings

Release Notes

  • This should appear in generated release notes.
  • This is internal-only and should be labeled ignore-for-release.

Summary by CodeRabbit

  • Documentation
    • Added setup instructions for Electrum and BlueWallet wallets.
    • Included guidance on wallet configuration, key export, and address mapping best practices.

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)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds setup instructions to docs/wallet-descriptors.md for two wallet platforms: Electrum and BlueWallet. The new content explains how to export the account xpub, configure it using the wpkh(YOUR_XPUB/0/*) descriptor format, and recommends avoiding 2FA and multisig during initial setup.

Changes

Wallet Descriptor Setup Documentation

Layer / File(s) Summary
Electrum and BlueWallet setup instructions
docs/wallet-descriptors.md
New sections provide step-by-step guidance for obtaining account xpub from Electrum and BlueWallet, configuring wpkh descriptors, and avoiding 2FA/multisig settings during initial setup to ensure xpub maps to receive addresses.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A wallet guide both clear and bright,
With Electrum steps and BlueWallet right,
Export that xpub with gentle care,
No 2FA tricks hiding there,
Descriptors bloom in SegWit's light!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a Summary section matching the template, but the Checks and Release Notes sections are unchecked/incomplete, and the author expresses uncertainty about technical correctness without resolution. Complete the Checks and Release Notes checkboxes with appropriate selections, and either resolve the zpub vs xpub concern or file a separate issue if the technical question requires further discussion.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Electrum & BlueWallet instructions' directly and clearly summarizes the main change—adding wallet setup instructions for two specific wallet applications to the documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
docs/wallet-descriptors.md (1)

79-79: ⚡ Quick win

Simplify 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

📥 Commits

Reviewing files that changed from the base of the PR and between 676557b and 9713d9a.

📒 Files selected for processing (1)
  • docs/wallet-descriptors.md

Comment on lines +80 to +81
4. Copy the account's xpub or zpub.
5. Use `wpkh(YOUR_XPUB/0/*)` for a native SegWit account.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Jun 2, 2026

Choose a reason for hiding this comment

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

🛠️ 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.

Suggested change
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/*).

Copy link
Copy Markdown
Author

@TheButterZone TheButterZone Jun 2, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 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 -80

Length 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:

  1. Tell users to look for the xpub export variant specifically, or
  2. 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/*)`.

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.

1 participant