> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomaestro.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Mempool.space Migration Guide

> Complete migration guide from Mempool.space to Maestro's Esplora-compatible Bitcoin API with endpoint mapping and cost savings.

This guide will walk you through migrating from [Mempool.space](https://mempool.space) to [Maestro's Esplora API](https://docs.gomaestro.org/esplora-api) service.

Maestro provides an **Esplora-compatible REST API** for querying Bitcoin data: addresses, transactions, blocks, and the mempool. This enables users currently relying on Mempool.space for their Bitcoin data to utilize Maestro as their provider and enjoy significant savings with minimal switching cost.

Transitioning from Mempool.space involves mapping endpoints to their Maestro counterparts and adjusting the URL and request structures accordingly.

### About Esplora

[Esplora](https://github.com/Blockstream/esplora) is a block explorer and RESTful API framework developed and maintained by [Blockstream](https://blockstream.com/). The service offers a lightweight, high-performance interface for querying Bitcoin blockchain data including blocks, transactions, addresses, and the mempool.

***

### Prerequisites

1. Obtain a Maestro [API key](https://dashboard.gomaestro.org).
2. Review [Bitcoin API documentation](https://docs.gomaestro.org/bitcoin/esplora-api/overview).

### Base URL

| **Network** | **Mempool.space**                                                        | **Maestro**                                                                                          |
| ----------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| Mainnet     | [https://mempool.space/api](https://mempool.space/api)                   | [https://xbt-mainnet.gomaestro-api.org/v0/esplora](https://xbt-mainnet.gomaestro-api.org/v0/esplora) |
| Testnet4    | [https://mempool.space/testnet4/api](https://mempool.space/testnet4/api) | [https://xbt-testnet.gomaestro-api.org/v0/esplora](https://xbt-testnet.gomaestro-api.org/v0/esplora) |

### Headers

| **Mempool.space** | **Maestro** |
| ----------------- | ----------- |
| -                 | `api-key`   |

### Examples

```bash theme={null}
# Maestro
curl -sSL "https://xbt-mainnet.gomaestro-api.org/v0/esplora/address/bc1qcx7ys0ahvtfqcc63sfn6axls0qrhkadnslpd94" \
--header 'Accept: application/json' \
--header 'api-key: <MAESTRO_API Key>'

# Mempool.space
curl -sSL "https://mempool.space/api/address/bc1qcx7ys0ahvtfqcc63sfn6axls0qrhkadnslpd94"
```

### Supported Areas

Maestro’s Esplora-compatible API supports:

| **Service**                 | **Supported** |
| --------------------------- | ------------- |
| Addresses                   | ✓             |
| Blocks                      | ✓             |
| General                     | -             |
| Mining                      | -             |
| Fees                        | -             |
| Mempool                     | ✓             |
| Transactions                | ✓             |
| Lightning                   | -             |
| Accelerator (Public)        | -             |
| Accelerator (Authenticated) | -             |

### Address

| **Mempool.space**                                                                                           | **Maestro**                                                                                    |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [`/api/address/:address`](https://mempool.space/docs/api/rest#get-address)                                  | [`/address/:address`](/bitcoin/esplora-api/addresses/address)                                  |
| [`/api/address/:address/txs`](https://mempool.space/docs/api/rest#get-address-transactions)                 | [`/address/:address/txs`](/bitcoin/esplora-api/addresses/address-transactions)                 |
| [`/api/address/:address/txs/chain`](https://mempool.space/docs/api/rest#get-address-transactions-chain)     | [`/address/:address/txs/chain`](/bitcoin/esplora-api/addresses/address-transactions-chain)     |
| [`/api/address/:address/txs/mempool`](https://mempool.space/docs/api/rest#get-address-transactions-mempool) | [`/address/:address/txs/mempool`](/bitcoin/esplora-api/addresses/address-transactions-mempool) |
| [`/api/address/:address/utxo`](https://mempool.space/docs/api/rest#get-address-utxo)                        | [`/address/:address/utxo`](/bitcoin/esplora-api/addresses/address-utxos)                       |

### Block

| **Mempool.space**                                                                                   | **Maestro**                                                                           |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`/api/block/:hash`](https://mempool.space/docs/api/rest#get-block)                                 | [`/block/:hash`](/bitcoin/esplora-api/blocks/block)                                   |
| [`/api/block/:hash/header`](https://mempool.space/docs/api/rest#get-block-header)                   | [`/block/:hash/:header`](/bitcoin/esplora-api/blocks/block-header)                    |
| [`/api/block/:hash/status`](https://mempool.space/docs/api/rest#get-block-status)                   | [`/block/:hash/status`](/bitcoin/esplora-api/blocks/block-status)                     |
| [`/api/block/:hash/txs[/:start_index]`](https://mempool.space/docs/api/rest#get-block-transactions) | [`/block/:hash/txs/:start_index`](/bitcoin/esplora-api/blocks/get-block-transactions) |
| [`/api/block/:hash/txids`](https://mempool.space/docs/api/rest#get-block-transaction-ids)           | [`/block/:hash/txids`](/bitcoin/esplora-api/blocks/block-transaction-ids)             |
| [`/api/block/:hash/txid/:index`](https://mempool.space/docs/api/rest#get-block-transaction-id)      | [`/block/:hash/txid/:index`](/bitcoin/esplora-api/blocks/block-transaction-id)        |
| [`/api/block/:hash/raw`](https://mempool.space/docs/api/rest#get-block-raw)                         | [`/block/:hash/raw`](/bitcoin/esplora-api/blocks/block-raw)                           |
| [`/api/blocks[/:start_height]`](https://mempool.space/docs/api/rest#get-blocks)                     | [`/blocks/:start_height`](/bitcoin/esplora-api/blocks/blocks)                         |
| [`/api/block-height/:height`](https://mempool.space/docs/api/rest#get-block-height)                 | [`/block-height/:height`](/bitcoin/esplora-api/blocks/block-height)                   |
| [`/api/blocks/tip/height`](https://mempool.space/docs/api/rest#get-block-tip-height)                | [`/blocks/tip/height`](/bitcoin/esplora-api/blocks/block-tip-height)                  |
| [`/api/blocks/tip/hash`](https://mempool.space/docs/api/rest#get-block-tip-hash)                    | [`/blocks/tip/hash`](/bitcoin/esplora-api/blocks/block-tip-hash)                      |

### Mempool

| **Mempool.space**                                                                       | **Maestro**                                                              |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`/api/mempool`](https://mempool.space/docs/api/rest#get-mempool)                       | [`/mempool`](/bitcoin/esplora-api/mempool/mempool)                       |
| [`/api/mempool/txids`](https://mempool.space/docs/api/rest#get-mempool-transaction-ids) | [`/mempool/txids`](/bitcoin/esplora-api/mempool/mempool-transaction-ids) |
| [`/api/mempool/recent`](https://mempool.space/docs/api/rest#get-mempool-recent)         | [`/mempool/recent`](/bitcoin/esplora-api/mempool/mempool-recent)         |

### Transaction

| **Mempool.space**                                                                                         | **Maestro**                                                                                      |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [`/api/tx/:txid/merkeblock-proof`](https://mempool.space/docs/api/rest#get-transaction-merkleblock-proof) | [`/tx/:txid/merkleblock-proof`](/bitcoin/esplora-api/transactions/transaction-merkleblock-proof) |
| [`/api/tx/:txid/merkle-proof`](https://mempool.space/docs/api/rest#get-transaction-merkle-proof)          | [`/tx/:txid/merkle-proof`](/bitcoin/esplora-api/transactions/transaction-merkle-proof)           |
| [`/api/tx/:txid/outspend/:vout`](https://mempool.space/docs/api/rest#get-transaction-outspend)            | [`/tx/:txid/outspend/:vout`](/bitcoin/esplora-api/transactions/transaction-outspend)             |
| [`/api/tx/:txid/outspends`](https://mempool.space/docs/api/rest#get-transaction-outspends)                | [`/tx/:txid/outspends`](/bitcoin/esplora-api/transactions/transaction-outspends)                 |
| [`/api/tx/:txid/raw`](https://mempool.space/docs/api/rest#get-transaction-raw)                            | [`/tx/:txid/raw`](/bitcoin/esplora-api/transactions/transaction-raw)                             |
| [`/api/tx/:txid/rbf`](https://mempool.space/docs/api/rest#get-transaction-rbf-timeline)                   | [`/tx/:txid/rbf`](/bitcoin/esplora-api/transactions/transaction-rbf-timeline)                    |
| [`/api/tx/:txid/status`](https://mempool.space/docs/api/rest#get-transaction-status)                      | [`/tx/:txid/status`](/bitcoin/esplora-api/transactions/transaction-status)                       |
| [`/api/tx/:txid`](https://mempool.space/docs/api/rest#get-transaction)                                    | [`/tx/:txid`](/bitcoin/esplora-api/transactions/transaction)                                     |
| [`/api/tx/:txid/hex`](https://mempool.space/docs/api/rest#get-transaction-hex)                            | [`/tx/:txid/hex`](/bitcoin/esplora-api/transactions/transaction-hex)                             |
| [`/api/tx (POST)`](https://mempool.space/docs/api/rest#post-transaction)                                  | [`/tx (POST)`](/bitcoin/esplora-api/transactions/transaction)                                    |

***

### Key Differences

* Maestro is focused on **Bitcoin mainnet/testnet4** data; **no Liquid or Lightning support**
* Maestro returns **identical JSON structures** to Esplora spec, making migration straightward
* Some endpoints such as `stats`, `mining/pools`, or prices must be implemented elsewhere if needed

## Using the Esplora-BDK-Proxy for Maestro API Key Authorization

When migrating from **Mempool.space** to **Maestro’s Esplora API**, applications that rely on the [BDK (Bitcoin Development Kit)](https://bitcoindevkit.org/) may encounter authorization issues. Maestro’s Esplora API requires an `api-key` to be included in every request, while many BDK integrations (or other Esplora clients) don’t natively support adding custom headers.

The **[Maestro Esplora-BDK-Proxy](https://github.com/maestro-org/maestro-esplora-proxy)** solves this problem by acting as a lightweight, local proxy that automatically injects your Maestro API key into requests.

***

### Why You Need It

* **BDK limitation:** No built-in method to send custom headers like `api-key`.
* **Solution:** Run the Esplora-BDK-Proxy locally; your BDK app connects to it instead of calling Maestro directly.
* **Benefit:** Transparent to your BDK code—no code changes needed beyond pointing to the proxy URL.

***

### Installation & Configuration

**1. Clone the Repository**

```bash theme={null}
git clone https://github.com/maestro-org/maestro-esplora-proxy.git && cd maestro-esplora-proxy
```

**2. Configure Environment**
Copy the `.env.example` file to `.env`:

```bash theme={null}
cp .env.example .env
```

Edit `.env` and set:

```env theme={null}
MAESTRO_API_KEY=your-maestro-api-key-here

# For Mainnet
ESPLORA_URL=https://xbt-mainnet.gomaestro-api.org/v0/esplora

# For Testnet4 (uncomment if needed)
# ESPLORA_URL=https://xbt-testnet.gomaestro-api.org/v0/esplora
```

**3. Run the Proxy**

```bash theme={null}
cargo run
```

By default, the proxy listens on `http://localhost:8080`.

***

### Updating Your BDK Code

In your BDK initialization, replace the direct Maestro Esplora URL with the proxy’s local address:

```rust theme={null}
let blockchain = EsploraBlockchain::new("http://localhost:8080", 20);
```

Your BDK app now makes requests to the proxy, which automatically appends the `api-key` and forwards requests to Maestro’s Esplora API.

### 🎉 You’re Done!

You now have walked through a guide on how to migrate from [Mempool.space](https://mempool.space) to [Maestro](https://gomaestro.org) as your de-facto on-chain data provider.

### Additional Resources

* **Maestro Documentation**: [https://docs.gomaestro.org/bitcoin/esplora-api/overview](/bitcoin/esplora-api/overview)
* **Mempool.space Documentation**: [https://mempool.space/docs/api/rest](https://mempool.space/docs/api/rest)

Be sure to review Maestro's rate limits and [pricing tiers](https://www.gomaestro.org/pricing) to select the plan that best fits your application's needs.

***

<Warning>
  **Support**

  If you are experiencing any trouble with the above, reach out on <a href="https://discord.gg/ES2rDhBJt3" target="_blank">Discord</a>.
</Warning>
