<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/BlockTip/init(hash:height:timestamp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel8BlockTipV4hash6height9timestampAC10Foundation4DataV_SiAG4DateVSgtcfc"
  },
  "title" : "init(hash:height:timestamp:)"
}
-->

# init(hash:height:timestamp:)

Creates a [`BlockTip`](/documentation/BitcoinKernel/BlockTip).

```
init(hash: Data, height: Int, timestamp: Date? = nil)
```

## Parameters

`hash`

Exactly 32 bytes in internal (kernel) byte order. Passing
display-order hex bytes here will make the tip compare unequal to
every kernel-produced tip.

`height`

The block’s height above genesis (≥ 0).

`timestamp`

The block’s header timestamp, or `nil` when unknown.

## Discussion> Precondition: `hash.count == 32`. Wrong-length hashes crash rather
> than silently truncate — this is a programmer error, not a runtime
> condition callers can recover from.

```swift
BlockTip(hash: Data(repeating: 0, count: 32), height: 0)   // genesis placeholder
```