Source: https://watch.fincobra.com/docs/bitcoin-xpub.html


# Bitcoin xPub Wallet Tracking

Bitcoin xPub tracking combines balances and transaction history across the addresses derived from your extended public key.

## How to Connect

Export your extended public key from your hardware wallet (Ledger, Trezor, etc.) or software wallet. FinCobra supports:

| Key Type | Format | Address Type            |
| -------- | ------ | ----------------------- |
| xpub     | BIP-44 | Legacy (1...)           |
| ypub     | BIP-49 | Nested SegWit (3...)    |
| zpub     | BIP-84 | Native SegWit (bc1q...) |

The connection is **read-only** — an extended public key can only derive addresses and view balances. It cannot sign transactions or move funds.

## How PnL Works

Matched transfers carry cost basis between connected sources. External receipts without a matched source use their historical market value at entry to the tracked portfolio.

Blockchain history records movements, but it does not establish every original purchase cost. Historical daily entry prices measure performance within the tracked portfolio. An asterisk (\*) marks incomplete accounting; unknown costs do not count as free purchases.

See [How PnL Works](./how-pnl-works.md) for coverage and formulas.

## Address Derivation

FinCobra uses Electrum to derive addresses from your extended public key following BIP-44/49/84 derivation paths. The system scans both the receiving and change address chains to find all transactions associated with your wallet.

Ledger Live may label a native SegWit account as `xpub` while including `native_segwit` metadata in the account export. Paste the full Ledger account export when available so FinCobra can normalize the key to the native SegWit format before restoring it in Electrum.
