Inside Bitcoin
Opening the selected file…
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) 2023-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5include(AddWindowsResources)7configure_file(${PROJECT_SOURCE_DIR}/cmake/bitcoin-build-config.h.in bitcoin-build-config.h USE_SOURCE_PERMISSIONS @ONLY)8include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})10#=============================11# Subprojects12#=============================13# Subprojects include subdirectories that do or could have tests14# and/or benchmark binaries, such as all subtrees and univalue.15# These need to be included before CMAKE_*_OUTPUT_DIRECTORY variables16# are set, so output locations of subproject tests and libraries are17# not overridden.18include(../cmake/crc32c.cmake)19include(../cmake/leveldb.cmake)20include(../cmake/minisketch.cmake)21add_subdirectory(univalue)22if (ENABLE_IPC AND NOT WITH_EXTERNAL_LIBMULTIPROCESS)23include(../cmake/libmultiprocess.cmake)24add_libmultiprocess(ipc/libmultiprocess)25endif()26include(../cmake/secp256k1.cmake)27add_secp256k1(secp256k1)29# Set top-level target output locations.30if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)31set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)32endif()33if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)34set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)35endif()36if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)37set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)38endif()40set(IS_SOURCE_TARBALL FALSE)41# git will expand the next line to "set(IS_SOURCE_TARBALL TRUE)" inside archives:42#43set(IS_SOURCE_TARBALL TRUE)44if(NOT IS_SOURCE_TARBALL AND PROJECT_IS_TOP_LEVEL)45find_package(Git QUIET)46endif()47add_custom_target(generate_build_info48BYPRODUCTS ${PROJECT_BINARY_DIR}/src/bitcoin-build-info.h49COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DBUILD_INFO_HEADER_PATH=${PROJECT_BINARY_DIR}/src/bitcoin-build-info.h -DSOURCE_DIR=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateBuildInfo.cmake50COMMENT "Generating bitcoin-build-info.h"51VERBATIM52)53add_library(bitcoin_clientversion STATIC54clientversion.cpp55)56target_link_libraries(bitcoin_clientversion57PRIVATE58core_interface59)60add_dependencies(bitcoin_clientversion generate_build_info)62add_subdirectory(crypto)63add_subdirectory(util)64if(ENABLE_IPC)65add_subdirectory(ipc)66else()67add_library(bitcoin_ipc STATIC EXCLUDE_FROM_ALL ipc/stub.cpp)68endif()70add_library(bitcoin_consensus STATIC EXCLUDE_FROM_ALL71arith_uint256.cpp72consensus/merkle.cpp73consensus/tx_check.cpp74hash.cpp75primitives/block.cpp76primitives/transaction.cpp77pubkey.cpp78script/interpreter.cpp79script/script.cpp80script/script_error.cpp81uint256.cpp82)83target_link_libraries(bitcoin_consensus84PRIVATE85core_interface86bitcoin_crypto87secp256k188)90if(WITH_ZMQ)91add_subdirectory(zmq)92endif()94# Home for common functionality shared by different executables and libraries.95# Similar to `bitcoin_util` library, but higher-level.96add_library(bitcoin_common STATIC EXCLUDE_FROM_ALL97addresstype.cpp98base58.cpp99bech32.cpp100chain.cpp101chainparams.cpp102chainparamsbase.cpp103coins.cpp104common/args.cpp105common/bloom.cpp106common/config.cpp107common/init.cpp108common/interfaces.cpp109common/license_info.cpp110common/messages.cpp111common/netif.cpp112common/pcp.cpp113common/run_command.cpp114common/settings.cpp115common/signmessage.cpp116common/system.cpp117common/url.cpp118compressor.cpp119core_io.cpp120deploymentinfo.cpp121external_signer.cpp122init/common.cpp123kernel/chainparams.cpp124key.cpp125key_io.cpp126merkleblock.cpp127musig.cpp128net_permissions.cpp129net_types.cpp130netaddress.cpp131netbase.cpp132outputtype.cpp133policy/feerate.cpp134policy/policy.cpp135pow.cpp136protocol.cpp137psbt.cpp138rpc/rawtransaction_util.cpp139rpc/request.cpp140rpc/util.cpp141scheduler.cpp142script/descriptor.cpp143script/miniscript.cpp144script/parsing.cpp145script/sign.cpp146script/signingprovider.cpp147script/solver.cpp148)149target_link_libraries(bitcoin_common150PRIVATE151core_interface152bitcoin_consensus153bitcoin_util154univalue155secp256k1156$<TARGET_NAME_IF_EXISTS:USDT::headers>157$<$<PLATFORM_ID:Windows>:ws2_32>158)160include(InstallBinaryComponent)162if(ENABLE_WALLET)163add_subdirectory(wallet)165if(BUILD_WALLET_TOOL)166add_executable(bitcoin-wallet167bitcoin-wallet.cpp168bitcoin-wallet-res.rc169init/bitcoin-wallet.cpp170wallet/wallettool.cpp171)172add_windows_application_manifest(bitcoin-wallet)173target_link_libraries(bitcoin-wallet174core_interface175bitcoin_wallet176bitcoin_common177bitcoin_util178)179install_binary_component(bitcoin-wallet HAS_MANPAGE)180endif()181endif()184# P2P and RPC server functionality used by `bitcoind` and `bitcoin-qt` executables.185add_library(bitcoin_node STATIC EXCLUDE_FROM_ALL186addrdb.cpp187addrman.cpp188banman.cpp189bip324.cpp190blockencodings.cpp191blockfilter.cpp192consensus/tx_verify.cpp193dbwrapper.cpp194deploymentstatus.cpp195flatfile.cpp196headerssync.cpp197httprpc.cpp198httpserver.cpp199i2p.cpp200index/base.cpp201index/blockfilterindex.cpp202index/coinstatsindex.cpp203index/txindex.cpp204index/txospenderindex.cpp205init.cpp206kernel/chain.cpp207kernel/checks.cpp208kernel/coinstats.cpp209kernel/context.cpp210kernel/cs_main.cpp211kernel/disconnected_transactions.cpp212kernel/mempool_removal_reason.cpp213mapport.cpp214net.cpp215net_processing.cpp216netgroup.cpp217node/abort.cpp218node/blockmanager_args.cpp219node/blockstorage.cpp220node/caches.cpp221node/chainstate.cpp222node/chainstatemanager_args.cpp223node/coin.cpp224node/coins_view_args.cpp225node/connection_types.cpp226node/context.cpp227node/database_args.cpp228node/eviction.cpp229node/interface_ui.cpp230node/interfaces.cpp231node/kernel_notifications.cpp232node/mempool_args.cpp233node/mempool_persist.cpp234node/mempool_persist_args.cpp235node/miner.cpp236node/mining_args.cpp237node/mini_miner.cpp238node/minisketchwrapper.cpp239node/peerman_args.cpp240node/psbt.cpp241node/timeoffsets.cpp242node/transaction.cpp243node/txdownloadman_impl.cpp244node/txorphanage.cpp245node/txreconciliation.cpp246node/utxo_snapshot.cpp247node/warnings.cpp248noui.cpp249policy/ephemeral_policy.cpp250policy/fees/block_policy_estimator.cpp
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.