// 0. Introduction & Problem Statement

Abstract: Core Proposal

A purely peer-to-peer electronic cash system is proposed, enabling direct online payments without financial intermediaries. Digital signatures provide ownership, but the double-spending problem is addressed using a P2P network that timestamps transactions into a hash-based Proof-of-Work chain. This chain forms an immutable record, with the longest chain representing the consensus view, secured by majority CPU power.

The Problem: Trust-Based Model Limitations

Current internet commerce relies on trusted third parties. This model prevents truly non-reversible transactions, adds mediation costs hindering small payments, burdens merchants with trust/fraud concerns, and lacks the finality of physical cash.

Trust Model Drawbacks:
  • Reversibility & Cost
  • Microtransaction Barrier
  • Trust Burden
  • Lack of Finality
The Solution: Cryptographic Proof System

The goal is an electronic payment system based on cryptographic proof, not trust. Enabling direct P2P transactions, using computational proof to prevent double-spending and make reversals impractical.

System Design Goals:
  • Peer-to-Peer
  • Trustless Operation
  • Double-Spending Prevention
  • Computational Irreversibility
  • Public Transaction Order Proof
  • Majority CPU Power Security

// I. Core Technical Components

Spec §2: Transactions (Ownership & Structure)

Coin = chain of digital signatures. Owner signs hash(prev_TX) + next_owner_pubkey. Payee verifies chain. Uses ECDSA signatures (secp256k1). Basic structure: Inputs (prev_out, scriptSig), Outputs (value, scriptPubKey). Solves ownership, but not double-spending.

Ownership & Verification:
  • Signature Algorithm: ECDSA over secp256k1 curve (*Standardized post-whitepaper*).
  • Signatures prove private key authorization for spending inputs.
Basic Transaction Structure (Conceptual):
// Simplified Transaction Structure
Transaction {
  Version         // uint32_t
  Inputs[] {        // List of inputs
    PrevTxHash      // 32-byte hash
    PrevOutputIndex // uint32_t
    ScriptSig       // Variable length unlocking script
  }
  Outputs[] {       // List of outputs
    Value           // uint64_t (Satoshis)
    ScriptPubKey    // Variable length locking script
  }
  Locktime        // uint32_t
}
Hashing:
  • TXID: SHA256(SHA256(serialized_transaction)).
  • Address Hash (P2PKH): RIPEMD160(SHA256(PublicKey)).
Still Needs Double-Spend Prevention
Spec §3: Timestamp Server (Ordering Concept)

Concept: Distributed server timestamps blocks by hashing them. Each timestamp hash includes the previous timestamp hash, creating a reinforcing chain for chronological ordering.

Spec §4: Proof-of-Work (Implementation)

P2P timestamping via PoW. Nodes vary Nonce in block header until hash is below Target: SHA256(SHA256(header)) < Target. Makes chain immutable; longest chain = consensus.

Proof-of-Work Algorithm:
// Find Nonce such that:
SHA256(SHA256(BlockHeader)) < CurrentTarget
Block Header Structure (Core Fields - Approx 80 bytes):
BlockHeader {
  Version        // int32_t
  PrevBlockHash  // uint256 (32 bytes)
  MerkleRoot     // uint256 (32 bytes)
  Timestamp      // uint32_t (Unix epoch)
  Bits           // uint32_t (Encoded Target)
  Nonce          // uint32_t
}
Consensus & Immutability:
  • Finding valid nonce is computationally expensive.
  • Changing past block requires re-doing PoW for it and all successors.
  • Longest chain (most cumulative PoW) is the accepted history.
Spec §5: Network (Operation Principles)

Nodes broadcast TXs & blocks. Validate received data. Build on longest valid chain. Minimal structure. *Network message protocol implementation-defined.*

Operational Flow Principles:
  1. Broadcast valid TXs.
  2. Collect TXs into blocks.
  3. Find PoW.
  4. Broadcast valid block.
  5. Validate received block & TXs.
  6. Accept valid block & build on it.
Consensus Dynamics:
  • Always extend the longest valid chain. Resolve forks via subsequent blocks.

// II. Economic & Consensus Rules

Spec §6: Incentive Model & Issuance

Incentives: Block Reward (Coinbase) + Transaction Fees. Initial reward: 50 BTC, halves every 210,000 blocks (~4 yrs). Max supply: ~21 Million BTC.

Coin Issuance (Coinbase Reward Schedule):
INITIAL_REWARD = 50 * 100_000_000; // Satoshis (50 BTC)
HALVING_INTERVAL = 210_000;        // Blocks

// Function to calculate reward for a given block height
function calculate_reward(height) {
  halvings = height / HALVING_INTERVAL;
  if (halvings >= 64) return 0; // Reward becomes 0 after 64 halvings
  reward = INITIAL_REWARD >> halvings; // Right-shift is equivalent to dividing by 2^halvings
  return reward;
}

// Example Heights:
// Height 0:       Reward = 50 BTC
// Height 210,000: Reward = 25 BTC
// Height 420,000: Reward = 12.5 BTC
// ...
// Total Supply converges towards 21 Million BTC
Transaction Fees:
  • Fee = `Sum(Input Values) - Sum(Output Values)`
Consensus Rule: Difficulty Adjustment

PoW Target adjusts every 2016 blocks (~2 weeks) aiming for 10 min block time. Uses ratio of actual vs target time for last interval, clamped to 0.25x - 4x change.

Difficulty Adjustment Logic (Conceptual):
// Constants
TARGET_TIMESPAN      = 14 * 24 * 60 * 60; // 2 weeks in seconds
INTERVAL           = 2016;              // Blocks
MIN_ADJUST_FACTOR  = 0.25;
MAX_ADJUST_FACTOR  = 4.0;

// At block height H divisible by INTERVAL:
current_block = get_block(H - 1);
first_block   = get_block(H - INTERVAL);

actual_timespan = current_block.timestamp - first_block.timestamp;

// Clamp actual_timespan to avoid extreme adjustments
clamped_timespan = max(TARGET_TIMESPAN * MIN_ADJUST_FACTOR,
                   min(actual_timespan, TARGET_TIMESPAN * MAX_ADJUST_FACTOR));

// Calculate new target
old_target = decode_target_from_bits(current_block.bits);
new_target = (old_target * clamped_timespan) / TARGET_TIMESPAN;

// Ensure new_target does not exceed maximum possible target
new_target = min(new_target, MAX_TARGET);

new_bits = encode_target_to_bits(new_target);
// Use new_bits in the header for the next INTERVAL blocks
  • Maintains ~10 minute average block time despite hashrate fluctuations.

// III. Optimizations & Usage Patterns

Spec §7: Reclaiming Disk Space (Merkle Trees)

Allows pruning old spent TXs via Merkle Tree. Only Merkle Root in header. Uses SHA256(SHA256(...)) tree hashing. Enables SPV and reduces storage.

Merkle Tree Construction & Pruning:
  • TXIDs form leaves. Pairs hashed iteratively (SHA256(SHA256(L+R))) to get root.
  • Root stored in header proves TX inclusion with minimal data (Merkle branch).
  • Allows full nodes to discard old, fully spent transaction data ("prune").
Spec §8: Simplified Payment Verification (SPV)

Verify payments without full node. SPV clients get headers, request Merkle branch to prove TX inclusion. Efficient but less secure (trusts longest chain validity).

Lightweight Verification Process:
  1. Get longest chain of headers.
  2. Request Merkle proof for specific TXID.
  3. Verify proof against header's Merkle Root.
  • Security Tradeoff: Vulnerable to 51% attacks providing fake history. Doesn't validate all rules.
Spec §9: Combining/Splitting Value (UTXOs)

Transactions use multiple inputs (spending UTXOs) and create multiple outputs (new UTXOs). Efficiently manages value flow like digital cash/change.

Spec §10: Privacy (Pseudonymity & Address Gen.)

Privacy via anonymous public keys (pseudonymity). Public sees TXs between addresses. Use new keys per TX. Address (P2PKH): Base58Check(RIPEMD160(SHA256(pubkey))).

Address Generation (Conceptual P2PKH Flow):
PrivateKey --ECDSA(secp256k1)--> PublicKey
Hash160 = RIPEMD160(SHA256(PublicKey))
Address = Base58CheckEncode(VersionByte + Hash160)
  • *Note: SegWit/Taproot use different address formats/derivations.*
Privacy Limitations:
  • Multi-input TXs link ownership. Address reuse harms privacy. External linking (KYC) possible.

// IV. Security Calculations

Spec §11: Calculations (Attacker Success Probability)

Analyzes attacker probability (q = attacker hash power fraction) of reversing a TX from z confirmations behind. Modeled as Gambler's Ruin. Probability drops exponentially with z if p > q (honest majority).

Double-Spend Attack Analysis (Gambler's Ruin):
p = probability honest network finds next block
q = probability attacker finds next block (hash power fraction)
z = number of confirmations attacker is behind

// Prob. attacker *ever* catches up from z blocks behind
P_catchup = (q / p)**z;             // If p > q
P_catchup = 1;                   // If p <= q

// Probability attacker succeeds after recipient waits for z blocks
// Involves Poisson distribution for attacker progress during wait time
lambda = z * (q / p);  // Expected attacker blocks during wait
P_success = Sum[k=0 to infinity] ( // Sum over possible attacker progress k
             (exp(-lambda) * lambda**k / k!) * // Poisson probability of k blocks
             (min(1, (q/p)**(z-k)) )   // Prob. catching up from remaining deficit
           ); // Simplified - see paper for exact calculation/rearrangement
  • Shows strong probabilistic security increasing with confirmations.

// V. Protocol Evolution & Modern Context

Major Protocol Upgrades (Soft Forks)

Bitcoin evolves via backwards-compatible Soft Forks. Key upgrades: P2SH (BIP 16) for script hashes, SegWit (BIPs 141-144) for efficiency & malleability fix, Taproot (BIPs 340-342) for Schnorr sigs & script improvements.

Significant Soft Forks:
  • P2SH (2012): Simplified complex scripts (like multisig).
  • SegWit (2017): Increased effective block space (via block weight), fixed malleability, enabled Lightning Network scaling.
  • Taproot (2021): Introduced Schnorr signatures (efficiency, privacy potential), MAST (complex scripts look simple), Tapscript (future scripting flexibility).
Other Consensus Rule Changes

Key consensus rules added/changed: Formalized Block Size Limit (later Block Weight with SegWit), added script Timelocks (CLTV - BIP 65, CSV - BIP 112) enabling payment channels.

Change Mechanisms (BIPs & Forks)

Changes proposed via BIPs, activated via Soft Forks (backwards-compatible, opt-in for new rules). Hard Forks (non-backwards-compatible) generally require near-universal consensus and are rare/contentious.

Layer 2 Scaling (Lightning Network)

Lightning Network built on Bitcoin enables fast, cheap, off-chain payments via channels, settling net results on-chain. Addresses base layer transaction throughput limitations. Enabled largely by SegWit and Timelocks.

Mining Hardware Evolution

Mining evolved: CPU -> GPU -> FPGA -> ASIC. ASICs dominate, massively increasing network hashrate and security cost, but centralizing hardware production and raising entry barriers.

Privacy Context: Pseudonymity Reality

Bitcoin offers pseudonymity, not anonymity. Address reuse, multi-input linking, and external data (KYC) allow chain analysis. Advanced techniques (CoinJoin, Taproot benefits) aim to improve privacy but are not foolproof.

// VI. Conclusion, Implementation Gaps & Resources

Spec §12: Conclusion

Satoshi proposed a trustless P2P electronic cash system using digital signatures and PoW consensus (longest chain) to prevent double-spending. Relies on simple rules, incentives, and majority CPU power.

Implementation Gaps in Whitepaper

Whitepaper provides concepts. Implementation requires details NOT specified: P2P protocol, Script opcodes/limits, Full Consensus Rules (block weight, etc.), Serialization, Fork Activation mechanisms.

Areas Requiring External Specification / Implementation Choices:
  • P2P Network Protocol & Messages
  • Scripting System Details & Opcodes
  • Full Consensus Rules (Block Weight, Coinbase Maturity, etc.)
  • Data Serialization Formats
  • ECDSA Curve (`secp256k1`)
  • Resources: Dev Guide, Wiki, BIPs Repo.
Whitepaper Key Terms

Quick definitions of core concepts from the paper.

Block
Timestamped collection of TXs secured by PoW.
Blockchain
Chain of blocks; public ledger.
Difficulty
Measure of how hard it is to find PoW hash.
Digital Signature
Proof of ownership via private key (ECDSA).
Double-Spending
Spending same money twice.
Hash
Cryptographic fingerprint (SHA256, RIPEMD160).
Incentive
Block reward + TX fees.
Longest Chain
Chain with most PoW; consensus history.
Merkle Tree
Hash tree summarizing TXs in a block.
Nonce
Value varied in header to find PoW.
Proof-of-Work (PoW)
Consensus mechanism requiring CPU effort.
SPV
Simplified Payment Verification.
Target
Threshold hash value must be below for PoW.
UTXO
Unspent Transaction Output (spendable coin).
Foundational & Developer Resources

Links to the original paper and essential developer resources.

Essential Links:
Cited Precursors/Concepts:
  • Hashcash Paper
  • B-money Paper
  • Timestamping (Haber/Stornetta Refs [3,4])
  • Merkle Trees (Merkle Ref [7])