<!--
{
  "availability" : [

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

# BlockSpentOutputs

The spent-output (undo) data for every transaction in a block — the
collection of UTXOs that this block’s transactions consumed.

```
final class BlockSpentOutputs
```

## Overview

Spent outputs are what the kernel writes to `rev*.dat` files alongside
`blk*.dat` so it can undo a block during a chain reorganization. Obtain
via [`readBlockSpentOutputs(at:)`](/documentation/BitcoinKernel/ChainstateManager/readBlockSpentOutputs(at:)); genesis blocks
have no undo data and the read returns `nil` there.

The index aligns with the block’s transaction list, except that the
coinbase (always index 0 in the block) contributes no spent outputs.

Wraps the opaque `btck_BlockSpentOutputs` type; `deinit` calls
`btck_block_spent_outputs_destroy` when the last Swift reference drops.