作者:刘教链

Bitcoin History Tales — Complete Implementation Specification

Based on Liu Jiaolian (刘教链), God Rolls Dice: Bitcoin History Tales (上帝掷骰子:比特币史话) (2022)


Table of Contents

  1. Overview
  2. Core Thesis — Order from Consensual Randomness
  3. Bitcoin's Technical Architecture
  4. Key Historical Events and Lessons
  5. The Monetary Theory of Bitcoin
  6. Game Theory and Incentive Design
  7. Security Model and Attack Analysis
  8. Investment Framework Derived from the Book
  9. Entry Rules — When to Accumulate Bitcoin
  10. Exit Rules — When to Reduce Exposure
  11. Position Sizing and Allocation
  12. Risk Management
  13. Behavioral and Discipline Rules
  14. Common Mistakes
  15. Complete Bitcoin Lifecycle Example
  16. Implementation Pseudocode
  17. Key Quotes

1. Overview

God Rolls Dice: Bitcoin History Tales is a 20-chapter, 100-tale encyclopedic history of Bitcoin written by Chinese blockchain educator Liu Jiaolian. Published in 2022, the book covers approximately 290,000 Chinese characters and is structured as a series of interconnected historical narratives that trace Bitcoin's invention back through centuries of cryptography, mathematics, economics, computing, and monetary history.

Unlike most Bitcoin books that focus on either the technical or the investment angle, this book argues that Bitcoin can only be truly understood by placing it within the full context of its intellectual precursors: the cypherpunk movement, elliptic curve cryptography, the Byzantine Generals Problem, Austrian economics, game theory, the history of the Federal Reserve, and thermodynamic dissipative structures.

Core thesis: Bitcoin's essence is "order emerged from consensual randomness" — a system where cryptography (mathematics), hash power (physics), and consensus (game theory) combine to create an irreversible arrow of time, a new form of money, and a self-governing system that channels selfish behavior toward collective good.

Target audience: Blockchain practitioners, investors, researchers, educators, and anyone seeking to understand Bitcoin from first principles rather than surface-level narratives.

Structure: 20 chapters, each containing 3-7 "tales" (话), progressing from Bitcoin's genesis (Ch. 1-2) through its core technologies (Ch. 3-8), monetary theory (Ch. 9-10), mining arms race (Ch. 11), game theory (Ch. 12-13), smart contracts (Ch. 14), forks (Ch. 15), scalability (Ch. 16), data compression (Ch. 17), randomness and wallets (Ch. 18), privacy (Ch. 19), and the open-source era (Ch. 20).


2. Core Thesis — Order from Consensual Randomness

The book's subtitle "God Rolls Dice" captures its central philosophical claim: Bitcoin's security and value emerge from randomness that achieves consensus.

2.1 The Three Pillars

  1. Cryptography (Mathematics) — Elliptic curve digital signatures (ECDSA using secp256k1), SHA-256 hash functions, and double-hash structures provide the mathematical foundation
  2. Hash Power (Physics) — Proof-of-Work converts electricity into irreversible time, creating Bitcoin's internal clock and arrow of time
  3. Consensus (Game Theory) — The longest-chain rule, mining incentives, and Nash equilibrium dynamics ensure all participants converge on a single shared history

2.2 Bitcoin as a Dissipative Structure

Drawing on Nobel laureate Ilya Prigogine's theory of dissipative structures, the author argues that Bitcoin's Proof-of-Work chain is an open system that continuously converts external energy (electricity) into internal order (the blockchain's irreversible history). This creates a third kind of time — not the reversible time of Newtonian mechanics, nor the statistical time of thermodynamics, but an internally-generated, consensus-driven time unique to Bitcoin.

2.3 Satoshi's Reinvention of Time

The book's most original technical insight: Satoshi Nakamoto's greatest invention was not digital money per se, but the creation of endogenous time in cyberspace. Before Bitcoin, all digital timestamps were external and manipulable. Bitcoin's Proof-of-Work chain creates an internal, unforgeable timeline — what Satoshi originally called a "timechain" rather than a "blockchain."


3. Bitcoin's Technical Architecture

3.1 Elliptic Curve Cryptography (Ch. 3)

3.2 Hash Functions (Ch. 5)

Three critical properties of cryptographic hash functions that Bitcoin exploits:

  1. Collision-free — Practically impossible to find two inputs with the same hash
  2. Hiding — Cannot reverse-engineer the input from the output
  3. Puzzle-friendly — The only way to find a target hash is brute-force search

Bitcoin uses SHA-256 everywhere, chosen because MD5 and SHA-1 were already broken by Chinese cryptographer Wang Xiaoyun's team in 2004-2005.

3.3 Double-Hash Design (Ch. 5)

Bitcoin uses double-hashing (e.g., SHA-256 applied twice, or SHA-256 + RIPEMD-160 for addresses) to defend against length-extension attacks — a vulnerability in single-layer Merkle-Damgard hash constructions.

3.4 The UTXO Model (Ch. 4)

3.5 Timestamp Server and Proof-of-Work (Ch. 6)

3.6 Bitcoin Script (Ch. 14)

3.7 Address Evolution


4. Key Historical Events and Lessons

4.1 Timeline of Critical Events

Date Event Lesson
2008-10-31 Satoshi publishes Bitcoin whitepaper on cypherpunk mailing list Great innovations often emerge from niche communities
2009-01-03 Genesis block mined, embedding The Times headline about bank bailouts Bitcoin born as response to financial system failure
2009-01-12 First Bitcoin transaction: Satoshi to Hal Finney (Block 170) Early adoption by those who understand the technology
2010-12-12 Satoshi's last public post (v0.3.19 release) Creator's disappearance strengthened decentralization
2010-08-15 Integer overflow bug: 922 billion BTC created at block 74638 Fixed within 5 hours with v0.3.10; shows importance of vigilant community
2011-06-09 El Salvador adopts Bitcoin as legal tender Nation-state adoption validates the technology
2017-08-01 Bitcoin Cash (BCH) hard fork at block 478559 Block size wars demonstrate governance challenges
2017-08-24 SegWit activation Soft forks can achieve upgrades without splitting the chain

4.2 The Cypherpunk Movement (Ch. 2)

4.3 Precursors to Bitcoin (Ch. 8)

4.4 Satoshi's Birthday and the Federal Reserve (Ch. 10)

4.5 The Fork Wars (Ch. 15)

Three types of forks:

  1. Turing bifurcation: Random, temporary forks resolved by longest-chain rule
  2. Soft fork: Backward-compatible; old nodes accept new blocks (e.g., SegWit)
  3. Hard fork: Not backward-compatible; creates permanent chain split (e.g., BCH)

Key lesson: Bitcoin's core design is immutable once deployed ("version 0.1 core design will remain unchanged throughout its lifecycle" — Satoshi). Hard forks that change consensus rules face the "Grim Trigger" of game theory — once betrayal begins, it never stops.


5. The Monetary Theory of Bitcoin

5.1 Austrian Economics Foundation (Ch. 8)

The book grounds Bitcoin's value theory in Austrian economics:

5.2 Bitcoin as "Better Gold" (Ch. 9, Tale 38)

Nine properties compared:

Property Bitcoin Gold
1. Total supply Fixed at 21M Mined annually, total unknown
2. Durability Eternal (digital) Coins wear and degrade
3. Divisibility To 0.00000001 (8 decimal places) Limited by physical size
4. Security Low cost (private key) High cost (physical storage)
5. Counterfeit resistance Impossible (blockchain verification) Possible (requires specialized equipment)
6. Anonymity Pseudonymous Fully anonymous
7. Liquidity Instant global transfer Physical, slow, expensive
8. Growth potential Early stage, massive upside Mature, limited upside
9. Saleableness Growing consensus Deep but established

5.3 The Commodity-to-Money-to-Capital Evolution

The book traces Bitcoin's evolution through three phases:

  1. Production → Commodity: Mining converts electricity/time into Bitcoin (a commodity with exchange value)
  2. Commodity → Money: As Bitcoin is exchanged for other goods, it acquires monetary properties
  3. Money → Capital: Mining as continuous investment creates self-reproducing value — Bitcoin becomes capital

5.4 Stock-to-Flow Model

5.5 Why Fiat Money Fails

The book traces the history of fiat currency failure:


6. Game Theory and Incentive Design

6.1 The Byzantine Generals Problem (Ch. 7)

6.2 Prisoner's Dilemma and Nash Equilibrium (Ch. 12)

Bitcoin constructs a new Nash equilibrium where:

6.3 The "Guiding Evil Toward Good" Design (Ch. 12, Tale 57)

Bitcoin's incentive structure channels selfish behavior toward public good:

As Satoshi wrote: "The incentive may help encourage nodes to stay honest. If a greedy attacker is able to assemble more CPU power than all the honest nodes, he would have to choose between using it to defraud people by stealing back his payments, or using it to generate new coins. He ought to find it more profitable to play by the rules."

6.4 The Schelling Point

The longest chain is Bitcoin's Schelling Point — the natural focal point that all participants converge on without explicit coordination. Users assign value to the main chain because it feels natural and special, and bounded rationality leads people to choose the simplest path.


7. Security Model and Attack Analysis

7.1 The 51% Attack (Ch. 13)

7.2 Why 6 Confirmations?

The "6 block confirmation" standard originated from Satoshi's whitepaper calculations assuming an attacker with ~10% hash power. As network hash power has grown enormously, even Coinbase has reduced to 3 confirmations for deposits.

7.3 Defense Through the "Left-Right Game" (Ch. 11)

Bitcoin's "shield" (SHA-256 difficulty) is forged by the same "sword" (mining hash power) that attacks it:

7.4 Private Key Security


8. Investment Framework Derived from the Book

While primarily a history/technology book, the author embeds a clear investment philosophy:

8.1 Bitcoin as the Only True Cryptocurrency

8.2 The Self-Fulfilling Prophecy

Satoshi wrote: "It might make sense just to get some in case it catches on. If enough people think the same way, that becomes a self-fulfilling prophecy."

8.3 Value Proposition Hierarchy

  1. Store of Value: Fixed supply (21M cap) + halving schedule = increasing scarcity
  2. Medium of Exchange: Global, permissionless, 24/7 settlement
  3. Unit of Account: As adoption grows, Bitcoin-denominated pricing will emerge
  4. Capital: Mining creates self-reproducing value in perpetual motion

9. Entry Rules — When to Accumulate Bitcoin

Based on the book's analysis of Bitcoin's monetary evolution and halving cycles:

  1. Accumulate during bear markets / depression phases of the Kondratiev Wave — The book identifies 2019 as the start of the 5th Kondratiev depression phase; defensive assets (gold, Bitcoin) outperform
  2. Buy after each halving event — Halvings reduce new supply by 50%, creating supply shock (2012, 2016, 2020, 2024...)
  3. Dollar-cost average consistently — Satoshi's mining design rewards steady participation; apply the same principle to buying
  4. Enter when Stock-to-Flow ratio increases — Each halving increases SF, making Bitcoin "harder" than before
  5. Accumulate when mainstream sentiment is negative — "Many people automatically dismiss electronic currency as a lost cause because of all the companies that failed since the 1990s. I hope it's obvious it was only the centrally controlled nature of those systems that doomed them." (Satoshi)

10. Exit Rules — When to Reduce Exposure

The book implicitly argues against ever fully exiting Bitcoin, but recognizes market cycles:

  1. Never sell 100% — Bitcoin is designed to appreciate over centuries as the "hardest" asset; lost coins make remaining coins more valuable
  2. Reduce exposure during euphoria — When media coverage peaks and speculation dominates
  3. Consider partial rebalancing — When Bitcoin's share of portfolio becomes excessively concentrated
  4. Watch for PoW security degradation signals — If hash rate drops dramatically and doesn't recover, the security model may be weakening (this has never happened)
  5. Monitor the halving cycle — Historically, peak prices occur 12-18 months after halvings; consider taking some profit in these windows

11. Position Sizing and Allocation

The book does not prescribe specific allocation percentages but implies:

  1. Minimum meaningful allocation: Enough to be "self-fulfilling" — if Bitcoin succeeds, your position should be significant
  2. Maximum allocation: Never more than you can afford to lose entirely (private key loss, regulatory risk)
  3. Prefer self-custody: "Your Bitcoin, your private key, your bank" — do not rely on exchanges or custodians
  4. HD wallet structure: Use hierarchical deterministic wallets to generate a new address for each transaction
  5. Cold storage for long-term holdings: Hardware wallets or paper wallets for amounts you do not plan to transact with

12. Risk Management

12.1 Technical Risks

12.2 Custody Risks

12.3 Market Risks


13. Behavioral and Discipline Rules

  1. Think in decades, not days — Bitcoin's halving cycle operates on 4-year intervals; the full issuance schedule spans until ~2140
  2. Understand before investing — The book's central message is that deep understanding of Bitcoin's history, technology, and economics is a prerequisite for confident holding
  3. Be your own bank — Learn to manage private keys; do not outsource custody to trusted third parties
  4. Verify, don't trust — Run your own node if possible; Bitcoin is "trustless" by design (Satoshi: "We have proposed a system for electronic transactions without relying on trust")
  5. Ignore noise, follow proof-of-work — The longest chain with the most accumulated work is always the "real" Bitcoin
  6. HODL through FUD — Satoshi: "Lost coins only make everyone else's coins worth slightly more. Think of it as a donation to everyone."

14. Common Mistakes

  1. Treating Bitcoin like other "crypto" — Bitcoin is uniquely decentralized; altcoins and tokens are fundamentally different
  2. Leaving coins on exchanges — Violates the core principle of trustless ownership
  3. Reusing addresses — Degrades privacy and slightly increases vulnerability
  4. Trying to time the market — The halving cycle rewards patient accumulation, not trading
  5. Ignoring the technology — Investing without understanding leads to panic selling during downturns
  6. Trusting "trusted third parties" — Satoshi: "The root problem with conventional currency is all the trust that's required to make it work"
  7. Falling for fork coins — BCH, BSV, and other forks lack the network effect and development support of Bitcoin
  8. Confusing Bitcoin with blockchain — "Blockchain technology" without PoW is just a slow database; Bitcoin IS the innovation
  9. Believing Bitcoin is "too expensive" — Bitcoin is divisible to 8 decimal places; you can buy satoshis, not whole coins
  10. Thinking mining is wasteful — Mining converts energy into time-stamped security; the "waste" IS the security mechanism

15. Complete Bitcoin Lifecycle Example

Scenario: First-time Bitcoin Acquisition and Self-Custody

Step 1: Generate Private Key

Step 2: Derive Public Key and Address

Step 3: Receive Bitcoin

Step 4: Transaction Confirmation

Step 5: Spending Bitcoin

Step 6: Security Confirmation


16. Implementation Pseudocode

16.1 Proof-of-Work Mining Algorithm

function mine_block(transactions, prev_block_hash, difficulty_target):
    block_header = {
        version: CURRENT_VERSION,
        prev_hash: prev_block_hash,
        merkle_root: compute_merkle_root(transactions),
        timestamp: current_unix_time(),
        difficulty: difficulty_target,
        nonce: 0
    }
    
    // Coinbase transaction: reward miner
    coinbase_tx = create_coinbase(
        reward = current_block_reward(),  // 50 → 25 → 12.5 → 6.25 → ...
        fees = sum(tx.fee for tx in transactions),
        miner_address = MY_ADDRESS
    )
    transactions.insert(0, coinbase_tx)
    
    // Proof-of-Work: find nonce such that hash < target
    while true:
        hash = SHA256(SHA256(serialize(block_header)))
        if hash < difficulty_target:
            broadcast(block_header, transactions)
            return block_header
        block_header.nonce += 1
        
        // Update timestamp periodically
        if nonce % 1000000 == 0:
            block_header.timestamp = current_unix_time()

16.2 Transaction Verification

function verify_transaction(tx):
    // 1. Check all inputs reference valid UTXOs
    for input in tx.inputs:
        utxo = lookup_utxo(input.prev_tx_hash, input.output_index)
        if utxo is None:
            return REJECT("Input references non-existent UTXO")
    
    // 2. Verify digital signatures
    for i, input in enumerate(tx.inputs):
        utxo = lookup_utxo(input.prev_tx_hash, input.output_index)
        locking_script = utxo.scriptPubKey
        unlocking_script = input.scriptSig
        
        // Concatenate and execute scripts (stack-based, Reverse Polish)
        if not execute_script(unlocking_script + locking_script):
            return REJECT("Script verification failed")
    
    // 3. Check no double-spending
    total_input = sum(utxo.value for utxo in tx.inputs)
    total_output = sum(output.value for output in tx.outputs)
    if total_output > total_input:
        return REJECT("Outputs exceed inputs")
    
    // 4. Fee = input - output (must be >= 0)
    fee = total_input - total_output
    return ACCEPT(fee)

16.3 Longest Chain Selection

function select_best_chain(chains):
    // Bitcoin follows the chain with most accumulated work
    // NOT simply the longest chain by block count
    best_chain = None
    max_work = 0
    
    for chain in chains:
        total_work = sum(
            2^256 / (block.difficulty_target + 1)
            for block in chain
        )
        if total_work > max_work:
            max_work = total_work
            best_chain = chain
    
    return best_chain

16.4 Double-Spend Attack Probability (from Whitepaper)

function attack_success_probability(q, z):
    // q = attacker's fraction of total hash power
    // z = number of confirmations (blocks behind)
    // Returns probability attacker can catch up
    
    p = 1.0 - q  // honest nodes' hash power fraction
    lambda = z * (q / p)  // Poisson expected value
    
    sum = 1.0
    for k in range(0, z + 1):
        poisson = exp(-lambda) * (lambda ** k) / factorial(k)
        gambler_ruin = 1.0 if k <= z else (q / p) ** (z - k)
        sum -= poisson * (1 - gambler_ruin)
    
    return max(0, sum)

// Example outputs:
// q=0.10, z=6  → P ≈ 0.0002 (safe)
// q=0.30, z=6  → P ≈ 0.1773 (not safe, need ~25 confirmations)
// q=0.45, z=6  → P ≈ 0.8245 (not safe, need ~341 confirmations)

16.5 Bitcoin Accumulation Strategy (DCA with Halving Awareness)

function bitcoin_investment_strategy():
    HALVING_INTERVAL = 210000  // blocks
    BLOCK_TIME = 10  // minutes average
    
    state = {
        total_btc: 0,
        total_fiat_invested: 0,
        next_halving: get_next_halving_block(),
        current_sf_ratio: get_stock_to_flow()
    }
    
    // Monthly routine
    function monthly_review():
        blocks_to_halving = state.next_halving - current_block_height()
        months_to_halving = blocks_to_halving * BLOCK_TIME / (60 * 24 * 30)
        
        // Increase allocation as halving approaches (supply shock incoming)
        if months_to_halving < 12:
            allocation_multiplier = 1.5
        elif months_to_halving < 6:
            allocation_multiplier = 2.0
        else:
            allocation_multiplier = 1.0
        
        // Base DCA amount adjusted by cycle position
        buy_amount = BASE_MONTHLY_AMOUNT * allocation_multiplier
        
        // Execute purchase
        buy_bitcoin(buy_amount)
        state.total_btc += buy_amount / current_price()
        state.total_fiat_invested += buy_amount
        
        // Self-custody: withdraw to cold storage
        if exchange_balance() > THRESHOLD:
            withdraw_to_cold_storage(exchange_balance())
        
        // Log and review
        log(f"BTC: {state.total_btc}, "
            f"Avg cost: {state.total_fiat_invested / state.total_btc}, "
            f"Months to halving: {months_to_halving}")

17. Key Quotes

Satoshi Nakamoto Quotes (from forum posts and emails cited in the book)

"比特币是1998年戴维密码朋克提出的B-money提案和尼克·萨博的'比特金'提案的实现。" "Bitcoin is an implementation of Wei Dai's B-money proposal from 1998 and Nick Szabo's Bitgold proposal." — Satoshi, 2010-07-20

"传统货币的根本问题在于使其运转所需要的所有信任。必须信任央行不会让货币贬值,但是法币的历史却充斥着对这一信任的破坏。" "The root problem with conventional currency is all the trust that's required to make it work. The central bank must be trusted not to debase the currency, but the history of fiat currencies is full of breaches of that trust." — Satoshi, 2009-02-11

"拥有一些比特币是明智的,万一它流行起来了呢?如果有足够多的人这么想,那么它就会成为一个自我实现的预言。" "It might make sense just to get some in case it catches on. If enough people think the same way, that becomes a self-fulfilling prophecy." — Satoshi, 2009-01-16

"丢失的币只会使其他人的币价值更高,可以将其视为对所有人的捐赠。" "Lost coins only make everyone else's coins worth slightly more. Think of it as a donation to everyone." — Satoshi, 2010-06-21

"CPU的工作量证明投票必须具有最终的发言权。让每个人都相信最长链(累积算力最大的链)是有效链,这是建立全球共识的唯一方法。" "CPU power proof-of-work vote must have the final say. The only way to build global consensus is for everyone to believe the longest chain (greatest accumulated proof-of-work) is the valid chain." — Satoshi, 2008-11-08

"工作量证明链就是拜占庭将军问题的解。工作量证明链是所有的同步性问题、分布式数据库问题及全局视图问题的解决方法。" "The proof-of-work chain is the solution to the Byzantine Generals Problem. The proof-of-work chain is the solution to all synchronization problems, distributed database problems, and global view problems." — Satoshi, 2008-11-13

"工作量证明具有一个漂亮的特性,就是它可以通过不受信任的中间人进行中转。我们不必担心一条链来自被托管了的通信。是谁告诉你一条最长链并不重要,工作量证明可以为自己代言。" "Proof-of-work has a beautiful property: it can be relayed through untrusted intermediaries. We don't need to worry about a chain coming from compromised communications. It doesn't matter who tells you about the longest chain — proof-of-work speaks for itself." — Satoshi, 2010-08-07

Author's Key Insights

"比特币这一划时代发明的终极本质——由可共识的随机性而涌现的秩序。" "The ultimate essence of this epoch-making invention called Bitcoin — order emerged from consensual randomness." — Liu Jiaolian, Foreword

"知史明智,数往知来。也许只有把比特币发明之前的有关的技术、经济、社会、文化的发展史和思想史的脉络进行较为系统的梳理和了解,才能够有助于我们更加准确地认识比特币诞生的历史基础。" "Know history to gain wisdom; study the past to understand the future. Perhaps only by systematically understanding the history of technology, economics, society, culture, and ideas that preceded Bitcoin's invention can we accurately recognize the historical foundation of Bitcoin's birth." — Liu Jiaolian, Preface

"在比特世界里,算力即真理。坚持用真理说服人,让潜在的攻击者知难而退,不战而屈人之兵。" "In the Bitcoin world, hash power is truth. Persisting in using truth to persuade, making potential attackers retreat before they fight — winning without fighting." — Liu Jiaolian, Chapter 13

"比特币系统所雇佣的这个掷骰子的上帝,就是密码学(数学)、算力(物理)和共识(博弈论)的结合体。上帝掷骰子,比特币向前进。" "The god that Bitcoin's system employs to roll its dice is the combination of cryptography (mathematics), hash power (physics), and consensus (game theory). God rolls the dice, and Bitcoin marches forward." — Liu Jiaolian, Foreword