TeachMeBitcoin

TeachMeBitcoin - The Free Interactive Bitcoin Encyclopedia

From TeachMeBitcoin, the free encyclopedia

TeachMeBitcoin

The Free, Developer-Grade Bitcoin Encyclopedia

Master Bitcoin from first principles. Explore 106 highly detailed, cryptographic, and network-grade educational modules complete with step-by-step stack visualizations, code emulation, and LaTeX math typesetting.

106 Core Modules
1126 Detailed Guides
100% Open Source
1. How Bitcoin Works

How Bitcoin Works

Learn how Bitcoin works in this simple, beginner-friendly guide. Understand the blockchain, digital scarcity, and the fundamentals of decentralized money.

Explore Module Lessons
Start Module →
2. Getting Started: Wallets

Getting Started: Wallets

What is a Bitcoin wallet and how does it work? Learn how wallets manage cryptographic public and private keys to let you send and receive bitcoin.

Explore Module Lessons
Start Module →
3. Getting Started: Exchanges

Getting Started: Exchanges

A beginner-friendly guide explaining what a cryptocurrency exchange is, how order books work, and how to safely buy your very first bitcoin.

Explore Module Lessons
Start Module →
4. Sending Transactions

Sending Transactions

A step-by-step beginner's guide on how to safely send a Bitcoin transaction, scan QR codes, double-check addresses, and verify on-chain status.

Explore Module Lessons
Start Module →
6. The Bitcoin Network

The Bitcoin Network

Deep dive into the peer-to-peer network layer. Understand node propagation, network latency, orphan blocks, and defense against Sybil attacks.

Explore Module Lessons
Start Module →
7. What is a Node?

What is a Node?

Learn the critical role of transaction and block validation. Discover how to run a node, storage options (pruned vs. full), and why nodes don't receive payments.

Explore Module Lessons
Start Module →
8. Bitcoin Mining

Bitcoin Mining

A technical look at Proof of Work. Explore SHA-256 hashing, mining pool mechanics, mining rig hardware (ASICs vs. GPUs), and the block subsidy halving schedule.

Explore Module Lessons
Start Module →
9. The Blockchain

The Blockchain

Understand the blockchain ledger structure. Learn how blocks are cryptographically chained and how Nakamoto Consensus (Longest Chain Rule) establishes trust.

Explore Module Lessons
Start Module →
10. Blocks

Blocks

Break down block structures. Discover block size limits, block weight calculations, Merkle Trees, Coinbase transactions, and the blockspace bidding market.

Explore Module Lessons
Start Module →
11. Difficulty

Difficulty

Master the difficulty feedback loop. Learn how the two-week retarget rule regulates block speeds, protects hashrate, and debunks miner death spirals.

Explore Module Lessons
Start Module →
12. Transactions

Transactions

The mathematical anatomy of transactions. Master serialized schemas, transaction inputs, Outputs, fees, and relative/absolute timelock consensus.

Explore Module Lessons
Start Module →
13. Outputs

Outputs

Deep dive into the UTXO model. Understand how wallets track unspent outputs, change derivation paths, dust limit policies, and UTXO consolidation strategies.

Explore Module Lessons
Start Module →
14. Locks

Locks

Explore the smart-contracting capabilities of Bitcoin Script. Master scriptPubKey locking, scriptSig unlocking, stacktraces, and multisig OP_CHECKMULTISIG execution.

Explore Module Lessons
Start Module →
15. Keys & Addresses

Keys & Addresses

An introduction to Bitcoin keys and addresses. Master private and public keys, secp256k1 math, compressed coordinates, and address derivation formats.

Explore Module Lessons
Start Module →
16. Private Keys

Private Keys

Explore the secrets of raw private key numbers. Learn about entropy generation (coin-flipping, dice-rolling, and CSPRNGs), WIF formats, storage setups, and BIP 39 HD mnemonic seeds.

Explore Module Lessons
Start Module →
17. Public Keys

Public Keys

Dive into the mathematical geometry of public key coordinates. Master point addition and doubling arithmetic, coordinate compression algebra, pure Python derivation, Hash160, and 32-byte Schnorr public keys (BIP 340).

Explore Module Lessons
Start Module →
18. Digital Signatures

Digital Signatures

Understand the authorization layers of Bitcoin. Explore the mathematical mechanics of ECDSA, DER signature serialization, strict BIP 66 parsing, fatal nonce-reuse and bias lattice-attacks (HNP), and the evolution of linear Schnorr signatures.

Explore Module Lessons
Start Module →
19. SegWit

SegWit

Master Bitcoin's most critical scaling upgrade. Explore witness segregation mechanics, Block Weight Units (WU), the 4:1 witness discount, Nested vs. Native Bech32 layouts, malleability fixes, and P2WPKH/P2WSH script bytecode.

Explore Module Lessons
Start Module →
21. Technical: Mining & Mempool

Technical: Mining & Mempool

Master the design architectures of the Bitcoin mempool. Explore time/size limit dynamic thresholds, ancestral dependency DAG structures, and package evaluation (CPFP) miners' math.

Explore Module Lessons
Start Module →
22. Technical: Consensus & Blockchain

Technical: Consensus & Blockchain

Master the chronological coordinate of the ledger. Learn about the Genesis Block (height 0), its unspendable outputs, and block height relative clocks.

Explore Module Lessons
Start Module →
23. Technical: Soft Forks

Technical: Soft Forks

Master the mechanics of backward-compatible upgrades. Learn how rule tightening and forward compatibility allow Bitcoin to upgrade without splitting.

Explore Module Lessons
Start Module →
25. Technical: Disk Storage

Technical: Disk Storage

Understand how Bitcoin Core persists the blockchain to silicon. Learn about the 128MB blk.dat file structure and the role of flat binary storage.

Explore Module Lessons
Start Module →
26. Technical: Transaction Inputs

Technical: Transaction Inputs

Deconstruct the structure of a Bitcoin input. Learn how inputs reference previous outputs to unlock and redistribute satoshis across the network.

Explore Module Lessons
Start Module →
27. Technical: VOUT Indexing

Technical: VOUT Indexing

Understand the zero-based indexing of Bitcoin outputs. Learn why a TXID alone is insufficient to identify specific coins and how VOUT slots solve the ambiguity.

Explore Module Lessons
Start Module →
28. Technical: Unlocking Scripts

Technical: Unlocking Scripts

Analyze the 'Key' of the Bitcoin protocol. Learn how the ScriptSig field provides the cryptographic credentials required to satisfy the conditions of previous outputs.

Explore Module Lessons
Start Module →
29. Technical: Sequence & Timelocks

Technical: Sequence & Timelocks

Deconstruct the 4-byte nSequence field. Learn its original purpose for high-frequency trades and its modern role in enabling RBF and relative timelocks.

Explore Module Lessons
Start Module →
30. Technical: Locking Scripts

Technical: Locking Scripts

Examine the foundation of Bitcoin's programmable ownership. Learn how ScriptPubKey defines the mathematical conditions required for any future spending of an output.

Explore Module Lessons
Start Module →
31. Technical: The Witness (SegWit)

Technical: The Witness (SegWit)

Analyze the segregated proof area of Bitcoin. Learn how the Witness field stores signatures outside the main transaction structure to fix malleability and increase capacity.

Explore Module Lessons
Start Module →
32. Technical: Transaction Locktime

Technical: Transaction Locktime

Examine the temporal bounds of the Bitcoin protocol. Learn how the 4-byte nLockTime field prevents transactions from being mined until a specific block height or date.

Explore Module Lessons
Start Module →
33. Technical: Transaction Fees

Technical: Transaction Fees

Understand the implicit accounting of the Bitcoin network. Learn how fees are derived from the difference between input and output values without a dedicated fee field.

Explore Module Lessons
Start Module →
34. Technical: Transaction Size & Weight

Technical: Transaction Size & Weight

Master the physics of blockspace. Learn the difference between raw bytes and weight units, and how SegWit fundamentally changed how Bitcoin measures transaction size.

Explore Module Lessons
Start Module →
35. Technical: The UTXO Model

Technical: The UTXO Model

Explore the stateless architecture of Bitcoin. Learn why the Unspent Transaction Output (UTXO) model was chosen over accounts for massive parallelism and cryptographic security.

Explore Module Lessons
Start Module →
36. Technical: wTXID (Witness Transaction ID)

Technical: wTXID (Witness Transaction ID)

Explore the dual identity of SegWit transactions. Learn how the Witness Transaction Identifier (wTXID) protects the network from signature malleability while maintaining backward compatibility.

Explore Module Lessons
Start Module →
37. Technical: PSBT (BIP 174)

Technical: PSBT (BIP 174)

Introduction to Partially Signed Bitcoin Transactions. Learn how BIP 174 standardized the communication between multisig coordinators and offline signing devices.

Explore Module Lessons
Start Module →
38. Technical: P2PK (Pay-to-Public-Key)

Technical: P2PK (Pay-to-Public-Key)

Explore the original script type used by Satoshi Nakamoto. Learn how P2PK locks coins directly to raw public key bytes and why it was the foundation of the network.

Explore Module Lessons
Start Module →
39. Technical: P2PKH (Pay-to-Public-Key-Hash)

Technical: P2PKH (Pay-to-Public-Key-Hash)

Explore the standard legacy address format. Learn how P2PKH improved space efficiency and security by locking coins to a 20-byte RIPEMD160 hash instead of raw keys.

Explore Module Lessons
Start Module →
40. Technical: P2MS (Pay-to-Multisig)

Technical: P2MS (Pay-to-Multisig)

Introduction to collaborative ownership. Learn how the M-of-N multisig model works in its rawest form and why it was the first way joint accounts were created on Bitcoin.

Explore Module Lessons
Start Module →
41. Technical: P2SH (Pay-to-Script-Hash)

Technical: P2SH (Pay-to-Script-Hash)

Introduction to the '3' address format. Learn how P2SH shifted the burden of complex script execution from the sender to the receiver using cryptographic hashes.

Explore Module Lessons
Start Module →
42. Technical: P2SH-P2WPKH (Nested SegWit)

Technical: P2SH-P2WPKH (Nested SegWit)

Explore the bridge between legacy and modern Bitcoin. Learn how Nested SegWit allowed users to access the benefits of the 2017 upgrade while maintaining compatibility with old '3' addresses.

Explore Module Lessons
Start Module →
43. Technical: P2SH-P2WSH (Nested SegWit Multisig)

Technical: P2SH-P2WSH (Nested SegWit Multisig)

Introduction to multi-layered collaborative custody. Learn how P2SH-P2WSH enabled institutional multisig wallets to utilize SegWit benefits while remaining backward compatible.

Explore Module Lessons
Start Module →
44. Technical: P2WPKH (Native SegWit)

Technical: P2WPKH (Native SegWit)

Explore the native SegWit standard. Learn how P2WPKH removed the legacy P2SH wrapper entirely, resulting in 'bc1q' addresses and the maximum possible fee efficiency for single keys.

Explore Module Lessons
Start Module →
45. Technical: P2WSH (Native SegWit Multisig)

Technical: P2WSH (Native SegWit Multisig)

Introduction to native SegWit multisig. Learn how P2WSH provides the maximum possible fee discount and utilizes 32-byte SHA256 security for complex collaborative custody scripts.

Explore Module Lessons
Start Module →
46. Technical: P2TR (Pay-to-Taproot)

Technical: P2TR (Pay-to-Taproot)

Introduction to the 2021 Taproot upgrade. Learn how P2TR unified single keys and complex scripts into a single identity, maximizing privacy and introducing bc1p addresses.

Explore Module Lessons
Start Module →
47. Technical: OP_RETURN (Data Embeds)

Technical: OP_RETURN (Data Embeds)

Introduction to arbitrary data storage. Learn how OP_RETURN allows for embedding metadata into the blockchain without creating unspendable UTXOs.

Explore Module Lessons
Start Module →
48. Technical: Private Key (Mathematical Generation)

Technical: Private Key (Mathematical Generation)

Deep dive into the 256-bit integer that powers Bitcoin. Understand the 'Secret Scalar' and the absolute responsibility of owning the key that controls your wealth.

Explore Module Lessons
Start Module →
49. Technical: Public Keys (Uncompressed vs. Compressed)

Technical: Public Keys (Uncompressed vs. Compressed)

Explore the geometry of your Bitcoin identity. Learn how the private key scalar is transformed into a specific (x, y) coordinate on the secp256k1 elliptic curve.

Explore Module Lessons
Start Module →
50. Technical: Public Key Hash (HASH160)

Technical: Public Key Hash (HASH160)

Introduction to the 160-bit fingerprint. Learn how hashing the public key provides compact identifiers, uniform address sizes, and a layer of privacy for Bitcoin users.

Explore Module Lessons
Start Module →
51. Technical: Bitcoin Addresses (Encoding Standards)

Technical: Bitcoin Addresses (Encoding Standards)

Introduction to the payment identifier. Learn how addresses are essentially postal codes for your funds, derived from public key hashes and encoded for human use.

Explore Module Lessons
Start Module →
52. Technical: WIF Format (Encoding Secrets)

Technical: WIF Format (Encoding Secrets)

Introduction to the Wallet Import Format. Learn how WIF converts raw 256-bit scalars into human-readable secrets that are safer to copy and transport.

Explore Module Lessons
Start Module →
53. Technical: ECDSA Signatures (R and S components)

Technical: ECDSA Signatures (R and S components)

Introduction to digital signatures. Learn how a private key creates a unique 'Seal' over a transaction hash without ever revealing the underlying secret.

Explore Module Lessons
Start Module →
54. Technical: Checksums (Error Detection Mathematics)

Technical: Checksums (Error Detection Mathematics)

Introduction to error detection. Learn why Bitcoin identifiers use mathematical checksums to prevent the unrecoverable loss of funds due to simple transcription typos.

Explore Module Lessons
Start Module →
55. Technical: Base58 Encoding (The Human-Friendly Hex)

Technical: Base58 Encoding (The Human-Friendly Hex)

Introduction to the legacy encoding standard. Discover why Satoshi chose a custom 58-character alphabet to replace raw hex and protect users from ambiguous characters.

Explore Module Lessons
Start Module →
56. Technical: Bech32 Encoding (The SegWit Standard)

Technical: Bech32 Encoding (The SegWit Standard)

Introduction to the modern SegWit encoding. Learn why Bitcoin transitioned to Bech32 for Native SegWit addresses and how it improves efficiency for humans and QR codes.

Explore Module Lessons
Start Module →
57. Technical: Mnemonic Phrases (BIP39 Standard)

Technical: Mnemonic Phrases (BIP39 Standard)

Introduction to the human-readable backup. Discover how BIP39 replaced complex hex strings with 12 simple words, enabling universal wallet recovery.

Explore Module Lessons
Start Module →
58. Technical: Extended Keys (BIP32 xpub/xprv)

Technical: Extended Keys (BIP32 xpub/xprv)

Introduction to Hierarchical Deterministic (HD) parent keys. Learn how a single extended key can generate an infinite tree of child keys using a master secret and chain code.

Explore Module Lessons
Start Module →
59. Technical: Derivation Paths (The BIP Hierarchy)

Technical: Derivation Paths (The BIP Hierarchy)

Introduction to HD instructions. Learn how derivation paths act as the 'map' that tells your wallet where to find specific keys within the infinite tree of your seed phrase.

Explore Module Lessons
Start Module →
60. Cryptography: Hash Functions (SHA256 & RIPEMD160)

Cryptography: Hash Functions (SHA256 & RIPEMD160)

Introduction to cryptographic hashing. Discover the 3 pillars of hash functions-Determinism, One-wayness, and Collision Resistance-and how they anchor the blockchain.

Explore Module Lessons
Start Module →
61. Cryptography: Elliptic Curve Math (secp256k1)

Cryptography: Elliptic Curve Math (secp256k1)

Introduction to ECC geometry. Learn why Bitcoin uses curves over finite fields and how modular arithmetic transforms smooth lines into a secure scattering of points.

Explore Module Lessons
Start Module →
62. Cryptography: Schnorr Signatures (The Taproot Standard)

Cryptography: Schnorr Signatures (The Taproot Standard)

Introduction to BIP340. Learn why Schnorr signatures are superior to ECDSA in terms of linearity, security proofs, and computational efficiency.

Explore Module Lessons
Start Module →
63. Upgrades: Segregated Witness (BIP141 details)

Upgrades: Segregated Witness (BIP141 details)

Introduction to BIP141. Learn how Segregated Witness separated signatures from base data to fix malleability and increase network capacity.

Explore Module Lessons
Start Module →
64. Upgrades: Taproot (BIP341/342 Details)

Upgrades: Taproot (BIP341/342 Details)

Introduction to BIP341. Learn how Taproot combines Schnorr signatures and Merkle trees to make complex smart contracts look identical to simple payments.

Explore Module Lessons
Start Module →
65. Technical: Hexadecimal & Byte Mapping

Technical: Hexadecimal & Byte Mapping

Introduction to Base16. Learn why Bitcoin uses hexadecimal to represent massive binary numbers like private keys and transaction hashes in a readable format.

Explore Module Lessons
Start Module →
66. Technical: Bytes (Raw Data Units)

Technical: Bytes (Raw Data Units)

Introduction to the fundamental unit of the blockchain. Learn why the 8-bit byte is the baseline for measuring block size, transaction fees, and cryptographic strength.

Explore Module Lessons
Start Module →
67. Technical: Little Endian (Byte Ordering)

Technical: Little Endian (Byte Ordering)

Introduction to the counter-intuitive world of byte ordering. Learn the difference between Big and Little Endian and why Bitcoin chose the 'backward' way to store numbers.

Explore Module Lessons
Start Module →
68. Technical: Byte Order (Big vs. Little Endian Contexts)

Technical: Byte Order (Big vs. Little Endian Contexts)

Overview of the multi-endian stack. Learn how data changes byte order as it moves from hardware memory to disk storage and finally to the human-readable display layer.

Explore Module Lessons
Start Module →
69. Technical: Compact Size (VarInt)

Technical: Compact Size (VarInt)

Introduction to variable-length integers. Learn how Bitcoin saves massive amounts of blockchain space by using dynamic byte-counts for inputs, outputs, and scripts.

Explore Module Lessons
Start Module →
Bitcoin Core

Bitcoin Core

An overview of Bitcoin Core's architecture, framing it as a complex machine with 20 specialized departments.

Explore Module Lessons
Start Module →
92. Bitcoin Node Operations

Bitcoin Node Operations

Master the architecture of Bitcoin Core. Chapter 1: The Builder\u2019s Foundation: Environment Setup and Toolchains. An in-depth technical analysis of the protocol's node operations logic.

Explore Module Lessons
Start Module →
93. Bitcoind Lifecycle

Bitcoind Lifecycle

Master the architecture of Bitcoin Core. Chapter 1: The First Breath: How bitcoind Wakes Up. An in-depth technical analysis of the protocol's bitcoind lifecycle logic.

Explore Module Lessons
Start Module →
95. Consensus: The Heart of Bitcoin

Consensus: The Heart of Bitcoin

Master the architecture of Bitcoin Core. Chapter 1: The Constitution of the Network: Introduction to Consensus. An in-depth technical analysis of the protocol's consensus heart logic.

Explore Module Lessons
Start Module →
97. Mempool and Transaction Flow

Mempool and Transaction Flow

Master the architecture of Bitcoin Core. Chapter 1: The Waiting Room of Truth: Introduction to the Mempool. An in-depth technical analysis of the protocol's mempool logic.

Explore Module Lessons
Start Module →
98. Mining Control and Logic

Mining Control and Logic

Master the architecture of Bitcoin Core. Chapter 1: The Heart of the Network: Introduction to Bitcoin Mining. An in-depth technical analysis of the protocol's mining control logic.

Explore Module Lessons
Start Module →
99. Network Processing

Network Processing

Master the architecture of Bitcoin Core. Chapter 1: The Diplomat of the Core: Introduction to `net_processing.cpp`. An in-depth technical analysis of the protocol's net processing logic.

Explore Module Lessons
Start Module →
101. P2P Networking Layer

P2P Networking Layer

Master the architecture of Bitcoin Core. Chapter 1: The Digital Nervous System: Introduction to P2P Networking. An in-depth technical analysis of the protocol's p2p networking logic.

Explore Module Lessons
Start Module →
102. Performance and Optimization

Performance and Optimization

Master the architecture of Bitcoin Core. Chapter 2: The Multi-Threaded Mind: Understanding Parallel Execution in Core. An in-depth technical analysis of the protocol's performance logic.

Explore Module Lessons
Start Module →
103. Raw Transactions Deep Dive

Raw Transactions Deep Dive

Master the architecture of Bitcoin Core. Chapter 1: The Master Craftsman: Introduction to Raw Transactions. An in-depth technical analysis of the protocol's raw transactions logic.

Explore Module Lessons
Start Module →
106. Storage and Database Layer

Storage and Database Layer

Master the architecture of Bitcoin Core. Chapter 1: The Memory of the Sovereign: Introduction to Persistent Storage. An in-depth technical analysis of the protocol's storage logic.

Explore Module Lessons
Start Module →
108. Wallet Logic and Management

Wallet Logic and Management

Master the architecture of Bitcoin Core. Chapter 1: The Personal Sovereign: Introduction to Wallet Logic. An in-depth technical analysis of the protocol's wallet logic logic.

Explore Module Lessons
Start Module →
110. Digital Nervous System: Validation

Digital Nervous System: Validation

Master the architecture of Bitcoin Core. Chapter 1: The Vision of Modular Sovereignty: Beyond the Monolith. An in-depth technical analysis of the protocol's core validation engine logic.

Explore Module Lessons
Start Module →
111. Digital Nervous System: Network & Memory

Digital Nervous System: Network & Memory

Master the architecture of Bitcoin Core. Chapter 6: The Evolution of Communication: From JSON-RPC to Modern REST. An in-depth technical analysis of the protocol's network memory mechanics logic.

Explore Module Lessons
Start Module →
112. Digital Nervous System: Sovereignty & Crypto

Digital Nervous System: Sovereignty & Crypto

Master the architecture of Bitcoin Core. Chapter 10: Descriptor Wallets: The Future of Key Management and Output Scripts. An in-depth technical analysis of the protocol's programmable sovereignty crypto logic.

Explore Module Lessons
Start Module →
113. Digital Nervous System: Resilience

Digital Nervous System: Resilience

Master the architecture of Bitcoin Core. Chapter 16: The Package Relay Strategy: Solving the CPFP Limits. An in-depth technical analysis of the protocol's network resilience synthesis logic.

Explore Module Lessons
Start Module →
92. Core Source Explanation

Core Source Explanation

Deep-dive analysis of Bitcoin Core source code. Technical Context: `private_broadcast.h` | Lines 141-147

Explore Module Lessons
Start Module →
☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!