<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/EsploraBlockSource/blockHeader(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel18EsploraBlockSourceV11blockHeader3forAA0dG0C10Foundation4DataV_tYaKF"
  },
  "title" : "blockHeader(for:)"
}
-->

# blockHeader(for:)

The 80-byte header of the block with the given hash, parsed through
[`init(_:)`](/documentation/BitcoinKernel/BlockHeader/init(_:)).

```
func blockHeader(for hash: Data) async throws -> BlockHeader
```

## Parameters

`hash`

32-byte block hash in internal byte order.

## Return Value

A validated [`BlockHeader`](/documentation/BitcoinKernel/BlockHeader) — the kernel will have already
checked structure, though not proof-of-work or timestamp context.

## Discussion> Throws: ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/notFound`` if the hash is unknown to the
> source; ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/invalidResponse(_:)`` if the returned
> bytes don’t decode cleanly.