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#!/usr/bin/env bash2# Copyright (c) The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or https://opensource.org/license/mit.5export LC_ALL=C.UTF-86set -o errexit -o pipefail8(9cd "$DISTSRC"11# Perform basic security checks on installed executables.12echo "Checking binary security on installed executables..."13python3 "${DISTSRC}/contrib/guix/security-check.py" "${INSTALLPATH}/bin/"* "${INSTALLPATH}/libexec/"*14# Check that executables only contain allowed version symbols.15echo "Running symbol and dynamic library checks on installed executables..."16python3 "${DISTSRC}/contrib/guix/symbol-check.py" "${INSTALLPATH}/bin/"* "${INSTALLPATH}/libexec/"*18(19cd installed21case "$HOST" in22*darwin*) ;;23*)24# Split binaries from their debug symbols25{26find "${DISTNAME}/bin" "${DISTNAME}/libexec" -type f -executable -print027} | xargs -0 -P"$JOBS" -I{} "${DISTSRC}/build/split-debug.sh" {} {} {}.dbg28;;29esac31case "$HOST" in32*mingw*)33cp "${DISTSRC}/doc/README_windows.txt" "${DISTNAME}/readme.txt"34;;35*linux*)36cp "${DISTSRC}/README.md" "${DISTNAME}/"37cp "${DISTSRC}/doc/INSTALL_linux.md" "${DISTNAME}/INSTALL.md"38;;39esac41# copy over the example bitcoin.conf file. if contrib/devtools/gen-bitcoin-conf.sh42# has not been run before building, this file will be a stub43cp "${DISTSRC}/share/examples/bitcoin.conf" "${DISTNAME}/"45cp -r "${DISTSRC}/share/rpcauth" "${DISTNAME}/share/"47# Deterministically produce {non-,}debug binary tarballs ready48# for release49case "$HOST" in50*mingw*)51find "${DISTNAME}" -not -name "*.dbg" -print0 \52| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"53find "${DISTNAME}" -not -name "*.dbg" \54| sort \55| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" \56|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" && exit 1 )57find "${DISTNAME}" -name "*.dbg" -print0 \58| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"59find "${DISTNAME}" -name "*.dbg" \60| sort \61| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-debug.zip" \62|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-debug.zip" && exit 1 )63;;64*linux*)65find "${DISTNAME}" -not -name "*.dbg" -print0 \66| sort --zero-terminated \67| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \68| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \69|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 )70find "${DISTNAME}" -name "*.dbg" -print0 \71| sort --zero-terminated \72| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \73| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-debug.tar.gz" \74|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-debug.tar.gz" && exit 1 )75;;76*darwin*)77find "${DISTNAME}" -print0 \78| sort --zero-terminated \79| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \80| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \81|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 )82;;83esac84) # $DISTSRC/installed86# Finally make tarballs for codesigning87case "$HOST" in88*mingw*)89# Make the installer90cmake -D BIN_DIR="${INSTALLPATH}/bin" -D LIBEXEC_DIR="${INSTALLPATH}/libexec" -P build/GenerateWindowsInstaller.cmake91mv build/bitcoin-win64-setup.exe "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"93cp -rf --target-directory=. contrib/windeploy94(95cd ./windeploy96mkdir -p unsigned97cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"98cp -r --target-directory=unsigned/ "${INSTALLPATH}"99find unsigned/ -name "*.dbg" -print0 \100| xargs -0r rm101find . -print0 \102| sort --zero-terminated \103| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \104| gzip -9n > "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" \105|| ( rm -f "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" && exit 1 )106)107;;108*darwin*)109cmake --build build --target deploy110mv build/dist/bitcoin-macos-app.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"111mkdir -p "unsigned-app-${HOST}"112cp --target-directory="unsigned-app-${HOST}" \113contrib/macdeploy/detached-sig-create.sh114mv --target-directory="unsigned-app-${HOST}" build/dist115cp -r --target-directory="unsigned-app-${HOST}" "${INSTALLPATH}"116(117cd "unsigned-app-${HOST}"118find . -print0 \119| sort --zero-terminated \120| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \121| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" \122|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" && exit 1 )123)124;;125esac127) # $DISTSRC129rm -rf "$ACTUAL_OUTDIR"130mv --no-target-directory "$OUTDIR" "$ACTUAL_OUTDIR" \131|| ( rm -rf "$ACTUAL_OUTDIR" && exit 1 )133(134tmp="$(mktemp)"135cd /outdir-base136{137echo "$GIT_ARCHIVE"138find "$ACTUAL_OUTDIR" -type f139} | xargs realpath --relative-base="$PWD" \140| xargs sha256sum \141| sort -k2 \142> "$tmp";143mv "$tmp" "$ACTUAL_OUTDIR"/SHA256SUMS.part144)
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.