Skip to content

How Blockchain Works

Blocks, hashes, consensus — an illustrated guide to the distributed ledger technology behind Bitcoin.

6 min read

Key points

Blockchain is a distributed ledger that bundles transactions into blocks linked by cryptographic hashes, secured through hash functions, Merkle trees, Proof-of-Work consensus, and full-node verification. Beyond transaction data, the chain also permanently stores human-readable messages, showing it functions as more than just a monetary system.

What Is a Blockchain?

  • A blockchain is a distributed database that bundles transaction data into units called "blocks" and links them chronologically like a "chain."
  • Traditional databases are managed by central authorities like banks. A blockchain, by contrast, has tens of thousands of computers (nodes) across the network holding identical copies of the data.
  • Its structure makes data tampering virtually impossible, and it is hailed as revolutionary technology for sharing "truth" without a trusted third party.

Block Structure

  • Each block consists of three main elements: ① a collection of transaction data, ② the hash of the previous block, and ③ a nonce (a one-time random number).
  • The block header contains version information, the previous block's hash, the Merkle root (a summary hash of all transactions), a timestamp, the difficulty target, and the nonce.
  • Bitcoin's effective block size is approximately 1–4MB (post-SegWit weight limit), capable of storing around 2,000–3,000 transactions.
  • New blocks are generated approximately every 10 minutes. This interval is automatically maintained by the "difficulty adjustment" mechanism.
Each block stores the previous block's hash, so editing a block in the middle changes its own hash and no longer matches what the next block recorded — the chain breaks.

Cryptographic Hash Functions

  • A hash function is a one-way function that converts data of any length into a fixed-length string (hash value). Bitcoin uses the SHA-256 algorithm.
  • Key properties of hashes: ① The same input always produces the same output (determinism). ② Changing just one bit of input completely changes the output (avalanche effect). ③ It's impossible to reverse-engineer the input from the output (one-way property).
  • For example, the SHA-256 hash of "Hello" and "Hello!" are completely different. This property is the cornerstone of blockchain security.
  • Because each block contains the hash of the previous block, tampering with a past block would change the hashes of all subsequent blocks. This creates tamper resistance.

Merkle Trees

  • A Merkle tree (hash tree) is a data structure for efficiently summarizing and verifying large amounts of transaction data. Ralph Merkle patented it in 1979.
  • How it works: Hash each transaction in pairs, then hash those results in pairs, and so on until a single "Merkle root" is produced.
  • The Merkle root is included in the block header. This allows verification of whether a specific transaction is included in a block without downloading all transaction data (SPV: Simplified Payment Verification).
  • This mechanism enables lightweight devices like smartphones to verify Bitcoin transactions.

Consensus Mechanisms

  • Consensus refers to the mechanism by which a decentralized network without a central authority agrees on "which transactions are valid."
  • Bitcoin uses Proof of Work (PoW). Miners perform enormous amounts of computation, and the first to find a hash value meeting certain conditions earns the right to create a block.
  • This computation requires massive amounts of electricity and computing resources. The cost of creating a fraudulent block far exceeds the cost of mining honestly, so the economic incentive promotes honest behavior.
  • Longest chain rule: When the network forks, the chain with the most cumulative computational work (usually the longest chain) is considered the canonical one.

The Role of Nodes

  • A node is a computer running Bitcoin software and maintaining a complete copy of the blockchain. As of 2026, roughly 20,000-30,000 "reachable" full nodes — those accepting incoming connections — are observed, while the total including nodes behind NAT or firewalls is estimated at anywhere from tens of thousands to around 100,000. Counts vary widely by methodology, and since the long-standing standard tracker ceased operating in May 2026 there has been no single authoritative figure, so published numbers should be read as broad estimates.
  • Full nodes validate every transaction and block. Even if a miner creates a rule-violating block, full nodes will reject it, maintaining the integrity of the entire network.
  • Light nodes (SPV nodes) download only block headers and use Merkle trees to verify only the transactions they need. These are used in mobile wallets.
  • Anyone can run a full node without special permission. This "permissionless" nature underpins Bitcoin's censorship resistance.

How Transactions Work

  • Bitcoin transactions are based on the "UTXO (Unspent Transaction Output)" model. Rather than a bank-account-style "balance," your balance is the sum of unspent "coins" received from past transactions.
  • To send Bitcoin, you specify your UTXOs as inputs and set the recipient's address and amount as outputs. Any remainder is returned to you as "change."
  • Transactions include a fee (miner fee). Higher fees mean miners process your transaction with priority, so fees rise during network congestion.
  • Transactions first enter the "mempool" and are confirmed when a miner includes them in a block. Typically, 6 block confirmations (about 60 minutes) make a transaction practically irreversible.

Forks

  • A fork occurs when the blockchain's protocol rules are changed, causing a divergence.
  • Soft fork: A backward-compatible upgrade. Older-version nodes still recognize new blocks as valid. SegWit is an example of a soft fork.
  • Hard fork: A non-backward-compatible upgrade. Older-version nodes consider new blocks invalid, causing a permanent chain split. Bitcoin Cash and Bitcoin SV are examples of hard forks.
  • Forks are an important aspect of Bitcoin's decentralized governance. Anyone can propose code changes, but they won't take effect unless a majority of network participants adopt them.

Blockchain Security

  • 51% attack: Theoretically, controlling more than half the network's computing power would enable double spending and transaction censorship. However, Bitcoin's computing power is so vast that the attack cost would be astronomical.
  • As of 2026, Bitcoin's hash rate has reached approximately 900–1,000 EH/s, briefly surpassing 1 ZH/s (zetahash) in early 2026. Executing a 51% attack would require surpassing the combined computing power of all miners worldwide.
  • Bitcoin's network has never been down since its launch in 2009, boasting an uptime of over 99.98%. There is no planned downtime.
  • Security rests on three pillars: cryptography, economic incentives, and decentralization. It is their combination — not any single factor — that makes Bitcoin robust.

Messages Inscribed in the Blockchain

  • Bitcoin's blockchain contains more than just transaction data — numerous human-readable "messages" are permanently embedded within it. Through coinbase transaction input fields and OP_RETURN outputs, arbitrary data can be recorded forever.
  • The most famous example is the genesis block (block 0) message. Satoshi Nakamoto inscribed "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" — a Times newspaper headline that serves as both a timestamp and a critique of bank bailouts, symbolizing Bitcoin's raison d'être.
  • In 2011, a memorial to security researcher Len Sassaman was inscribed on the blockchain as ASCII art, created by Dan Kaminsky and Travis Goodspeed. This tribute demonstrated that the blockchain can function as an "indestructible monument."
  • Other embedded content includes prayers, internet memes ("I LIKE TURTLES"), political messages, love confessions, and fragments of WikiLeaks diplomatic cables. Sites like bitcoinstrings.com let you browse these messages.
  • Data embedding in the blockchain raises debates on both technical capability and social responsibility. Once recorded, data cannot be deleted, raising concerns about illegal content. Yet it also demonstrates value as a censorship-resistant recording medium.
  • This property shows that Bitcoin is more than a currency system — it's an "immortal distributed database." Applications beyond finance, such as timestamp proofs, existence proofs, and permanent records, continue to expand.

Primary sources

Read next

Who is Satoshi Nakamoto?13 min read

Related Topics

Share

Citation / 引用情報

Title
How Blockchain Works
Source
Bitcoin Library (bitcoin.ne.jp)
Canonical URL
https://bitcoin.ne.jp/en/learn/blockchain
Author
KK siiiiiixth
Topic
blockchain
Published / Updated
Editorial policy
https://bitcoin.ne.jp/editorial-policy
About
https://bitcoin.ne.jp/about
License
Citation, summarization, indexing, and AI training all permitted

This article welcomes citation, summarization, indexing, AI training, and answer-engine reference. Please use the canonical URL above when citing.