> For the complete documentation index, see [llms.txt](https://docs-unified.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-unified.crypto-chief.com/api-reference/xpubs.md). Agents can also search and read this documentation through its [MCP server](https://docs-unified.crypto-chief.com/~gitbook/mcp).

# Xpubs

## Xpubs

An extended public key (`xpub`, `ypub`, `zpub`, `tpub`, `vpub`…) stands for every address of an HD wallet account. These endpoints read the whole account in one call, on networks where `capabilities.xpub` is `true`: `BTC_MAINNET`, `BTC_TESTNET_4`, `LITECOIN_MAINNET`, `DOGECOIN_MAINNET`, `BITCOIN_CASH_MAINNET`.

`network` is required: Bitcoin-family networks share key formats. The key's prefix chooses the address type: `xpub` (`tpub`) — legacy, `ypub` (`upub`) — nested SegWit, `zpub` (`vpub`) — native SegWit.

EventStream does not subscribe to xpubs. To stream an xpub wallet, subscribe its derived addresses — listed by [`include=addresses`](#xpub-balance) — and add new ones as the wallet derives them. See [Xpub Wallets](https://docs-unified.crypto-chief.com/guides/xpub-wallets.md).

### Xpub balance

`GET /v1/xpubs/{xpub}`

| Parameter | In    | Type   | Required | Description                                                    |
| --------- | ----- | ------ | -------- | -------------------------------------------------------------- |
| `xpub`    | path  | string | Yes      | Extended public key                                            |
| `network` | query | string | Yes      | One UTXO network                                               |
| `include` | query | string | No       | `addresses` — the used addresses with their paths and balances |

```bash
curl -s "https://api-unified.crypto-chief.com/v1/xpubs/zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs?network=BTC_MAINNET&include=addresses" \
  -H "X-API-Key: $CC_API_KEY"
```

```json
{
  "network": "BTC_MAINNET",
  "balance": { "raw": "15000000", "decimals": 8, "scale": null, "value": "0.15" },
  "unconfirmed": { "raw": "0", "decimals": 8, "scale": null, "value": "0" },
  "addresses": [
    {
      "address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
      "path": "m/84'/0'/0'/0/0",
      "balance": { "raw": "15000000", "decimals": 8, "scale": null, "value": "0.15" },
      "transfers": 3
    }
  ]
}
```

| Field         | Description                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| `balance`     | Confirmed balance of the account                                                                              |
| `unconfirmed` | Net balance change of mempool transactions; negative while the account spends                                 |
| `addresses[]` | With `include=addresses`: each used address, its derivation `path`, its balance and its number of `transfers` |

### Xpub transfers

`GET /v1/xpubs/{xpub}/transfers`

Transfers of every address of the account, in the [transfer](https://docs-unified.crypto-chief.com/api-reference/address-history.md#the-transfer-object) shape: one transfer per output, `from: null`, inputs and outputs in `utxo`. `direction` is relative to the account: `out` when the account's addresses are among the inputs.

| Parameter                | In    | Type    | Required | Description                                     |
| ------------------------ | ----- | ------- | -------- | ----------------------------------------------- |
| `xpub`                   | path  | string  | Yes      | Extended public key                             |
| `network`                | query | string  | Yes      | One UTXO network                                |
| `direction`              | query | string  | No       | `in`, `out` or `self`                           |
| `from`, `to`             | query | string  | No       | Time range `[from, to)`                         |
| `from_block`, `to_block` | query | string  | No       | Block range `[from_block, to_block)`            |
| `min_stage`              | query | string  | No       | `found`, `confirmed` (default) or `final`       |
| `min_confirmations`      | query | integer | No       | At least this many confirmations                |
| `include`                | query | string  | No       | `fiat`                                          |
| `currency`               | query | string  | No       | Fiat currency for `include=fiat`. Default `USD` |
| `order`                  | query | string  | No       | `desc` (default) or `asc`                       |
| `limit`                  | query | integer | No       | `1`–`100`, default `50`                         |
| `cursor`                 | query | string  | No       | `next_cursor` of the previous page              |

```bash
curl -s "https://api-unified.crypto-chief.com/v1/xpubs/zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs/transfers?network=BTC_MAINNET&direction=in&min_stage=final" \
  -H "X-API-Key: $CC_API_KEY"
```

The response is a page of transfers; an item looks like the [Bitcoin example](https://docs-unified.crypto-chief.com/api-reference/address-history.md#transfers-by-family).

### Xpub UTXOs

`GET /v1/xpubs/{xpub}/utxos`

The unspent outputs of every address of the account, in the [UTXO](https://docs-unified.crypto-chief.com/api-reference/utxos.md) shape.

| Parameter           | In    | Type    | Required | Description                               |
| ------------------- | ----- | ------- | -------- | ----------------------------------------- |
| `xpub`              | path  | string  | Yes      | Extended public key                       |
| `network`           | query | string  | Yes      | One UTXO network                          |
| `min_stage`         | query | string  | No       | `found`, `confirmed` (default) or `final` |
| `min_confirmations` | query | integer | No       | At least this many confirmations          |
| `order`             | query | string  | No       | `desc` (default) or `asc`                 |
| `limit`             | query | integer | No       | `1`–`100`, default `50`                   |
| `cursor`            | query | string  | No       | `next_cursor` of the previous page        |

```bash
curl -s "https://api-unified.crypto-chief.com/v1/xpubs/zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs/utxos?network=BTC_MAINNET" \
  -H "X-API-Key: $CC_API_KEY"
```

```json
{
  "items": [
    {
      "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
      "vout": 0,
      "amount": { "raw": "15000000", "decimals": 8, "scale": null, "value": "0.15" },
      "stage": "final",
      "confirmations": "120",
      "block": {
        "height": "872400",
        "hash": "000000000000000000018a9b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d",
        "parent_hash": "000000000000000000027b8c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e",
        "timestamp": "2026-11-28T14:20:00.000Z"
      },
      "coinbase": false,
      "script_hex": "0014e8df018c7e326cc253faac7e46cdc51e68542c42"
    }
  ],
  "next_cursor": null,
  "snapshot": [
    { "network": "BTC_MAINNET", "height": "872519", "hash": "000000000000000000012f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c", "indexed_through": null }
  ]
}
```

A UTXO of an xpub does not say which derived address holds it; match `script_hex`, or list the addresses with `include=addresses` and read [their UTXOs](https://docs-unified.crypto-chief.com/api-reference/utxos.md).
