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/sh3set -eu5default_base_version="$(git describe --match "v*.*.*" --abbrev=0)"6default_new_version="HEAD"8display_help_and_exit() {9echo "Usage: $0 [<base_ver> [<new_ver>]]"10echo ""11echo "Description: This script uses the ABI Compliance Checker tool to determine if the ABI"12echo " of a new version of libsecp256k1 has changed in a backward-incompatible way."13echo ""14echo "Options:"15echo " base_ver Specify the base version as a git commit-ish"16echo " (default: most recent reachable tag matching \"v.*.*\", currently \"$default_base_version\")"17echo " new_ver Specify the new version as a git commit-ish"18echo " (default: $default_new_version)"19echo " -h, --help Display this help message"20exit 021}23if [ "$#" -eq 0 ]; then24base_version="$default_base_version"25new_version="$default_new_version"26elif [ "$#" -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" = "--help" ]; }; then27display_help_and_exit28elif [ "$#" -eq 1 ] || [ "$#" -eq 2 ]; then29base_version="$1"30if [ "$#" -eq 2 ]; then31new_version="$2"32fi33else34echo "Invalid usage. See help:"35echo ""36display_help_and_exit37fi39checkout_and_build() {40_orig_dir="$(pwd)"41git worktree add --detach "$1" "$2"42cd "$1"43mkdir build && cd build44cmake -S .. --preset dev-mode \45-DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=None -DCMAKE_C_FLAGS="-g -Og -gdwarf-4" \46-DSECP256K1_BUILD_BENCHMARK=OFF \47-DSECP256K1_BUILD_TESTS=OFF \48-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF \49-DSECP256K1_BUILD_CTIME_TESTS=OFF \50-DSECP256K1_BUILD_EXAMPLES=OFF51cmake --build . -j "$(nproc)"52abi-dumper lib/libsecp256k1.so -o ABI.dump -lver "$2" -public-headers ../include/53cd "$_orig_dir"54}56echo "Comparing $base_version (base version) to $new_version (new version)"57echo59base_source_dir="$(mktemp -d)"60checkout_and_build "$base_source_dir" "$base_version"62new_source_dir="$(mktemp -d)"63checkout_and_build "$new_source_dir" "$new_version"65abi-compliance-checker -lib libsecp256k1 -old "${base_source_dir}/build/ABI.dump" -new "${new_source_dir}/build/ABI.dump"66git worktree remove "$base_source_dir"67git worktree remove "$new_source_dir"
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.