
On August 6, 2024, the cybersecurity researcher known as Forensicxs published “Bitcoin Core v0.1: a code walkthrough” — a comprehensive analysis of Satoshi Nakamoto’s original Bitcoin source code released on January 8, 2009.
Scope: Forensicxs analyzed the Bitcoin v0.1 codebase as 31,794 lines across 31 files, written in C++ and released under the MIT X11 license.
Note that this archive’s own source-code analysis treats the v0.1 C++/header line count from the local primary source as approximately 19,901 lines, growing to 31,909 lines by v0.3.19. The 31,794 figure is therefore Forensicxs’s count for that article and not this archive’s reference value (the difference reflects which files / blank lines / comments / wxWidgets headers each count includes).
Key findings
-
Code distribution: The wxWidgets GUI implementation accounted for approximately 18,000 lines (the largest single component). Blockchain operations, database management, networking, and scripting comprised the remaining ~13,000 lines.
-
Architecture: The analysis organized the codebase into the following categories, each of which lines up with one of this archive’s own design-history entries for the same subsystem:
- Cryptography: Base58 address encoding, elliptic curve key management (secp256k1), SHA hashing — see the cryptography design entry
- Blockchain: Transaction validation, block processing, difficulty adjustment (every 2,016 blocks) — see the consensus design entry; mining with initial reward of 50 BTC halving every 210,000 blocks — see the monetary design entry
- Networking: Peer-to-peer communication, IRC-based node discovery, message handling — see the P2P network design entry
- Wallet: Transaction management, coin selection, balance calculations — see the wallet design entry
- Script system: A Forth-based stack language with opcodes for programmable transaction conditions — see the transaction design entry
-
Technical parameters hardcoded in v0.1: Coinbase maturity of 100 blocks; difficulty adjustment constrained to 25%–400% range; 10-minute target block interval.
The line count of 31,794 is consistent with the “thirty-one thousand lines of code” that Joshua Davis’s October 2011 New Yorker profile gave for Bitcoin as Satoshi created it in January 2009. The same profile featured Dan Kaminsky’s security analysis of Bitcoin’s code, and Kaminsky came away unable to find an exploitable flaw.














