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#!/bin/sh2# Copyright (c) 2014-present The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or http://www.opensource.org/licenses/mit-license.php.6export LC_ALL=C.UTF-87set -e9SIGNAPPLE=signapple10TEMPDIR=sign.temp12BUNDLE_ROOT=dist13BUNDLE_NAME="Bitcoin-Qt.app"14UNSIGNED_BUNDLE="${BUNDLE_ROOT}/${BUNDLE_NAME}"15UNSIGNED_BINARY="${UNSIGNED_BUNDLE}/Contents/MacOS/Bitcoin-Qt"17ARCH=$(${SIGNAPPLE} info ${UNSIGNED_BINARY} | head -n 1 | cut -d " " -f 1)19OUTDIR="osx/${ARCH}-apple-darwin"20OUTROOT="${TEMPDIR}/${OUTDIR}"22OUT="signature-osx-${ARCH}.tar.gz"24if [ "$#" -ne 3 ]; then25echo "usage: $0 <path to key> <path to app store connect key> <apple developer team uuid>"26exit 127fi29rm -rf ${TEMPDIR}30mkdir -p ${TEMPDIR}32stty -echo33printf "Enter the passphrase for %s: " "$1"34read cs_key_pass35printf "\n"36printf "Enter the passphrase for %s: " "$2"37read api_key_pass38printf "\n"39stty echo41# Sign and notarize app bundle42${SIGNAPPLE} sign -f --hardened-runtime --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${cs_key_pass}" "$1" "${UNSIGNED_BUNDLE}"43${SIGNAPPLE} apply "${UNSIGNED_BUNDLE}" "${OUTROOT}/${BUNDLE_ROOT}/${BUNDLE_NAME}"44${SIGNAPPLE} notarize --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${api_key_pass}" "$2" "$3" "${UNSIGNED_BUNDLE}"46# Sign each binary47find . -maxdepth 3 \( -wholename "*/bin/*" -o -wholename "*/libexec/*" \) -type f -exec realpath --relative-to=. {} \; | while read -r bin48do49bin_dir=$(dirname "${bin}")50bin_name=$(basename "${bin}")51${SIGNAPPLE} sign -f --hardened-runtime --detach "${OUTROOT}/${bin_dir}" --passphrase "${cs_key_pass}" "$1" "${bin}"52${SIGNAPPLE} apply "${bin}" "${OUTROOT}/${bin_dir}/${bin_name}.${ARCH}sign"53done55# Notarize the binaries56# Binaries cannot have stapled notarizations so this does not actually generate any output57binaries_dir=$(dirname "$(find . -maxdepth 2 -wholename '*/bin' -type d -exec realpath --relative-to=. {} \;)")58${SIGNAPPLE} notarize --passphrase "${api_key_pass}" "$2" "$3" "${binaries_dir}"60tar -C "${TEMPDIR}" -czf "${OUT}" "${OUTDIR}"61rm -rf "${TEMPDIR}"62echo "Created ${OUT}"
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.