<!--
{
  "availability" : [

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

# ChainParameters

Chain parameters describing the consensus rules, genesis block, subsidy
schedule, and soft-fork activation heights of a specific Bitcoin network.

```
final class ChainParameters
```

## Overview

Wraps Bitcoin Core’s [`CChainParams`](https://github.com/bitcoin/bitcoin/blob/master/src/kernel/chainparams.h).
Each [`ChainType`](/documentation/BitcoinKernel/ChainType) selects a distinct set of parameters — mainnet’s
consensus differs from regtest’s by activation heights, subsidy halving
interval, and PoW difficulty floor, among many other fields.

Construct once per [`Context`](/documentation/BitcoinKernel/Context); attach via
[`setChainParams(_:)`](/documentation/BitcoinKernel/ContextOptions/setChainParams(_:)). The kernel copies parameters
internally on that call, so this object can be released afterward.

Wraps the opaque `btck_ChainParameters` type; `deinit` calls
`btck_chain_parameters_destroy` when the last Swift reference drops.