libbitcoin/libbitcoin-system

Bitcoin Cross-Platform C++ Development Toolkit

C++

1,395

9,576 commits

updated Oct 14, 2026

See the code

README

Continuous Integration Build

Coverage Status

libbitcoin-system

The Bitcoin Development Library

Documentation is available on the wiki.

License Overview

All files in this repository fall under the license specified in COPYING. The project is licensed as AGPL with a lesser clause. It may be used within a proprietary project, but the core library and any changes to it must be published online. Source code for this library must always remain free for everybody to access.

About libbitcoin

The libbitcoin toolkit is a set of cross platform C++ libraries for building Bitcoin applications. The toolkit consists of several libraries, most of which depend on this foundational library. Each library's repository can be cloned and built separately.

The master branch is current, pending the v4 release.

Contents


Requirements

RequirementNotes
C++20 compilerVerified in CI with GCC 13–16, Clang 18–19, Apple Clang and MSVC (Visual Studio 2026)
Boost ≥ 1.86container, json, program_options, url, and unit_test_framework for tests
Autoconf, Automake, Libtool, pkg-configGNU Autotools builds
CMake ≥ 3.30CMake builds
gitUsed by the installation scripts to clone dependencies

On Ubuntu 24.04 LTS:

# For GNU Autotools builds:
sudo apt install build-essential git autoconf automake libtool pkg-config

# Additionally for CMake builds:
sudo apt install cmake

Build from Source

libbitcoin-system ships with three installation scripts, each targeting a different toolchain:

ScriptToolchainBest for
builds/gnu/install-gnu.shGNU Autotools (make)Linux, macOS — traditional
builds/cmake/install-cmake.shCMakeLinux, macOS — flexible
builds/cmake/install-presets.shCMake with PresetsLinux — simplified, named configurations

Each script can download and build its dependencies (Boost and, optionally, a secp256k1 library) before building and installing libbitcoin-system. Unrecognized options are passed through as configuration options to all builds.

GNU Autotools Build

Uses make and Autotools (autoconf, automake, libtool). Well-tested and the reference build for CI.

git clone https://github.com/libbitcoin/libbitcoin-system
cd libbitcoin-system

./builds/gnu/install-gnu.sh \
  --prefix=$HOME/libbitcoin \
  --build-boost \
  --build-config=release \
  --build-link=static \
  --build-post-install-clean

On success the headers and library are installed under $HOME/libbitcoin, along with lib/pkgconfig/libbitcoin-system.pc.

Key options:

OptionValuesDescription
--prefix=<path>absolute pathInstallation destination (default /usr/local)
--build-config=<mode>release, debugBuild configuration
--build-link=<mode>static, dynamicLink mode
--build-boost—Build Boost from source
--build-secp256k1—Build bitcoin-core/secp256k1 from source (with --with-secp256k1)
--build-use-local-src—Reuse already-present source directories instead of cloning from GitHub
--build-skip-tests—Skip test compilation and execution
--build-parallel=<n>integerNumber of parallel compile jobs
--build-post-install-clean—Remove dependency build artifacts after installation

See all options:

./builds/gnu/install-gnu.sh --help

CMake Build

Uses CMake instead of Autotools. Configuration options use CMake's -D syntax.

git clone https://github.com/libbitcoin/libbitcoin-system
cd libbitcoin-system

./builds/cmake/install-cmake.sh \
  --prefix=$HOME/libbitcoin \
  --build-boost \
  --build-config=release \
  --build-link=static \
  --build-post-install-clean

The script options are those of the Autotools script. The configuration options are:

OptionDefaultDescription
-Dwith-tests=<ON/OFF>ONCompile with unit tests
-Dwith-examples=<ON/OFF>ONCompile with examples
-Dwith-secp256k1=<ON/OFF>OFFUse bitcoin-core/secp256k1
-Denable-<extension>=<ON/OFF>OFFSee CPU Extensions

See all options:

./builds/cmake/install-cmake.sh --help

CMake Presets Build

Named presets combine the toolchain, build type and link mode into a single --build-preset parameter. The install prefix and build directory are set relative to the source tree.

PresetConfigLink
nix-gnu-release-staticreleasestatic
nix-gnu-release-sharedreleasedynamic
nix-gnu-debug-staticdebugstatic
nix-gnu-debug-shareddebugdynamic
./builds/cmake/install-presets.sh \
  --build-preset=nix-gnu-release-static \
  --build-boost

See all options:

./builds/cmake/install-presets.sh --help

macOS

The Autotools and CMake scripts work on macOS with Apple Clang. Install the prerequisites with Homebrew:

brew install autoconf automake libtool pkg-config cmake

Then follow the GNU Autotools Build or CMake Build instructions above.

Windows

Visual Studio 2026 (v145 toolset) solution and project files are in builds/msvc/vs2026/. Dependencies are NuGet packages, restored automatically when the solution is built. Only Boost is required; the secp256k1 library is an optional replacement for the internal implementation (see secp256k1):

PackageVersionRequired
libbitcoin-boost (with container, json, program_options, url and unit_test_framework)1.91.0yes
secp256k1_vc1450.8.0no

Build from within Visual Studio, or from a command prompt with builds\msvc\build-msvc.cmd, which restores the NuGet packages and builds with MSBuild. The script runs msbuild and nuget from PATH (a Developer Command Prompt provides msbuild; nuget.exe must be downloaded). To use other executables, set the MSBUILD_EXE and NUGET_EXE environment variables before running it. Packages are restored to .nuget\packages under the source directory unless NUGET_PKG_PATH is set.

The script requires --build-config, set to a solution configuration (StaticRelease or StaticDebug). The platform defaults to x64 unless set with --build-platform (x64, Win32 or ARM64). It also accepts the same --enable-<extension> options as the other scripts.

builds\msvc\build-msvc.cmd --build-config StaticRelease

See builds\msvc\build-msvc.cmd --help for all options.


secp256k1

The secp256k1 elliptic curve implementation is internal, and can be replaced by any library that provides the libsecp256k1 interface. The build supports bitcoin-core/secp256k1:

LibraryGNUCMakeNotes
bitcoin-core/secp256k1--with-secp256k1-Dwith-secp256k1=ONAdd --build-secp256k1 to build it from source

WITH_SECP256K1 replaces only the calls made through the libsecp256k1 interface, so any other implementation of it can be linked in place of bitcoin-core/secp256k1. Batch verification remains internal.


Hardware

libbitcoin can be compiled with optional CPU acceleration for hashing and cryptography. All are disabled by default.

ExtensionFlag (GNU)Flag (CMake)Description
SHA-NI--enable-shani-Denable-shani=ONSHA hardware instructions (Intel/ARM)
SSE4.1--enable-sse41-Denable-sse41=ONSIMD integer ops
AVX2--enable-avx2-Denable-avx2=ON256-bit SIMD
AVX-512--enable-avx512-Denable-avx512=ON512-bit SIMD
AVX-512 IFMA--enable-avx512ifma-Denable-avx512ifma=ON52-bit multiply-add (implies AVX-512 VL)
AVX IFMA--enable-avxifma-Denable-avxifma=ON52-bit multiply-add (implies AVX2)
SHA512--enable-sha512-Denable-sha512=ONIntel SHA512 instructions (implies AVX2)
AES-NI--enable-aesni-Denable-aesni=ONAES and carry-less multiply
VAES--enable-vaes-Denable-vaes=ONVector AES and carry-less multiply (implies AES-NI and AVX2)
ARM Crypto--enable-crypto-Denable-crypto=ONSHA and AES instructions (ARM)
ARM SHA3--enable-sha3-Denable-sha3=ONARM SHA3 instructions for SHA512 (implies Crypto)

Important: These hardware options are not portable. The platform must provide the hardware or the process will terminate.

Example:

./builds/gnu/install-gnu.sh \
  --prefix=$HOME/libbitcoin \
  --build-boost \
  --build-config=release \
  --build-link=static \
  --enable-shani \
  --enable-sse41 \
  --enable-avx2

libbitcoin/libbitcoin-system

Bitcoin Cross-Platform C++ Development Toolkit

C++

1,395

9,576 commits

updated Oct 14, 2026

See the code

README

Continuous Integration Build

Coverage Status

libbitcoin-system

The Bitcoin Development Library

Documentation is available on the wiki.

License Overview

All files in this repository fall under the license specified in COPYING. The project is licensed as AGPL with a lesser clause. It may be used within a proprietary project, but the core library and any changes to it must be published online. Source code for this library must always remain free for everybody to access.

About libbitcoin

The libbitcoin toolkit is a set of cross platform C++ libraries for building Bitcoin applications. The toolkit consists of several libraries, most of which depend on this foundational library. Each library's repository can be cloned and built separately.

The master branch is current, pending the v4 release.

Contents


Requirements

RequirementNotes
C++20 compilerVerified in CI with GCC 13–16, Clang 18–19, Apple Clang and MSVC (Visual Studio 2026)
Boost ≥ 1.86container, json, program_options, url, and unit_test_framework for tests
Autoconf, Automake, Libtool, pkg-configGNU Autotools builds
CMake ≥ 3.30CMake builds
gitUsed by the installation scripts to clone dependencies

On Ubuntu 24.04 LTS:

# For GNU Autotools builds:
sudo apt install build-essential git autoconf automake libtool pkg-config

# Additionally for CMake builds:
sudo apt install cmake

Build from Source

libbitcoin-system ships with three installation scripts, each targeting a different toolchain:

ScriptToolchainBest for
builds/gnu/install-gnu.shGNU Autotools (make)Linux, macOS — traditional
builds/cmake/install-cmake.shCMakeLinux, macOS — flexible
builds/cmake/install-presets.shCMake with PresetsLinux — simplified, named configurations

Each script can download and build its dependencies (Boost and, optionally, a secp256k1 library) before building and installing libbitcoin-system. Unrecognized options are passed through as configuration options to all builds.

GNU Autotools Build

Uses make and Autotools (autoconf, automake, libtool). Well-tested and the reference build for CI.

git clone https://github.com/libbitcoin/libbitcoin-system
cd libbitcoin-system

./builds/gnu/install-gnu.sh \
  --prefix=$HOME/libbitcoin \
  --build-boost \
  --build-config=release \
  --build-link=static \
  --build-post-install-clean

On success the headers and library are installed under $HOME/libbitcoin, along with lib/pkgconfig/libbitcoin-system.pc.

Key options:

OptionValuesDescription
--prefix=<path>absolute pathInstallation destination (default /usr/local)
--build-config=<mode>release, debugBuild configuration
--build-link=<mode>static, dynamicLink mode
--build-boost—Build Boost from source
--build-secp256k1—Build bitcoin-core/secp256k1 from source (with --with-secp256k1)
--build-use-local-src—Reuse already-present source directories instead of cloning from GitHub
--build-skip-tests—Skip test compilation and execution
--build-parallel=<n>integerNumber of parallel compile jobs
--build-post-install-clean—Remove dependency build artifacts after installation

See all options:

./builds/gnu/install-gnu.sh --help

CMake Build

Uses CMake instead of Autotools. Configuration options use CMake's -D syntax.

git clone https://github.com/libbitcoin/libbitcoin-system
cd libbitcoin-system

./builds/cmake/install-cmake.sh \
  --prefix=$HOME/libbitcoin \
  --build-boost \
  --build-config=release \
  --build-link=static \
  --build-post-install-clean

The script options are those of the Autotools script. The configuration options are:

OptionDefaultDescription
-Dwith-tests=<ON/OFF>ONCompile with unit tests
-Dwith-examples=<ON/OFF>ONCompile with examples
-Dwith-secp256k1=<ON/OFF>OFFUse bitcoin-core/secp256k1
-Denable-<extension>=<ON/OFF>OFFSee CPU Extensions

See all options:

./builds/cmake/install-cmake.sh --help

CMake Presets Build

Named presets combine the toolchain, build type and link mode into a single --build-preset parameter. The install prefix and build directory are set relative to the source tree.

PresetConfigLink
nix-gnu-release-staticreleasestatic
nix-gnu-release-sharedreleasedynamic
nix-gnu-debug-staticdebugstatic
nix-gnu-debug-shareddebugdynamic
./builds/cmake/install-presets.sh \
  --build-preset=nix-gnu-release-static \
  --build-boost

See all options:

./builds/cmake/install-presets.sh --help

macOS

The Autotools and CMake scripts work on macOS with Apple Clang. Install the prerequisites with Homebrew:

brew install autoconf automake libtool pkg-config cmake

Then follow the GNU Autotools Build or CMake Build instructions above.

Windows

Visual Studio 2026 (v145 toolset) solution and project files are in builds/msvc/vs2026/. Dependencies are NuGet packages, restored automatically when the solution is built. Only Boost is required; the secp256k1 library is an optional replacement for the internal implementation (see secp256k1):

PackageVersionRequired
libbitcoin-boost (with container, json, program_options, url and unit_test_framework)1.91.0yes
secp256k1_vc1450.8.0no

Build from within Visual Studio, or from a command prompt with builds\msvc\build-msvc.cmd, which restores the NuGet packages and builds with MSBuild. The script runs msbuild and nuget from PATH (a Developer Command Prompt provides msbuild; nuget.exe must be downloaded). To use other executables, set the MSBUILD_EXE and NUGET_EXE environment variables before running it. Packages are restored to .nuget\packages under the source directory unless NUGET_PKG_PATH is set.

The script requires --build-config, set to a solution configuration (StaticRelease or StaticDebug). The platform defaults to x64 unless set with --build-platform (x64, Win32 or ARM64). It also accepts the same --enable-<extension> options as the other scripts.

builds\msvc\build-msvc.cmd --build-config StaticRelease

See builds\msvc\build-msvc.cmd --help for all options.


secp256k1

The secp256k1 elliptic curve implementation is internal, and can be replaced by any library that provides the libsecp256k1 interface. The build supports bitcoin-core/secp256k1:

LibraryGNUCMakeNotes
bitcoin-core/secp256k1--with-secp256k1-Dwith-secp256k1=ONAdd --build-secp256k1 to build it from source

WITH_SECP256K1 replaces only the calls made through the libsecp256k1 interface, so any other implementation of it can be linked in place of bitcoin-core/secp256k1. Batch verification remains internal.


Hardware

libbitcoin can be compiled with optional CPU acceleration for hashing and cryptography. All are disabled by default.

ExtensionFlag (GNU)Flag (CMake)Description
SHA-NI--enable-shani-Denable-shani=ONSHA hardware instructions (Intel/ARM)
SSE4.1--enable-sse41-Denable-sse41=ONSIMD integer ops
AVX2--enable-avx2-Denable-avx2=ON256-bit SIMD
AVX-512--enable-avx512-Denable-avx512=ON512-bit SIMD
AVX-512 IFMA--enable-avx512ifma-Denable-avx512ifma=ON52-bit multiply-add (implies AVX-512 VL)
AVX IFMA--enable-avxifma-Denable-avxifma=ON52-bit multiply-add (implies AVX2)
SHA512--enable-sha512-Denable-sha512=ONIntel SHA512 instructions (implies AVX2)
AES-NI--enable-aesni-Denable-aesni=ONAES and carry-less multiply
VAES--enable-vaes-Denable-vaes=ONVector AES and carry-less multiply (implies AES-NI and AVX2)
ARM Crypto--enable-crypto-Denable-crypto=ONSHA and AES instructions (ARM)
ARM SHA3--enable-sha3-Denable-sha3=ONARM SHA3 instructions for SHA512 (implies Crypto)

Important: These hardware options are not portable. The platform must provide the hardware or the process will terminate.

Example:

./builds/gnu/install-gnu.sh \
  --prefix=$HOME/libbitcoin \
  --build-boost \
  --build-config=release \
  --build-link=static \
  --enable-shani \
  --enable-sse41 \
  --enable-avx2

Project health

Overall

2.4/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

Significant stargazers

Paweł Gronowski

76 followers · starred Sep 2017

rkfg

65 followers · starred Oct 2021

Peter Rekdal Khan-Sunde

228 followers · starred Nov 2016

Jonathan Cross

194 followers · starred Nov 2017