Preface
Quick Glossary
1. Introduction
What Is Bitcoin?
History of Bitcoin
Bitcoin Uses, Users, and Their Stories
Getting Started
2. How Bitcoin Works
Transactions, Blocks, Mining, and the Blockchain
Bitcoin Transactions
Constructing a Transaction
Bitcoin Mining
Mining Transactions in Blocks
Spending the Transaction
3. Bitcoin Core: The Reference Implementation
Bitcoin Development Environment
Compiling Bitcoin Core from the Source Code
Running a Bitcoin Core Node
Bitcoin Core Application Programming Interface (API)
Alternative Clients, Libraries, and Toolkits
4. Keys, Addresses
Introduction
Bitcoin Addresses
Implementing Keys and Addresses in C++
Implementing Keys and Addresses in Python
Advanced Keys and Addresses
5. Wallets
Wallet Technology Overview
Wallet Technology Details
6. Transactions
Introduction
Transactions in Detail
Transaction Outputs and Inputs
Transaction Scripts and Script Language
Digital Signatures (ECDSA)
Bitcoin Addresses, Balances, and Other Abstractions
7. Advanced Transactions and Scripting
Introduction
Multisignature
Pay-to-Script-Hash (P2SH)
Data Recording Output (RETURN)
Timelocks
Scripts with Flow Control (Conditional Clauses)
Complex Script Example
Segregated Witness
8. The Bitcoin Network
Peer-to-Peer Network Architecture
Node Types and Roles
The Extended Bitcoin Network
Bitcoin Relay Networks
Network Discovery
Full Nodes
Exchanging “Inventory”
Simplified Payment Verification (SPV) Nodes
Bloom Filters
How SPV Nodes Use Bloom Filters
SPV Nodes and Privacy
Encrypted and Authenticated Connections
Transaction Pools
9. The Blockchain
Introduction
Structure of a Block
Block Header
Block Identifiers: Block Header Hash and Block Height
The Genesis Block
Linking Blocks in the Blockchain
Merkle Trees
Merkle Trees and Simplified Payment Verification (SPV)
Bitcoin’s Test Blockchains
Using Test Blockchains for Development
10. Mining and Consensus
Introduction
Decentralized Consensus
Independent Verification of Transactions
Mining Nodes
Aggregating Transactions into Blocks
Constructing the Block Header
Mining the Block
Successfully Mining the Block
Validating a New Block
Assembling and Selecting Chains of Blocks
Mining and the Hashing Race
Consensus Attacks
Changing the Consensus Rules
Soft Fork Signaling with Block Version
Consensus Software Development
11. Bitcoin Security
Security Principles
User Security Best Practices
Conclusion
12. Blockchain Applications
Introduction
Building Blocks (Primitives)
Applications from Building Blocks
Colored Coins
Counterparty
Payment Channels and State Channels
Routed Payment Channels (Lightning Network)
Conclusion
A. The Bitcoin Whitepaper by Satoshi Nakamoto
B. Transaction Script Language Operators, Constants, and Symbols
C. Bitcoin Improvement Proposals
D. Bitcore
E. pycoin, ku, and tx
F. Bitcoin Explorer (bx) Commands
Index