Research
Timechain
Search Donate
Sponsors
Cake Wallet, private Bitcoin and Monero walletSideShift.ai, no-signup crypto exchangeOrangeRock, non-custodial bitcoin spot and perps tradingBraiins Hashpower, buy and sell Bitcoin hashrateeCash.com
Code analysis

Bitcoin v0.1.0, file by file

26 C++ files · 19,820 lines (22 files and 16,563 lines are Satoshi's own) · read the source

Bitcoin v0.1.0: the first public release of Bitcoin, announced by Satoshi Nakamoto on the Cryptography Mailing List on January 8th 2009 as a Windows-only alpha (the announcement). Satoshi wrote almost all of it himself. The exceptions are sha.cpp and sha.h (Wei Dai's SHA routines from Crypto++, re-indented) and uibase.cpp and uibase.h (window layouts generated by wxFormBuilder). Admittedly, it's a strange thing to read in 2026: there's a marketplace in it, an IRC client, a 32 MiB size limit and an OP_RETURN that doesn't do what you'd expect, and yet the bones of today's Bitcoin are all there.

How it was built

The readme lists two supported compilers, MinGW GCC 3.4.5 and Microsoft Visual C++ 6.0 SP6, and four libraries you had to get separately: wxWidgets (the windows and buttons), OpenSSL (signatures and hashes; "Bitcoin does not use any encryption"), Berkeley DB (the wallet, block index and address files) and Boost. Satoshi told Hal Finney that GCC was the release build (January 24th 2009), and the bitcoin.exe in the archive is indeed a MinGW build (binaries chapter). Both makefiles shipped: makefile for g++ and makefile.vc for Microsoft's compiler.

The rules that were already there

Things that will probably surprise you

How Satoshi wrote it

Four-space indents, every brace on its own line (Allman style, for the non-coders), // comments, the pointer glued to the type (CNode* pnode), PascalCase functions, C-prefixed classes, and his own Hungarian-style type prefixes (nHeight, fDebug, vchPubKey; booleans start with f, never b). He even rolled his own foreach, loop and CRITICAL_BLOCK macros. The full breakdown is on the coding style page, and how little it changed over the next two years is in Satoshi Against Himself.

The files

FileLinesNote
base58.h201
bignum.h498
db.cpp604
db.h420
headers.h71
irc.cpp265
irc.h7
key.h156
main.cpp2,660
main.h1,317
market.cpp264
market.h182
net.cpp1,020
net.h856
script.cpp1,127
script.h597
serialize.h1,151
sha.cpp554Wei Dai's Crypto++ SHA-256, re-indented
sha.h177Wei Dai's Crypto++ SHA-256 header
ui.cpp3,228
ui.h417
uibase.cpp1,806generated by wxFormBuilder
uibase.h720generated by wxFormBuilder
uint256.h750
util.cpp373
util.h399

Next: what v0.1.3 changed · every release

0:000:00