<!--
{
  "availability" : [

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

# Coin

A UTXO — an unspent transaction output enriched with the metadata the
kernel needs to validate a spending transaction.

```
final class Coin
```

## Overview

A `Coin` carries the [`TransactionOutput`](/documentation/BitcoinKernel/TransactionOutput) (amount + scriptPubKey) plus
two consensus-relevant metadata fields: the block height at which the
creating transaction was confirmed, and whether that transaction was a
coinbase (which gates the 100-block maturity rule).

Wraps the opaque `btck_Coin` type; `deinit` calls `btck_coin_destroy`
when the last Swift reference drops.