### Bootstrap Bitcoin Kernel in SwiftUI App Source: https://docs.21.dev/data/documentation/bitcoinkernel/embeddingonios Initializes the Bitcoin Kernel's Context and ChainstateManager within the SwiftUI App initializer. This setup is crucial for making kernel services available throughout the application. Ensure proper error handling for production environments. ```swift import BitcoinKernel import SwiftUI @main struct BitcoinApp: App { let manager: ChainstateManager init() { do { let dataDirectory = try KernelStorage.dataDirectory() let blocksDirectory = dataDirectory.appendingPathComponent("blocks", isDirectory: true) try FileManager.default.createDirectory( at: blocksDirectory, withIntermediateDirectories: true ) let params = ChainParameters(.signet) let options = ContextOptions() options.setChainParams(params) let context = try Context(options: options) let managerOptions = try ChainstateManagerOptions( context: context, dataDirectory: dataDirectory.path, blocksDirectory: blocksDirectory.path ) self.manager = try ChainstateManager(options: managerOptions) } catch { fatalError("BitcoinKernel bootstrap failed: \(error)") } } var body: some Scene { WindowGroup { ContentView(manager: manager) } } } ``` -------------------------------- ### Initialize BitcoinKernel Context Source: https://docs.21.dev/data/documentation/bitcoinkernel Demonstrates how to initialize the BitcoinKernel context with specific chain parameters and options. This is a fundamental step before performing any validation operations. ```swift import BitcoinKernel let params = ChainParameters(.regtest) let options = ContextOptions() options.setChainParams(params) let context = try Context(options: options) ``` -------------------------------- ### BitcoinConfig Methods Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt A fluent builder for constructing Bitcoin Core CLI arguments. ```APIDOC ## BitcoinConfig ### Description Fluent CLI argument builder for Bitcoin Core. ### Methods - `testnet()` - `prune(_:)` - `validate()` ``` -------------------------------- ### Boot Bitcoin Kernel Consensus Engine Source: https://docs.21.dev/data/documentation/bitcoinkernel/gettingstarted Constructs the necessary objects to boot a regtest consensus engine and verifies the chain tip height. This code is compile-checked on every build. ```swift // Boot Bitcoin Core's consensus-validation engine into a fresh regtest data // directory and confirm the chainstate has loaded by reading the tip height. import BitcoinKernel import Foundation // Pick a network. Regtest is the empty, no-internet chain — instant boot at genesis. let params = ChainParameters(.regtest) let options = ContextOptions() options.setChainParams(params) let context = try Context(options: options) // Throwaway data directory inside the system temp dir. let dataDirectory = FileManager.default.temporaryDirectory .appendingPathComponent(UUID().uuidString) .path(percentEncoded: false) let managerOptions = try ChainstateManagerOptions( context: context, dataDirectory: dataDirectory ) let manager = try ChainstateManager(options: managerOptions) print(manager.bestEntry.height) // 0 on a fresh regtest directory ``` -------------------------------- ### BTCAmount Initializers Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt Represents a Bitcoin amount with satoshi storage and BTC-decimal coding. ```APIDOC ## BTCAmount ### Description Bitcoin amount with satoshi storage and BTC-decimal coding. ### Initializers - `init(btc:)` ### Operators Arithmetic operators are supported. ``` -------------------------------- ### Daemon Methods Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt Manages the lifecycle of an embedded `bitcoind` instance. ```APIDOC ## Daemon ### Description Manages the lifecycle of an embedded `bitcoind` instance. ### Methods - `bootstrap(cookiefile:port:timeout:)` - `bootstrap(url:username:password:timeout:)` - `start(with:)` ``` -------------------------------- ### ContextOptions Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Configuration options for the Context, allowing setting chain parameters, notifications, and validation interfaces. ```APIDOC ## ContextOptions ### Description Context configuration. Allows setting chain parameters, notifications, and validation interfaces. ### Methods - `setChainParams(_:)` - `setNotifications(_:)` - `setValidationInterface(_:)` ``` -------------------------------- ### Cross-compile Bitcoin Kernel for iOS via xcodebuild Source: https://docs.21.dev/data/documentation/bitcoinkernel/embeddingonios Builds the Bitcoin Kernel package for iOS from the command line using xcodebuild. This is useful for verifying the iOS configuration outside of Xcode and mirrors the CI build process. ```sh xcrun xcodebuild \ build \ -scheme BitcoinKernel-Package \ -destination 'generic/platform=iOS' ``` -------------------------------- ### ScriptPubkey Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/scriptpubkey This snippet shows the declaration of the ScriptPubkey class within the Bitcoin Kernel framework. ```swift final class ScriptPubkey ``` -------------------------------- ### Declare ContextOptions Class Source: https://docs.21.dev/data/documentation/bitcoinkernel/contextoptions This snippet shows the declaration of the final class ContextOptions within the BitcoinKernel framework. ```swift final class ContextOptions ``` -------------------------------- ### ScriptPubkey Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents an output locking script. ```APIDOC ## ScriptPubkey ### Description Represents an output locking script. ``` -------------------------------- ### RPCClient Methods Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt Provides methods to interact with the Bitcoin Core JSON-RPC interface. These methods allow sending various types of RPC calls and retrieving results. ```APIDOC ## RPCClient ### Description Interact with the Bitcoin Core JSON-RPC interface. ### Methods - `call(_:params:)` - `send(_:params:)` - `sendVoid(_:params:)` - `sendNullable(_:params:)` - `submitBlock(hexdata:)` - `scantxoutset(descriptors:)` ``` -------------------------------- ### Configure Kernel Data Directory Source: https://docs.21.dev/data/documentation/bitcoinkernel/embeddingonios Sets up a directory for BitcoinKernel data within the app's Application Support directory, excluding it from iCloud backup. This ensures data persistence and respects iOS sandboxing rules. ```swift import Foundation enum KernelStorage { static func dataDirectory() throws -> URL { let supportURL = try FileManager.default.url( for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true ) var url = supportURL.appendingPathComponent("bitcoin-kernel", isDirectory: true) try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true) var resourceValues = URLResourceValues() resourceValues.isExcludedFromBackup = true try url.setResourceValues(resourceValues) return url } } ``` -------------------------------- ### Add BitcoinKernel Dependency Source: https://docs.21.dev/data/documentation/bitcoinkernel/embeddingonios Add the BitcoinKernel package to your project's dependencies in Package.swift. Pin to the 'main' branch for pre-1.0 versions, and consider using '.upToNextMajor(from:)' for stable releases. ```swift // Package.swift dependencies: [ .package( url: "https://github.com/21-DOT-DEV/swift-bitcoinkernel.git", branch: "main" ), ], targets: [ .target( name: "MyBitcoinApp", dependencies: [ .product(name: "BitcoinKernel", package: "swift-bitcoinkernel"), ] ), ] ``` -------------------------------- ### Context Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt The root object for every validation operation, representing the kernel runtime context. Allows initialization with options and interruption of operations. ```APIDOC ## Context ### Description Kernel runtime context; the root object for every validation operation. Allows initialization with options and interruption of operations. ### Initializers - `init(options:)` ### Methods - `interrupt()` ``` -------------------------------- ### ChainParameters Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Defines consensus rules, genesis block, subsidy schedule, and soft-fork activation heights for different Bitcoin networks. ```APIDOC ## ChainParameters ### Description Defines consensus rules, genesis block, subsidy schedule, and soft-fork activation heights for mainnet/testnet/signet/regtest. ``` -------------------------------- ### Warning Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt An enumeration of warnings that can be issued by the kernel. ```APIDOC ## Warning ### Description Enumeration of kernel warnings. ``` -------------------------------- ### EsploraBlockSource Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt A block source implementation that uses any Esplora-compatible HTTP endpoint. ```APIDOC ## EsploraBlockSource ### Description Block source backed by any Esplora-compatible HTTP endpoint. ### Methods - `bestTip()` - `block(for:)` - `blockHash(atHeight:)` - `blockHeader(for:)` ``` -------------------------------- ### ChainstateManagerOptions Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Configuration options for the ChainstateManager, allowing customization of worker threads and database wiping. ```APIDOC ## ChainstateManagerOptions ### Description ChainstateManager configuration. Allows setting worker threads and wiping specific databases. ### Initializers - `init(context:datadirectory:blocksdirectory:)` ### Methods - `setWorkerThreads(_:)` - `setWipeDBs(blocktreedb:chainstatedb:)` ``` -------------------------------- ### Declare LoggingConnection Class Source: https://docs.21.dev/data/documentation/bitcoinkernel/loggingconnection Declares the final class LoggingConnection, which is the entry point for interacting with the kernel's logging system. ```swift final class LoggingConnection ``` -------------------------------- ### SynchronizationState Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents the progress states of chain synchronization. ```APIDOC ## SynchronizationState ### Description Represents the states of chain synchronization progress. ``` -------------------------------- ### TransactionOutput Class Source: https://docs.21.dev/data/documentation/bitcoinkernel/transactionoutput Represents a transaction output, including the amount and the script public key. It wraps the opaque btck_TransactionOutput type. ```APIDOC ## Class TransactionOutput ### Description A transaction output — the paid amount (in satoshis) plus the ScriptPubkey that locks it. ### Swift Class Signature ```swift final class TransactionOutput ``` ### Initialization - `init(scriptPubkey:amount:)` - Fabricate an output (e.g., for script verification tests). ### Accessing Outputs from a Transaction - `Transaction.output(at:)` - Obtain an output from an existing transaction. ### Internal Representation Wraps the opaque `btck_TransactionOutput` type. `deinit` calls `btck_transaction_output_destroy` when the last Swift reference drops. ``` -------------------------------- ### Define SynchronizationState Enumeration Source: https://docs.21.dev/data/documentation/bitcoinkernel/synchronizationstate Defines the SynchronizationState enumeration used internally by the Bitcoin kernel to represent its current synchronization phase. This is passed to blockTip and headerTip callbacks. ```swift enum SynchronizationState ``` -------------------------------- ### Add BitcoinKernel with Swift Package Manager Source: https://docs.21.dev/data/documentation/bitcoinkernel/gettingstarted Add the BitcoinKernel package to your Swift project using Swift Package Manager. It is recommended to track the 'main' branch for pre-1.0 versions. ```swift // Package.swift dependencies: [ .package( url: "https://github.com/21-DOT-DEV/swift-bitcoinkernel.git", branch: "main" ), ], targets: [ .target( name: "MyBitcoinApp", dependencies: [ .product(name: "BitcoinKernel", package: "swift-bitcoinkernel"), ] ) ] ``` -------------------------------- ### TransactionSpentOutputs Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Provides a per-transaction lookup of spent outputs. ```APIDOC ## TransactionSpentOutputs ### Description Provides a per-transaction lookup of spent-output information. ``` -------------------------------- ### BlockHeader Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents the 80-byte header of a Bitcoin block, containing proof-of-work commitment fields. ```APIDOC ## BlockHeader ### Description Represents the 80-byte block header, containing proof-of-work commitment fields. ``` -------------------------------- ### NotificationCallbacks Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Defines callbacks for block and chain events. ```APIDOC ## NotificationCallbacks ### Description Defines callbacks for block- and chain-event notifications. ``` -------------------------------- ### DirectTransport Method Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt An HTTP-auth JSON-RPC transport. ```APIDOC ## DirectTransport ### Description HTTP-auth JSON-RPC transport. ### Method - `send(_:path:)` ``` -------------------------------- ### LoggingConnection Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt A connection that subscribes to the kernel's internal logging stream. ```APIDOC ## LoggingConnection ### Description Represents a subscription to the kernel's internal logging stream. ``` -------------------------------- ### TransactionSpentOutputs Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/transactionspentoutputs This snippet shows the declaration of the TransactionSpentOutputs class in Swift. It is part of the BitcoinKernel framework. ```swift final class TransactionSpentOutputs ``` -------------------------------- ### LogLevel Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Defines the severity level for logs. ```APIDOC ## LogLevel ### Description Represents a log severity level. ``` -------------------------------- ### Coin Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents a UTXO (Unspent Transaction Output) entry, including its value, scriptPubkey, height, and coinbase flag. ```APIDOC ## Coin ### Description Represents a UTXO entry, including output value, scriptPubkey, height, and coinbase flag. ``` -------------------------------- ### ScriptVerificationFlags Structure Source: https://docs.21.dev/data/documentation/bitcoinkernel/scriptverificationflags Defines the structure for script verification flags in Bitcoin Kernel. ```swift struct ScriptVerificationFlags ``` -------------------------------- ### LogCategory Enumeration Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/logcategory Defines the enumeration for log categories within the Bitcoin Kernel. Use this to specify which log messages to filter. ```swift enum LogCategory ``` -------------------------------- ### LogLevel Enumeration Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/loglevel Defines the LogLevel enumeration used in BitcoinKernel. This enumeration specifies the minimum severity at which a LogCategory will emit messages. ```swift enum LogLevel ``` -------------------------------- ### Define NotificationCallbacks Class Source: https://docs.21.dev/data/documentation/bitcoinkernel/notificationcallbacks This Swift code defines the `NotificationCallbacks` class, which serves as a wrapper for kernel notification callbacks. It is intended to be used with the Bitcoin Kernel framework. ```swift final class NotificationCallbacks ``` -------------------------------- ### Block Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents a Bitcoin block, consisting of an 80-byte header and transactions. Structurally validated on construction. ```APIDOC ## Block ### Description Represents a Bitcoin block, including an 80-byte header and transactions. It is structurally validated upon construction. ``` -------------------------------- ### JSONRPCService Method Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt The underlying service for handling JSON-RPC requests. ```APIDOC ## JSONRPCService ### Description Underlying JSON-RPC service. ### Method - `send(_:params:)` ``` -------------------------------- ### EsploraBlockSource Structure Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/esplorablocksource Defines the EsploraBlockSource structure, which acts as a BlockSource backed by an Esplora-compatible HTTP endpoint. Callers must provide a specific endpoint. ```swift struct EsploraBlockSource ``` -------------------------------- ### ScriptVerificationFlags Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Defines BIP-governed consensus flags that control script verification. ```APIDOC ## ScriptVerificationFlags ### Description Consensus flags, governed by BIPs, that control script verification. ``` -------------------------------- ### Block Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/block Declares the final Block class within the BitcoinKernel framework. ```swift final class Block ``` -------------------------------- ### BitcoinKernel Warning Enumeration Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/warning This snippet shows the declaration of the `Warning` enumeration in the BitcoinKernel framework. It is used to define various warning states. ```swift enum Warning ``` -------------------------------- ### TransactionOutput Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents a single output of a Bitcoin transaction, specifying the value and scriptPubkey. ```APIDOC ## TransactionOutput ### Description Represents a single transaction output, including value and scriptPubkey. ``` -------------------------------- ### TransactionInput Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/transactioninput Declares the final class TransactionInput within the BitcoinKernel framework. ```swift final class TransactionInput ``` -------------------------------- ### TransactionOutpoint Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt A reference to a prior transaction output, identified by its transaction ID and output index (vout). ```APIDOC ## TransactionOutpoint ### Description Represents a reference to a prior transaction output, consisting of a txid and vout. ``` -------------------------------- ### Chain Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/chain Declares the final class Chain within the BitcoinKernel framework. ```swift final class Chain ``` -------------------------------- ### Block Class Source: https://docs.21.dev/data/documentation/bitcoinkernel/block Represents a Bitcoin block, consisting of a BlockHeader and a list of Transactions. It is structurally validated upon construction. ```APIDOC ## Block Class ### Description A Bitcoin block, composed of an 80-byte `BlockHeader` and a list of `Transaction` values. The kernel validates its structure upon construction. ### Usage Construct from consensus-serialized bytes (network or disk format) using `init(_:)`. The kernel parses and sanity-checks the structure, producing an opaque handle. Downstream consensus validation is performed via `processBlock(_:)`. ### Internal Structure Wraps the opaque `btck_Block` type. The `deinit` method calls `btck_block_destroy` when the last Swift reference is released. ``` -------------------------------- ### Chain Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Provides a view of the active chain, allowing retrieval of chain entries by height. ```APIDOC ## Chain ### Description Represents the active chain view. Allows retrieval of chain entries by height. ### Methods - `entry(atHeight:)` ``` -------------------------------- ### Chain Class Overview Source: https://docs.21.dev/data/documentation/bitcoinkernel/chain Provides a view of the active blockchain, enabling height-indexed lookups and active-chain membership testing. It is a view type tied to the ChainstateManager. ```APIDOC ## Chain A view of the active blockchain — the unbroken sequence of blocks from genesis to the chainstate’s current tip. ```swift final class Chain ``` ### Overview Obtained via [`activeChain`](/documentation/BitcoinKernel/ChainstateManager/activeChain). Exposes height-indexed lookups ([`entry(atHeight:)`](/documentation/BitcoinKernel/Chain/entry(atHeight:))) and active-chain membership testing ([`contains(_:)`](/documentation/BitcoinKernel/Chain/contains(_:))) — useful for distinguishing a block that’s on the current chain from one on a side chain, after a reorg. A **view type**: its lifetime is tied to the [`ChainstateManager`](/documentation/BitcoinKernel/ChainstateManager) that produced it. Retains the manager to keep the C pointer valid; `deinit` performs no kernel destruction. ``` -------------------------------- ### ChainstateManagerOptions Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/chainstatemanageroptions This is the declaration of the ChainstateManagerOptions class. It is used as a builder for constructing a ChainstateManager. ```swift final class ChainstateManagerOptions ``` -------------------------------- ### TransactionOutput Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/transactionoutput This snippet shows the declaration of the TransactionOutput class in Swift. It is a final class within the BitcoinKernel framework. ```swift final class TransactionOutput ``` -------------------------------- ### Coin Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/coin Declares the final Coin class within the BitcoinKernel framework. This class represents a UTXO. ```swift final class Coin ``` -------------------------------- ### LogCategory Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Defines filters for log categories. ```APIDOC ## LogCategory ### Description Represents a log category filter. ``` -------------------------------- ### Txid Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/txid This snippet shows the declaration of the Txid class within the BitcoinKernel framework. It is a final class, meaning it cannot be subclassed. ```swift final class Txid ``` -------------------------------- ### BlockHeader Class Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/blockheader Defines the BlockHeader class within the BitcoinKernel framework. This class encapsulates the structure of a Bitcoin block header. ```swift final class BlockHeader ``` -------------------------------- ### TransactionInput Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents a single input of a Bitcoin transaction, detailing the outpoint, scriptSig, witness, and sequence. ```APIDOC ## TransactionInput ### Description Represents a single transaction input, including outpoint, scriptSig, witness, and sequence. ``` -------------------------------- ### ChainType Enumeration Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/chaintype Defines the enumeration for different Bitcoin network types used to configure context and chain parameters. ```swift enum ChainType ``` -------------------------------- ### PrecomputedTransactionData Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Stores cached transaction hashes for efficient repeated script verification. ```APIDOC ## PrecomputedTransactionData ### Description Stores cached transaction hashes for repeated script verification. ``` -------------------------------- ### Define Transaction Class Source: https://docs.21.dev/data/documentation/bitcoinkernel/transaction Declares the final class 'Transaction' within the BitcoinKernel framework. ```swift final class Transaction ``` -------------------------------- ### ChainType Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt An enumeration representing Bitcoin chain identifiers. ```APIDOC ## ChainType ### Description Bitcoin chain identifier. ### Cases - `mainnet` - `testnet` - `testnet4` - `signet` - `regtest` ``` -------------------------------- ### Bitcoin Kernel Context Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/context Declares the Context class within the Bitcoin Kernel framework. This class is the root runtime object for all validation operations. ```swift final class Context ``` -------------------------------- ### TransactionOutPoint Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/transactionoutpoint This Swift code declares the final class TransactionOutPoint within the BitcoinKernel framework. It wraps an opaque C type for transaction outpoint references. ```swift final class TransactionOutPoint ``` -------------------------------- ### ScriptVerifyStatus Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt An enumeration indicating the outcome of script verification. ```APIDOC ## ScriptVerifyStatus ### Description Enumeration of script verification results. ``` -------------------------------- ### ChainParameters Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/chainparameters Declares the final class ChainParameters. This class encapsulates network-specific consensus rules for Bitcoin networks. ```swift final class ChainParameters ``` -------------------------------- ### Transaction Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents a Bitcoin transaction, including its transaction ID, inputs, outputs, and witness data. ```APIDOC ## Transaction ### Description Represents a Bitcoin transaction, including txid, inputs, outputs, and witness data. ``` -------------------------------- ### ValidationInterfaceCallbacks Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Defines callbacks for per-block validation events. ```APIDOC ## ValidationInterfaceCallbacks ### Description Defines callbacks for per-block validation events. ``` -------------------------------- ### ChainstateManager Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Validates blocks, maintains the block index and UTXO set, and exposes the active chain. Provides methods for processing and reading block data. ```APIDOC ## ChainstateManager ### Description Validates blocks, maintains the block index and UTXO set, and exposes the active chain. Provides methods for processing and reading block data. ### Methods - `processBlock(_:)` - `processBlockHeader(_:state:)` - `importBlocks(from:)` - `readBlock(at:)` - `readBlockSpentOutputs(at:)` - `blockTreeEntry(byHash:)` - `bestEntry` - `activeChain` ``` -------------------------------- ### ScriptVerifyStatus Enumeration Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/scriptverifystatus Defines the ScriptVerifyStatus enumeration used in Bitcoin Kernel for script verification results. This enum distinguishes between script execution failures and usage errors. ```swift enum ScriptVerifyStatus ``` -------------------------------- ### ValidationMode Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Specifies the block validation strictness, either full or header-only. ```APIDOC ## ValidationMode ### Description Specifies block validation strictness, supporting full or header-only modes. ``` -------------------------------- ### Define Bitcoin Kernel ValidationMode Enumeration Source: https://docs.21.dev/data/documentation/bitcoinkernel/validationmode Defines the ValidationMode enumeration used in the Bitcoin Kernel to represent block validation outcomes. ```swift enum ValidationMode ``` -------------------------------- ### ChainstateManager Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/chainstatemanager Declares the ChainstateManager class within the BitcoinKernel framework. This class is central to managing the blockchain's state. ```swift final class ChainstateManager ``` -------------------------------- ### CookieTransport Method Source: https://docs.21.dev/data/documentation/bitcoin/llms.txt A JSON-RPC transport that uses cookie-based authentication. ```APIDOC ## CookieTransport ### Description Cookie-auth JSON-RPC transport. ### Method - `send(_:path:)` ``` -------------------------------- ### TxID Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Represents a Transaction ID, which is a 32-byte hash. ```APIDOC ## TxID ### Description Represents a Transaction ID, a 32-byte hash. ``` -------------------------------- ### KernelError Enumeration Definition Source: https://docs.21.dev/data/documentation/bitcoinkernel/kernelerror Defines the KernelError enumeration used to indicate failures in the Bitcoin kernel C API. ```C++ enum KernelError ``` -------------------------------- ### BlockValidationResult Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt An enumeration defining the possible outcomes of block validation. ```APIDOC ## BlockValidationResult ### Description Enumeration of block validation outcomes. ``` -------------------------------- ### BlockValidationState Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/blockvalidationstate This Swift code declares the BlockValidationState class. It is used to hold the validation status of a block after processing by the Bitcoin Kernel. ```swift final class BlockValidationState ``` -------------------------------- ### BlockValidationResult Enumeration Source: https://docs.21.dev/data/documentation/bitcoinkernel/blockvalidationresult Defines the possible results of block validation, mapping to C API constants. ```swift enum BlockValidationResult ``` -------------------------------- ### PrecomputedTransactionData Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/precomputedtransactiondata Declares the final class PrecomputedTransactionData. This class is designed to cache transaction data for performance improvements during script verification. ```swift final class PrecomputedTransactionData ``` -------------------------------- ### BlockValidationState Source: https://docs.21.dev/data/documentation/bitcoinkernel/llms.txt Holds the result of a block validation operation, including error reasons and the validation mode. ```APIDOC ## BlockValidationState ### Description Represents the result of block validation, including error reasons and the validation mode. ``` -------------------------------- ### ValidationInterfaceCallbacks Class Declaration Source: https://docs.21.dev/data/documentation/bitcoinkernel/validationinterfacecallbacks Declares the final class ValidationInterfaceCallbacks. This class is used to wrap validation interface callbacks for Swift compatibility. ```swift final class ValidationInterfaceCallbacks ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.