Chapter 1: Private Keys, Public Keys, and Address Encoding
- 1.1 The Derivation Chain
- 1.2 Private Keys: The Foundation of Ownership
- 1.3 Public Keys: Cryptographic Verification Points
- 1.4 Address Generation: From Public Keys to Payment Destinations
- 1.5 Address Types and Encoding Formats
- 1.6 Address Format Comparison
- 1.7 The Derivation Model
- 1.8 What Carries Into Taproot
Chapter 2: Bitcoin Script Fundamentals - Stack Operations and P2PKH
- 2.1 The UTXO Model: Digital Cash, Not Digital Banking
- 2.2 Bitcoin Script and P2PKH Fundamentals
- 2.3 Practical Implementation: Building a P2PKH transaction
- Chapter Summary
Chapter 3: P2SH Script Engineering - From Multi-signature to Time Locks
- 3.1 P2SH Architecture: Scripts Behind the Hash
- 3.2 2-of-3 Multisig
- 3.3 Time Locks with CSV
- 3.4 P2SH vs P2PKH: What P2SH Adds, and Where It Stops
- Chapter Summary
Chapter 4: Building SegWit Transactions — Construction, Stack Execution, and Malleability
- 4.1 Transaction Malleability: The Problem SegWit Solves
- 4.2 Creating a Complete SegWit Transaction
- 4.3 SegWit Transaction Construction and Analysis
- 4.4 P2WPKH Stack Execution
- 4.5 From SegWit to Taproot
- 4.6 Chapter Summary
Chapter 5: Taproot: The Evolution of Bitcoin’s Script System
- Schnorr Signatures
- Key Tweaking
- A Simple Taproot Transaction
- On-Chain Example: Testnet Taproot Transfer
- Key-Path Stack Execution
- Output Shape: Legacy -> SegWit -> Taproot
- SegWit -> Taproot: Code Differences
- Cooperative vs Script Path: Cost Asymmetry
- Chapter Summary
Chapter 6: Building Real Taproot Contracts — Single-Leaf Hash Lock and Dual-Path Spending
- The Scenario: A Conditional Payment
- Two Spending Paths
- The Commit–Reveal Pattern
- Single-Leaf Hash Lock: From Commit to Reveal
- When Script-Path Spending Fails: A Checklist
- Stack Execution: Walking the Hash Lock
- Key Path vs Script Path
- How This Differs from P2SH
- Chapter Summary
Chapter 7: Taproot Dual-Leaf Script Tree — Hash Lock and Bob Script
- From One Leaf to Two
- The Merkle Structure of a Two-Leaf Tree
- Two On-Chain Transactions
- Commit: Building the Two-Leaf Tree
- Reveal: Spending Each Script Path
- Control Blocks, Read From the Chain
- Script Path 1: Hash Script
- Script Path 2: Bob Script
- What Changed From the Single-Leaf Case
- Patterns for Building Two-Leaf Taproot
- Cost and Privacy of the Three Paths
- Chapter Summary
Chapter 8: Four-Leaf Taproot Script Tree — Hashlock, Multisig, Timelock, and Signature
- From Two Leaves to Four
- The Tree, and One Shared Address
- Building the Tree
- Spending Each Path
- How OP_CHECKSIGADD Runs
- The Four-Leaf Control Block
- Three Things That Bite
- Chapter Summary
Chapter 9: Ordinals and BRC-20 — Data Envelopes in Single-Leaf Script Paths
- A Single Leaf That Carries Data
- The Data Envelope:
OP_0 OP_IF ... OP_ENDIF - On-Chain Example: Testnet BRC-20 Mint Transaction Pair
- Code: Building the Inscription Leaf and Temporary Address
- Code: Commit and Reveal (Key Fragments)
- Indexer
- Chapter Summary
Chapter 10: RGB and Tapret — Commitments Inside the Script Tree
- What RGB Is
- The Opposite of Ordinals: Nothing Visible On-Chain
- Tapret: An Unspendable Leaf at Depth 1 of the Script Tree
- Seals: Binding State to a UTXO
- On-Chain Example: Testnet Transfer Transaction
- Code: Six-Step Transfer Flow
- What Bitcoin Sees vs What the RGB Client Sees
- How Tapret Changes the Output Key
- Chapter Summary
Chapter 11: Lightning Network Channels — From P2WSH Multisig to Taproot Privacy Channels
- Lightning: One of Taproot’s Original Motivations
- P2WSH: The SegWit v0 Script Hash
- On-Chain Example: P2WSH Channel Funding and Close
- Taproot Channel: MuSig2 Key Aggregation
- MuSig2 Cooperative Close: The Four-Round Signing Protocol
- Side-by-Side Comparison
- Chapter Summary
Chapter 12: Silent Payments — Elliptic Curve Arithmetic and Address Privacy
- Back to Chapter 5’s Tweak
- The Address Reuse Problem
- On-Chain Example: Testnet Silent Payment
- The Mathematics: Same as Taproot’s Tweak
- The Two-Key Split
- Chapter Summary
- Taproot Applications