Skip to main content

Bitcoin Protocol

The Bitcoin protocol is a set of consensus rules governing peer-to-peer electronic cash. First released by Satoshi Nakamoto in 2009, it combines cryptography, game theory, and distributed systems to create a monetary network without central authority.

Core Primitives​

Hash Functions​

Hash functions serve as "digital fingerprints" that protect data integrity throughout the protocol.

  • Fixed length — SHA-256 always outputs 256 bits regardless of input size
  • Deterministic — same input always produces the same output
  • One-way — computationally infeasible to reverse (2^256 possibilities)
  • Avalanche effect — a single bit change produces an entirely different hash

The Blockchain​

The blockchain is a linked list of blocks, each cryptographically tied to its predecessor.

  • Hash + Public + Linked = Blockchain
  • Historical precedent: Stuart Haber and Surety LLC published hashes in the New York Times as a "trust anchor" starting in 1995
  • Bitcoin maintains decentralization via >20,000 nodes actively validating the chain

Consensus: Proof-of-Work​

  1. Hash all data in a candidate block
  2. Check if the result has enough leading zeros
  3. If NO: change the nonce and repeat
  4. If YES: broadcast the valid block to the network
  • Target time: ~10 minutes per block
  • Difficulty adjustment: every 2,016 blocks (~2 weeks)
  • Supply cap: strictly limited to 21 million bitcoin

Halving Schedule​

EraBlock RewardApproximate Dates
150 BTC2009 — 2012
225 BTC2012 — 2016
312.5 BTC2016 — 2020
46.25 BTC2020 — 2024
53.125 BTC2024 — 2028

Each halving reduces the issuance rate, asymptotically approaching the 21-million-coin limit.

Transactions and Ownership​

Bitcoin tracks unspent transaction outputs (UTXOs), not account balances.

  • Private key — unlocks and signs transactions (must be kept secret)
  • Public key — locks bitcoin to a receiving address (can be shared)
  • Address — a hash of the public key plus checksum, presented to payers

Script and Address Types​

Bitcoin uses a scripting system (Script) to define spending conditions. Over time, new address types have improved efficiency and functionality:

TypeNamePrefixNotes
P2PKPay to PubKey—Simplest; used in early coinbase outputs
P2PKHPay to PubKey Hash1Standard for years; hashes the public key
P2SHPay to Script Hash3Enables multisig and complex scripts
P2WPKHSegWit v0 (Bech32)bc1qWitness data segregated; malleability fix
P2TRTaproot (Bech32m)bc1pSchnorr + Merkle trees; privacy for complex scripts

SegWit (2017)​

Segregated Witness moved signature data outside the base transaction structure, fixing transaction malleability and increasing effective block capacity. This change was critical for enabling the Lightning Network.

Taproot (2021)​

Taproot introduced Schnorr signatures and MAST (Merkelized Abstract Syntax Trees), allowing complex spending conditions to look identical to simple single-sig transactions on-chain. This improves privacy and efficiency for multisig and smart contracts.

Node Types​

  • Mining nodes — perform Proof-of-Work to produce new blocks
  • Economic nodes — validate all transactions and blocks, enforcing consensus rules
  • Pruned nodes — validate the full chain but discard old blocks to save space
  • SPV clients — query full nodes for specific transactions without full validation

Network Effects​

Bitcoin benefits from a QWERTY-style network effect: the value of the protocol increases as more participants adopt it. This decentralization cannot be easily replicated — the same coordination problem that makes Bitcoin resistant to attack also makes competitors unlikely to achieve similar security.

Software Implementations​

ImplementationLanguageRole
Bitcoin CoreC++Reference implementation
Bitcoin KnotsC++Fork with stricter policies
LibbitcoinC++Alternative implementation
Bitcoin-SScalaDeveloper toolkit
btcdGoUsed by LND (historically)

Resources​