<!--
{
  "availability" : [

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

# PrecomputedTransactionData

Cached per-transaction data that speeds up repeated script
verification — most importantly, the BIP-341 sighash components a
taproot spend uses (`hashPrevouts`, `hashAmounts`,
`hashScriptPubkeys`, `hashSequences`, `hashOutputs`) that would
otherwise be recomputed for every input.

```
final class PrecomputedTransactionData
```

## Overview

Construct once per transaction, then reuse across every
[`verify(amount:transaction:precomputedData:inputIndex:flags:)`](/documentation/BitcoinKernel/ScriptPubkey/verify(amount:transaction:precomputedData:inputIndex:flags:))
call for that transaction. For non-taproot verification the
`spentOutputs` argument is optional; for taproot it is required.

Wraps the opaque `btck_PrecomputedTransactionData` type; `deinit`
calls `btck_precomputed_transaction_data_destroy` when the last Swift
reference drops.