You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,19 @@
14
14
</div>
15
15
16
16
## tl;dr
17
-
This is the **server component of libbitcoin v4**. It integrates the basic components and offers a **high performance Bitcoin full node** with a comprehensive set of client-server interfaces like **bitcoind, electrum and stratum** as well as an intergrated **block explorer**. It makes heavy use of the available hardware, internet connection and availabe RAM and CPU so you can sync the Bitcoin blockchain from genesis, today and in the future.
17
+
This is the **server component of libbitcoin v4**. It integrates the basic components and offers a **high performance Bitcoin full node** with a comprehensive set of client-server interfaces like **bitcoind, electrum and stratum** as well as an intergrated **block explorer**. It makes full use of the available hardware, internet connection and availabe RAM and CPU so you can sync the Bitcoin blockchain from genesis, today and in the future.
18
18
19
19
If you follow this README you will be able to build, run and monitor your own libbitcoin server (bs). Libbitcoin is a multi platform software that works on Linux, Windows and OSX (Intel and ARM).
20
20
21
21
Now, If you want to see how fast your setup can sync the Bitcoin Blockchain, read on and get your libbitcoin server running today. It's pretty easy actually.
22
22
23
23
**License Overview**
24
24
25
-
All files in this repository fall under the license specified in [COPYING](COPYING). The project is licensed as [AGPL with a lesser clause](https://wiki.unsystem.net/en/index.php/Libbitcoin/License). 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.
25
+
All files in this repository fall under the license specified in [COPYING](COPYING). The project is licensed under the [GNU Affero General Public License v3.0](https://www.gnu.org/licenses/agpl-3.0.en.html). 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.
26
26
27
27
**About libbitcoin**
28
28
29
-
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 the foundational [libbitcoin-system](https://github.com/libbitcoin/libbitcoin-system) library. Each library's repository can be cloned and built separately. There are no packages yet in distribution, however each library includes an installation script (described below) which is regularly verified via [github actions](https://github.com/features/actions).
29
+
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 the foundational [libbitcoin-system](https://github.com/libbitcoin/libbitcoin-system) library. Each library's repository can be cloned and built separately. There are no packages yet in distribution, however each library includes an installation script (described below) which is regularly verified via [GitHub Actions](https://github.com/features/actions).
30
30
31
31
## Contents
32
32
-[libbitcoin-server](#libbitcoin-server)
@@ -48,15 +48,15 @@ The libbitcoin toolkit is a set of cross platform C++ libraries for building Bit
48
48
-[Kernel VM Tuning Parameters](#kernel-vm-tuning-parameters)
49
49
50
50
## Installation
51
-
Depending on what operating system you use, the build process will be different. Detailed instructions are provided below.
51
+
The build process is essentially the same on Linux, macOS, and other Unix-like systems. It differs significantly on Windows due to the use of native Visual Studio projects and solutions. Detailed instructions are provided below.
52
52
53
53
-[Linux (Ubuntu)](#linux)
54
54
-[macOS](#macos)
55
55
-[Windows](#windows)
56
56
57
57
### Linux
58
58
59
-
Linux users build libbitcoin node with the provided installation script `install.sh` that uses Autotools and pkg-config to first build the needed dependencies (boost, libpsec256) and then fetches the latest libbitcoin projects (libbitcoin-system, libbitcoin-database, libbitcoin-network, libbitcoin-node) from github and builds the stack bottom up to the libbitcoin-server executable - `bs`.
59
+
Linux users can build libbitcoin node with the provided installation script `install.sh` that uses Autotools and pkg-config to first build the needed dependencies (boost, libpsec256) and then fetches the latest libbitcoin projects (libbitcoin-system, libbitcoin-database, libbitcoin-network, libbitcoin-node and libbitcoin-server) from GitHub and builds the stack bottom up to the libbitcoin-server executable - `bs`.
60
60
61
61
You can issue the following command to check for further parameterization of the install script:
Create a new directory (e.g. `/home/user/libbitcoin`), then use git to fetch the latest repository from github by issuing the following command from within this directory:
114
+
Create a new directory (e.g. `/home/user/libbitcoin`), then use git to fetch the latest repository from GitHub by issuing the following command from within this directory:
Now enter the bin directory and [fire up](#running-libbitcoin) your libbitcoin server.
145
+
Now enter the bin directory and [fire up](#running-bs) your libbitcoin server.
146
146
147
147
#### CPU Extensions
148
148
CPU Extensions are specific optimizations your CPU might or might not have. libbitcoin(-server) can be built with support for the following CPU extensions if your architecture supports them:
@@ -155,14 +155,14 @@ CPU Extensions are specific optimizations your CPU might or might not have. libb
155
155
To build libbitcoin-server with these extensions use the `--enable-feature` parameters like:
156
156
157
157
- --enable-shani
158
-
- --enable-avx2
159
158
- --enable-sse41
159
+
- --enable-avx2
160
160
- --enable-avx512
161
161
162
162
This command will create a static release build with all supported CPU extensions (if supported by the system). Building libbitcoin with unsupported CPU extensions might work but will lead to crashes at runtime.
Copy file name to clipboardExpand all lines: docs/theory-of-operation.md
+14-22Lines changed: 14 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Architecture Overview
4
4
5
-
Libbitcoin is a full-stack C++ development framework for Bitcoin. It includes everything from basic hash functions (in libbitcoin-system) up to a high performance full node (libbitcoin-node) and a comprehensive client-server connection layer on top (libbitcoin-server)
5
+
Libbitcoin is a full-stack C++ development toolkit for Bitcoin. It includes everything from basic hash functions (in libbitcoin-system) up to a high performance full node (libbitcoin-node) and a comprehensive client-server connection layer on top (libbitcoin-server)
6
6
7
7
## Components
8
8
@@ -32,15 +32,13 @@ TBD
32
32
libbitcoin-node distinguishes between two different methods for the initial block download (IBD).
33
33
34
34
### Milestone Sync
35
-
Milestone Sync (the default mode) is optimized for speed. Up to a configured milestone (a specific block in the past considered trustworthy), certain expensive validation steps are skipped.
35
+
Milestone Sync (the default mode) is optimized for speed. If the user has previously fully validated the chain up to the configured milestone hash, expensive block validation steps below that height are skipped on subsequent synchronizations.
36
36
37
-
Specifically: Blocks at or below the highest checkpoint/milestone are not fully validated. This primarily means that signature verifications (script validation) in old blocks are skipped or performed in a reduced manner.
37
+
Specifically: For blocks at or below the milestone height, all validation except identity checks (block hash, Merkle root, and witness commitment) is skipped. Block headers are always fully validated. Unlike Bitcoin Core's AssumeValid (which skips only signature verification), Libbitcoin skips nearly all block-level checks below the milestone.
38
38
39
-
Other checks (e.g. Proof-of-Work, basic block rules) are still performed, but resource-intensive operations like full ECDSA verifications are avoided.
39
+
Starting from the milestone (and for all new blocks), full validation is applied. There are no trust assumptions — milestone optimization is secure only because the user has previously validated to that point themselves. If the user has not previously validated the chain, they should perform a full validation sync from genesis and record a new milestone for future use.
40
40
41
-
Starting from the milestone (and for all new blocks), full validation is applied. As the chain height progresses, the current milestone is updated upward every 50,000 blocks. The most recent milestone is currently block 900,000.
42
-
43
-
This approach aligns with the security model of Bitcoin Core's "AssumeValid." It assumes the chain up to that point is correct (based on prior validation or community consensus). This makes the IBD significantly faster while providing practically the same level of security for most users.
41
+
There is only one level of security: full independent validation. Milestone Sync provides the same security as full validation for users who have previously validated the chain themselves, while significantly accelerating subsequent synchronizations.
44
42
45
43
The following diagram shows the runtime behaviour of `bs` in milestone sync mode on a 256GB RAM, 64 Cores computer running Ubuntu:
46
44
@@ -55,13 +53,9 @@ The following diagram shows the runtime behaviour of `bs` in milestone sync mode
55
53
As the CPU load is significantly lower compared to a full validation sync, one can see clearly how the network performace is the bottleneck. In other words, the faster the network, the faster the sync - until the bottleneck moves to validation power again.
56
54
57
55
### Full Validation Sync
58
-
In full validation mode, the entire blockchain is fully validated from the genesis block onward, without any optimizations or shortcuts. This means every block is checked against all consensus rules: Proof-of-Work, block header validity, Merkle root, timestamp rules, etc.
59
-
60
-
Every transaction in every block is fully validated, including complete script and signature verification (ECDSA signatures for all inputs).
61
-
62
-
There are no trust assumptions for historical blocks—everything is independently verified.
56
+
In full validation mode, the entire blockchain is fully validated from the genesis block onward, without any optimizations or shortcuts. Every block and transaction is checked against all consensus rules, including complete script and signature verification.
63
57
64
-
This is the mode with the highest security, as no part of the chain is assumed to be "pre-validated." However, it is slower and more CPU-intensive.
58
+
There are never any trust assumptions — everything is independently verified. This is recommended for the initial synchronization or whenever the user has not previously validated the chain themselves. Once complete, a milestone can be recorded for faster future synchronizations while maintaining the same single level of security.
65
59
66
60
The following diagram shows the runtime behaviour of `bs` in full validation sync mode on a 256GB RAM, 64 Cores computer running Ubuntu (same system as above):
67
61
@@ -73,24 +67,22 @@ The following diagram shows the runtime behaviour of `bs` in full validation syn
73
67
74
68
</div>
75
69
76
-
## Checkpoints and Milestone
77
-
**Checkpoints** are a list of fixed block hashes at specific heights (e.g., genesis plus others). They primarily protect against reorganization attacks. The node rejects any alternative chain that violates a checkpoint, enforcing acceptance of the canonical chain up to those points.
70
+
## Checkpoints and Milestones
78
71
79
-
The **milestone**is a special (highest) checkpoint that additionally controls validation optimization: Up to this block, full validation is skipped.
72
+
**Checkpoints**are fixed block hashes at specific heights that represent activated consensus rules (soft forks). They are required consensus points: the node rejects any chain that violates a checkpoint, enforcing the canonical chain up to those heights.
80
73
81
-
In the default configuration, there are multiple checkpoints and one milestone at a relatively recent height (currently block 900,000).
74
+
**Milestones** are distinct from checkpoints. A milestone is an optional optimization point (not a consensus requirement) that allows skipping full block validation below its height — but only if the user has previously validated the chain to that milestone hash themselves.
82
75
83
-
To perform a full validation sync, set both values in the [config](configuration.md#) file to the genesis block (hash: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, height 0):
76
+
In the default configuration, multiple checkpoints are defined (as consensus rules), along with one milestone at a relatively recent height (currently block 900,000).
77
+
78
+
To perform a full validation sync (disabling milestone optimization while preserving consensus checkpoints), set only the milestone value in the configuration file to the genesis block::
This disables all optimizations. Everything is fully validated.
92
-
93
-
Checkpoints and milestones rely on trust in the developers/community (they are hardcoded or configurable), but they don't prevent real attacks on old blocks—they only accelerate syncing. For maximum sovereignty, Full Validation is recommended. For everyday use, Milestone Sync is usually sufficient.
85
+
Checkpoints are consensus rules and should not be disabled. Milestones introduce no trust assumptions — they rely solely on the user's prior independent validation. For maximum sovereignty on first use or after potential compromise, perform a full validation sync from genesis. For subsequent synchronizations or everyday use (after initial full validation), Milestone Sync provides the same security with significantly faster performance.
94
86
95
87
## Linux Dirty Page Writeback Tuning Notes
96
88
While standard Ubuntu installations adhere to the upstream Linux kernel defaults (`vm.dirty_bytes=0` and `vm.dirty_background_bytes=0`), enabling percentage-based control via `vm.dirty_ratio=20` and `vm.dirty_background_ratio=10`, some Ubuntu-based derivatives (e.g., Pop!_OS, Kubuntu) override these in their default sysctl configuration with fixed byte thresholds (commonly `vm.dirty_bytes=268435456` or similar values around 256 MiB).
0 commit comments