<!--
{
  "availability" : [

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

# BlockTip

A snapshot identifying a specific block on a chain — paired 32-byte hash,
height, and an optional header timestamp. The canonical “where am I?”
value used by every [`BlockSource`](/documentation/BitcoinKernel/BlockSource) conformer and throughout the
[`BlockchainSync`](/documentation/BitcoinKernel/BlockchainSync) engine.

```
struct BlockTip
```

## Overview

Mirrors Bitcoin Core’s [`interfaces::BlockTip`](https://github.com/bitcoin/bitcoin/blob/master/src/interfaces/node.h)
struct — the same concept surfaced through a Swift value type with
synthesized `Equatable` / `Hashable` conformances.

```swift
let entry = manager.bestEntry
let tip = BlockTip(
    hash: entry.blockHash.data,
    height: Int(entry.height),
    timestamp: Date(timeIntervalSince1970: TimeInterval(entry.blockHeader.timestamp))
)
```

> Important: The 32-byte ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockTip/hash`` is the canonical block identifier.
> ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockTip/height`` alone is not a safe identifier across reorgs — during a
> reorg, two different blocks can share the same height. Prefer
> hash-addressed APIs (``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSource/blockHeader(for:)`` and
> ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSource/block(for:)``) for anything that must survive a reorg.