Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Copyright (c) 2024-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or http://www.opensource.org/licenses/mit-license.php.5@0xc77d03df6a41b505;7using Cxx = import "/capnp/c++.capnp";8$Cxx.namespace("ipc::capnp::messages");10using Common = import "common.capnp";11using Proxy = import "/mp/proxy.capnp";12$Proxy.include("interfaces/mining.h");13$Proxy.includeTypes("ipc/capnp/mining-types.h");15const maxMoney :Int64 = 2100000000000000;16const maxDouble :Float64 = 1.7976931348623157e308;17const defaultBlockReservedWeight :UInt32 = 8000;18const defaultCoinbaseOutputMaxAdditionalSigops :UInt32 = 400;20interface Mining $Proxy.wrap("interfaces::Mining") {21isTestChain @0 (context :Proxy.Context) -> (result: Bool);22isInitialBlockDownload @1 (context :Proxy.Context) -> (result: Bool);23getTip @2 (context :Proxy.Context) -> (result: Common.BlockRef, hasResult: Bool);24waitTipChanged @3 (context :Proxy.Context, currentTip: Data, timeout: Float64 = .maxDouble) -> (result: Common.BlockRef);25createNewBlock @4 (context :Proxy.Context, options: BlockCreateOptions, cooldown: Bool = true) -> (result: BlockTemplate);26checkBlock @5 (context :Proxy.Context, block: Data, options: BlockCheckOptions) -> (reason: Text, debug: Text, result: Bool);27interrupt @6 () -> ();28submitBlock @7 (context :Proxy.Context, block: Data) -> (reason: Text, debug: Text, result: Bool);29getTransactionsByTxID @8 (context :Proxy.Context, txids: List(Data)) -> (result: List(Data));30getTransactionsByWitnessID @9 (context :Proxy.Context, wtxids: List(Data)) -> (result: List(Data));31}33interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") {34destroy @0 (context :Proxy.Context) -> ();35getBlockHeader @1 (context: Proxy.Context) -> (result: Data);36getBlock @2 (context: Proxy.Context) -> (result: Data);37getTxFees @3 (context: Proxy.Context) -> (result: List(Int64));38getTxSigops @4 (context: Proxy.Context) -> (result: List(Int64));39getCoinbaseTx @5 (context: Proxy.Context) -> (result: CoinbaseTx);40getCoinbaseMerklePath @6 (context: Proxy.Context) -> (result: List(Data));41submitSolution @10 (context: Proxy.Context, version: UInt32, timestamp: UInt32, nonce: UInt32, coinbase :Data) -> (reason: Text, debug: Text, result: Bool);42waitNext @8 (context: Proxy.Context, options: BlockWaitOptions) -> (result: BlockTemplate);43interruptWait @9() -> ();45# DEPRECATED: older version of submitSolution which returns an error.46submitSolutionOld7 @7 (context: Proxy.Context, version: UInt32, timestamp: UInt32, nonce: UInt32, coinbase :Data) -> (result: Bool);47}49struct BlockCreateOptions $Proxy.wrap("node::BlockCreateOptions") {50useMempool @0 :Bool = true $Proxy.name("use_mempool");51blockReservedWeight @1 :UInt64 = .defaultBlockReservedWeight $Proxy.name("block_reserved_weight");52coinbaseOutputMaxAdditionalSigops @2 :UInt64 = .defaultCoinbaseOutputMaxAdditionalSigops $Proxy.name("coinbase_output_max_additional_sigops");53}55struct BlockWaitOptions $Proxy.wrap("node::BlockWaitOptions") {56timeout @0 : Float64 = .maxDouble $Proxy.name("timeout");57feeThreshold @1 : Int64 = .maxMoney $Proxy.name("fee_threshold");58}60struct BlockCheckOptions $Proxy.wrap("node::BlockCheckOptions") {61checkMerkleRoot @0 :Bool = true $Proxy.name("check_merkle_root");62checkPow @1 :Bool = true $Proxy.name("check_pow");63}65struct CoinbaseTx $Proxy.wrap("node::CoinbaseTx") {66version @0 :UInt32 $Proxy.name("version");67sequence @1 :UInt32 $Proxy.name("sequence");68scriptSigPrefix @2 :Data $Proxy.name("script_sig_prefix");69witness @3 :Data $Proxy.name("witness");70blockRewardRemaining @4 :Int64 $Proxy.name("block_reward_remaining");71requiredOutputs @5 :List(Data) $Proxy.name("required_outputs");72lockTime @6 :UInt32 $Proxy.name("lock_time");73}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.