<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/BlockSource/blockHash(atHeight:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel11BlockSourceP9blockHash8atHeight10Foundation4DataVSi_tYaKF"
  },
  "title" : "blockHash(atHeight:)"
}
-->

# blockHash(atHeight:)

The hash of the block at the given height, in internal byte order.

```
func blockHash(atHeight height: Int) async throws -> Data
```

## Parameters

`height`

Height above genesis (0 = genesis).

## Return Value

32 bytes of hash data in internal (kernel) byte order.

## Discussion> Throws: ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/notFound`` if the source has no block at
> that height, or a transport-level ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError`` otherwise.

> Warning: Returns whichever block the source currently thinks is at
> that height. During a reorg, the answer can change. The sync engine
> uses this method exactly once per run — at the fork-point check on
> resume — and walks by hash everywhere else. Don’t use it for chain
> identity in application code either.