<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/EsploraBlockSource",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel18EsploraBlockSourceV"
  },
  "title" : "EsploraBlockSource"
}
-->

# EsploraBlockSource

A [`BlockSource`](/documentation/BitcoinKernel/BlockSource) backed by any Esplora-compatible HTTP endpoint —
mempool.space, blockstream.info, or a self-hosted Esplora instance.

```
struct EsploraBlockSource
```

## Overview> Important: No endpoint is hard-coded as a default. Callers MUST provide
> one. The library ships convenience accessors for known public instances
> (see `URL.mempoolSpaceSignet` et al.), but the choice of which network
> to trust is an explicit caller decision — ``doc://BitcoinKernel/documentation/BitcoinKernel`` does not
> silently pick a block explorer on behalf of the user.

### Pacing, retry, and rate-limiting

- A per-instance `RequestPacer` actor ensures sequential requests stay
  at least `minimumInterRequestDelay` apart (default: 100 ms).
- Failures with HTTP 5xx or 429 are retried up to `maximumRetries` times
  with exponential backoff (base = `baseRetryDelay`, doubling each time,
  capped at 2^6 × base).
- When the server sends a `Retry-After` header on a 429 or 5xx response,
  the client honors it in preference to the exponential-backoff delay.
- Transient network errors (timeouts, DNS failures, connection drops)
  are retried on the same policy.
- Other non-2xx responses (e.g., 400, 403) fail immediately with
  ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/invalidResponse(_:)``.
- 404 maps immediately to ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/notFound`` without retry.

### Hash orientation

`Data` hashes on this type are in internal (kernel) byte order, matching
the [`BlockSource`](/documentation/BitcoinKernel/BlockSource) contract. Translation to Esplora’s display-hex format
happens inside the implementation at the HTTP boundary.