[#btck]
= btck
:mrdocs:

Type&hyphen;safe C&plus;&plus; RAII wrapper over the libbitcoinkernel C API&period;

== Description

Each type in this namespace owns or views a `btck&lowbar;&ast;` C handle and forwards to the matching `btck&lowbar;&ast;` C function, adding ownership semantics, ranges, and exceptions on top of the plain C interface declared in `kernel&sol;bitcoinkernel&period;h`&period;

== Types

[cols="1,4"]
|===
| Name| Description
| xref:btck/Block.adoc[`Block`] 
| Owning wrapper over a `btck&lowbar;Block`, a full block with its transactions&period;
| xref:btck/BlockHash.adoc[`BlockHash`] 
| Owning wrapper over a `btck&lowbar;BlockHash`&period;
| xref:btck/BlockHashApi-00.adoc[`BlockHashApi`] 
| CRTP mixin adding block&hyphen;hash operations shared by the view and owning types&period;
| xref:btck/BlockHashView.adoc[`BlockHashView`] 
| Non&hyphen;owning view over a `btck&lowbar;BlockHash`&period;
| xref:btck/BlockHeader.adoc[`BlockHeader`] 
| Owning wrapper over a `btck&lowbar;BlockHeader`&period;
| xref:btck/BlockHeaderApi-03.adoc[`BlockHeaderApi`] 
| CRTP mixin adding block&hyphen;header accessors shared by the view and owning types&period;
| xref:btck/BlockHeaderView.adoc[`BlockHeaderView`] 
| Non&hyphen;owning view over a `btck&lowbar;BlockHeader`&period;
| xref:btck/BlockSpentOutputs.adoc[`BlockSpentOutputs`] 
| Owning wrapper over a `btck&lowbar;BlockSpentOutputs`, the undo data of a whole block&period;
| xref:btck/BlockTreeEntry.adoc[`BlockTreeEntry`] 
| Non&hyphen;owning view over a `btck&lowbar;BlockTreeEntry`, a node in the block index tree&period;
| xref:btck/BlockValidationState.adoc[`BlockValidationState`] 
| Owning wrapper over a `btck&lowbar;BlockValidationState`, holding a block&apos;s validation outcome&period;
| xref:btck/BlockValidationStateApi-0c.adoc[`BlockValidationStateApi`] 
| CRTP mixin adding block&hyphen;validation&hyphen;state accessors shared by the view and owning types&period;
| xref:btck/BlockValidationStateView.adoc[`BlockValidationStateView`] 
| Non&hyphen;owning view over a `btck&lowbar;BlockValidationState`&period;
| xref:btck/ChainMan.adoc[`ChainMan`] 
| Owning wrapper over a `btck&lowbar;ChainstateManager`, the entry point for block processing&period;
| xref:btck/ChainParams.adoc[`ChainParams`] 
| Owning wrapper over `btck&lowbar;ChainParameters`, the consensus parameters for a network&period;
| xref:btck/ChainView.adoc[`ChainView`] 
| Non&hyphen;owning view over a `btck&lowbar;Chain`, a sequence of block tree entries by height&period;
| xref:btck/ChainstateManagerOptions.adoc[`ChainstateManagerOptions`] 
| Owning wrapper over `btck&lowbar;ChainstateManagerOptions`, configuring a ChainMan&period;
| xref:btck/Coin.adoc[`Coin`] 
| Owning wrapper over a `btck&lowbar;Coin`&period;
| xref:btck/CoinApi-06.adoc[`CoinApi`] 
| CRTP mixin adding coin accessors shared by the view and owning types&period;
| xref:btck/CoinView.adoc[`CoinView`] 
| Non&hyphen;owning view over a `btck&lowbar;Coin`, an unspent transaction output entry&period;
| xref:btck/ConsensusParamsView.adoc[`ConsensusParamsView`] 
| Non&hyphen;owning view over `btck&lowbar;ConsensusParams`, the consensus parameters of a chain&period;
| xref:btck/Context.adoc[`Context`] 
| Owning wrapper over a `btck&lowbar;Context`, the top&hyphen;level kernel execution context&period;
| xref:btck/ContextOptions.adoc[`ContextOptions`] 
| Owning wrapper over `btck&lowbar;ContextOptions`, configuring a Context before creation&period;
| xref:btck/Handle-046.adoc[`Handle`] 
| Owning RAII handle for a copyable C object of type `CType&period;`
| xref:btck/Iterator.adoc[`Iterator`] 
| Random&hyphen;access iterator that lazily materializes views of a collection by index&period;
| xref:btck/KernelNotifications.adoc[`KernelNotifications`] 
| Base class for receiving kernel notifications&semi; override the handlers you need&period;
| xref:btck/Logger.adoc[`Logger`] 
| Connects a user log sink of type `T` to the kernel logging system&period;
| xref:btck/OutPoint.adoc[`OutPoint`] 
| Owning wrapper over a `btck&lowbar;TransactionOutPoint`&period;
| xref:btck/OutPointApi-0b.adoc[`OutPointApi`] 
| CRTP mixin adding out&hyphen;point accessors shared by the view and owning types&period;
| xref:btck/OutPointView.adoc[`OutPointView`] 
| Non&hyphen;owning view over a `btck&lowbar;TransactionOutPoint`&period;
| xref:btck/PrecomputedTransactionData.adoc[`PrecomputedTransactionData`] 
| Owning wrapper over `btck&lowbar;PrecomputedTransactionData` used to cache signature hashes&period;
| xref:btck/Range-01.adoc[`Range`] 
| Read&hyphen;only random&hyphen;access view over an indexed C&hyphen;handle collection&period;
| xref:btck/Range-0b.adoc[`Range`] 
| Read&hyphen;only random&hyphen;access view over an indexed C&hyphen;handle collection&period;
| xref:btck/ScriptPubkey.adoc[`ScriptPubkey`] 
| Owning wrapper over a `btck&lowbar;ScriptPubkey` output script&period;
| xref:btck/ScriptPubkeyApi-02.adoc[`ScriptPubkeyApi`] 
| CRTP mixin adding script&hyphen;pubkey operations shared by the view and owning types&period;
| xref:btck/ScriptPubkeyView.adoc[`ScriptPubkeyView`] 
| Non&hyphen;owning view over a `btck&lowbar;ScriptPubkey`&period;
| xref:btck/Transaction.adoc[`Transaction`] 
| Owning wrapper over a `btck&lowbar;Transaction`&period;
| xref:btck/TransactionApi-08.adoc[`TransactionApi`] 
| CRTP mixin adding transaction accessors shared by the view and owning types&period;
| xref:btck/TransactionInput.adoc[`TransactionInput`] 
| Owning wrapper over a `btck&lowbar;TransactionInput`&period;
| xref:btck/TransactionInputApi-0b.adoc[`TransactionInputApi`] 
| CRTP mixin adding transaction&hyphen;input accessors shared by the view and owning types&period;
| xref:btck/TransactionInputView.adoc[`TransactionInputView`] 
| Non&hyphen;owning view over a `btck&lowbar;TransactionInput`&period;
| xref:btck/TransactionOutput.adoc[`TransactionOutput`] 
| Owning wrapper over a `btck&lowbar;TransactionOutput`&period;
| xref:btck/TransactionOutputApi-04.adoc[`TransactionOutputApi`] 
| CRTP mixin adding transaction&hyphen;output accessors shared by the view and owning types&period;
| xref:btck/TransactionOutputView.adoc[`TransactionOutputView`] 
| Non&hyphen;owning view over a `btck&lowbar;TransactionOutput`&period;
| xref:btck/TransactionSpentOutputs.adoc[`TransactionSpentOutputs`] 
| Owning wrapper over a `btck&lowbar;TransactionSpentOutputs`, the coins spent by one transaction&period;
| xref:btck/TransactionSpentOutputsApi-0d.adoc[`TransactionSpentOutputsApi`] 
| CRTP mixin adding accessors over the coins spent by one transaction&period;
| xref:btck/TransactionSpentOutputsView.adoc[`TransactionSpentOutputsView`] 
| Non&hyphen;owning view over a `btck&lowbar;TransactionSpentOutputs`&period;
| xref:btck/TransactionView.adoc[`TransactionView`] 
| Non&hyphen;owning view over a `btck&lowbar;Transaction`&period;
| xref:btck/TxValidationState.adoc[`TxValidationState`] 
| Owning wrapper over a `btck&lowbar;TxValidationState`, holding a transaction&apos;s validation outcome&period;
| xref:btck/Txid.adoc[`Txid`] 
| Owning wrapper over a `btck&lowbar;Txid` transaction identifier&period;
| xref:btck/TxidApi-020.adoc[`TxidApi`] 
| CRTP mixin adding transaction&hyphen;id operations shared by the view and owning types&period;
| xref:btck/TxidView.adoc[`TxidView`] 
| Non&hyphen;owning view over a `btck&lowbar;Txid`&period;
| xref:btck/UniqueHandle-0da.adoc[`UniqueHandle`] 
| Owning RAII handle for a non&hyphen;copyable C object, backed by std&colon;&colon;unique&lowbar;ptr&period;
| xref:btck/ValidationInterface.adoc[`ValidationInterface`] 
| Base class for receiving validation events&semi; override the handlers you need&period;
| xref:btck/View-041.adoc[`View`] 
| Non&hyphen;owning view over a const C handle of type `CType&period;`
| xref:btck/WitnessStack.adoc[`WitnessStack`] 
| Owning wrapper over a `btck&lowbar;WitnessStack`&period;
| xref:btck/WitnessStackApi-04.adoc[`WitnessStackApi`] 
| CRTP mixin adding witness&hyphen;stack accessors shared by the view and owning types&period;
| xref:btck/WitnessStackView.adoc[`WitnessStackView`] 
| Non&hyphen;owning view over a `btck&lowbar;WitnessStack`&period;
| xref:btck/is_bitmask_enum-04.adoc[`is&lowbar;bitmask&lowbar;enum`] 
| Trait marking an enum as a bitmask&semi; specialize to `std&colon;&colon;true&lowbar;type` to opt in&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:btck/BlockCheckFlags.adoc[`BlockCheckFlags`] 
| Selects which block checks to run, mirroring `btck&lowbar;BlockCheckFlags`&semi; combinable as a bitmask&period;
| xref:btck/BlockValidationResult.adoc[`BlockValidationResult`] 
| Reason a block failed validation, mirroring `btck&lowbar;BlockValidationResult`&period;
| xref:btck/ChainType.adoc[`ChainType`] 
| Bitcoin network the chain parameters describe, mirroring `btck&lowbar;ChainType`&period;
| xref:btck/LogCategory.adoc[`LogCategory`] 
| Logging category, mirroring `btck&lowbar;LogCategory`&period;
| xref:btck/LogLevel.adoc[`LogLevel`] 
| Logging verbosity level, mirroring `btck&lowbar;LogLevel`&period;
| xref:btck/ScriptVerificationFlags.adoc[`ScriptVerificationFlags`] 
| Script verification flags, mirroring `btck&lowbar;ScriptVerificationFlags`&semi; combinable as a bitmask&period;
| xref:btck/ScriptVerifyStatus.adoc[`ScriptVerifyStatus`] 
| Status of a script verification call, mirroring `btck&lowbar;ScriptVerifyStatus`&period;
| xref:btck/SynchronizationState.adoc[`SynchronizationState`] 
| Stage of block synchronization, mirroring `btck&lowbar;SynchronizationState`&period;
| xref:btck/TxValidationResult.adoc[`TxValidationResult`] 
| Reason a transaction failed validation, mirroring `btck&lowbar;TxValidationResult`&period;
| xref:btck/ValidationMode.adoc[`ValidationMode`] 
| Outcome of a validation operation, mirroring `btck&lowbar;ValidationMode`&period;
| xref:btck/Warning.adoc[`Warning`] 
| Kernel warning condition, mirroring `btck&lowbar;Warning`&period;
|===


== Functions

[cols="1,4"]
|===
| Name| Description
| xref:btck/CheckTransaction.adoc[`CheckTransaction`] 
| Runs consensus&hyphen;level checks on a standalone transaction&period;
| xref:btck/check.adoc[`check`] 
| Throws if a freshly returned C handle is null, otherwise passes it through&period;
| xref:btck/logging_disable.adoc[`logging&lowbar;disable`] 
| Disables all kernel logging&period;
| xref:btck/logging_disable_category.adoc[`logging&lowbar;disable&lowbar;category`] 
| Disables logging for a category&period;
| xref:btck/logging_enable_category.adoc[`logging&lowbar;enable&lowbar;category`] 
| Enables logging for a category&period;
| xref:btck/logging_set_level_category.adoc[`logging&lowbar;set&lowbar;level&lowbar;category`] 
| Sets the log level for a single category&period;
| xref:btck/logging_set_options.adoc[`logging&lowbar;set&lowbar;options`] 
| Applies global logging options&period;
| xref:btck/operator_bitand.adoc[`operator&amp;`] 
| Bitwise AND of two bitmask&hyphen;enum values&period;
| xref:btck/operator_and_eq.adoc[`operator&amp;&equals;`] 
| Bitwise AND&hyphen;assign for a bitmask&hyphen;enum value&period;
| xref:btck/operator_plus.adoc[`operator&plus;`] 
| Returns an iterator advanced by `n` positions (offset on the left)&period;
| xref:btck/operator_xor.adoc[`operator&circ;`] 
| Bitwise XOR of two bitmask&hyphen;enum values&period;
| xref:btck/operator_xor_eq.adoc[`operator&circ;&equals;`] 
| Bitwise XOR&hyphen;assign for a bitmask&hyphen;enum value&period;
| xref:btck/operator_bitor.adoc[`operator&verbar;`] 
| Bitwise OR of two bitmask&hyphen;enum values&period;
| xref:btck/operator_or_eq.adoc[`operator&verbar;&equals;`] 
| Bitwise OR&hyphen;assign for a bitmask&hyphen;enum value&period;
| xref:btck/operator_bitnot.adoc[`operator&#126;`] 
| Bitwise complement of a bitmask&hyphen;enum value&period;
| xref:btck/set_mock_time.adoc[`set&lowbar;mock&lowbar;time`] 
| Overrides the kernel&apos;s notion of the current time, for testing&period;
| xref:btck/write_bytes.adoc[`write&lowbar;bytes`] 
| Serializes a C object into a byte vector using its `to&lowbar;bytes` callback&period;
|===


== Concepts

[cols="1,4"]
|===
| Name| Description
| xref:btck/BitmaskEnum.adoc[`BitmaskEnum`] 
| Satisfied by enums opted into bitmask operators via is&lowbar;bitmask&lowbar;enum&period;
| xref:btck/IndexedContainer.adoc[`IndexedContainer`] 
| Satisfied when a container exposes a size accessor and an indexed element accessor&period;
| xref:btck/Log.adoc[`Log`] 
| Satisfied by a type exposing `LogMessage(std&colon;&colon;string&lowbar;view)` returning void&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
