Skip to main content

Introduction to Blockchain

Learning Objectives

  • Define blockchain and explain how it differs from a traditional centralized database
  • Identify the core components of a blockchain: blocks, chain, nodes, miners, and consensus
  • Trace the step-by-step process of how a transaction becomes a permanent block
  • Explain why blockchains are considered tamper-resistant and who verifies that claim
  • Evaluate real-world applications of blockchain beyond cryptocurrency
  • Recognize common misconceptions about what blockchain can and cannot do

Quick Answer

A blockchain is a distributed digital ledger shared across many computers (nodes) that records transactions in linked, cryptographically-sealed blocks instead of a single central database. Each new block references the previous one through a cryptographic hash, so altering any past record would break every block after it — making the history extremely hard to tamper with. No single company or government owns it; instead, the network agrees on the valid state through a consensus mechanism. Blockchain matters because it lets strangers who don't trust each other agree on a shared set of facts — who owns what, what happened, in what order — without needing a bank, notary, or middleman to referee. This idea underpins cryptocurrencies like Bitcoin, but it has since spread to supply chains, identity systems, and digital contracts.

What Is Blockchain?

Think of blockchain as a shared notebook that thousands of people keep identical copies of. Whenever someone writes a new entry (a transaction), everyone with a copy checks that it's valid, and only then does it get added — to every copy, at the same time. No single person can secretly go back and erase or change a page, because everyone else's notebook would disagree with theirs.

Technically, blockchain is a distributed ledger: a database replicated across a peer-to-peer network of nodes, where entries are grouped into blocks and linked using cryptographic hashes. It combines three older ideas — cryptographic hashing, peer-to-peer networking, and consensus algorithms — into one system that produces trust without a trusted middleman.

Why it matters: Before blockchain, if two parties who didn't know or trust each other wanted to transact digitally, they needed a bank, a government registry, or some other central authority to keep the official record. Blockchain shows that a network of mutually distrusting computers can maintain one authoritative, tamper-evident record together.

Common misunderstanding: Students often think "blockchain" and "Bitcoin" are the same thing. Bitcoin is one application built on blockchain technology (specifically, a payment system). Blockchain itself is the underlying data structure and protocol — it can store far more than currency transactions, including contracts, medical records, or supply chain events.

Key Components of Blockchain

Every blockchain system is built from five core pieces:

  1. Blocks — A block is a batch of transactions bundled together with a timestamp and a reference (hash) to the previous block. Think of it as one page in the shared notebook.
  2. Chain — Blocks are linked in order by embedding the hash of the previous block inside the next one. This chaining is what makes tampering detectable: change one block, and its hash changes, breaking the link to every block after it.
  3. Nodes — Computers that keep a full or partial copy of the blockchain and help relay and validate transactions. More independent nodes generally means a more resilient, harder-to-attack network.
  4. Miners (or Validators) — Specialized participants who bundle pending transactions into new blocks and compete or are selected to add the next block, earning a reward for doing so correctly.
  5. Consensus Mechanism — The rulebook that lets thousands of independent nodes agree on a single, shared version of the truth without a central referee (for example, Proof of Work or Proof of Stake — covered in detail in the Blockchain Security chapter).

Real-world example: In Bitcoin, a block currently holds roughly 2,000–3,000 transactions, is produced roughly every 10 minutes, and is linked to the previous block via a SHA-256 hash. Thousands of nodes worldwide each hold a full copy of this chain, so no single machine failure or bad actor can silently rewrite history.

Why it matters: Understanding these five pieces individually is what lets you reason about blockchain trade-offs later — for instance, why more nodes improve security but slow down consensus, or why miners need a financial incentive to behave honestly.

Common misunderstanding: Students often assume "the blockchain" lives on one server somewhere. In a public blockchain, there is no single server — the ledger only exists as the sum of what all participating nodes agree on.

How Blockchain Works

Here is the life cycle of a single transaction, from creation to becoming a permanent part of history:

  1. Transaction Creation — A user signs a transaction with their private key and broadcasts it to the peer-to-peer network.
  2. Verification — Nodes independently check the transaction's digital signature and confirm the sender actually has the funds or rights being transferred.
  3. Block Creation — Miners or validators collect a batch of verified, pending transactions into a candidate block.
  4. Consensus (e.g., Proof-of-Work) — Depending on the protocol, miners compete to solve a computational puzzle (PoW) or are selected based on stake (PoS) to propose the next block.
  5. Block Addition — The winning block is appended to the chain and broadcast to the rest of the network.
  6. Network Update — Every node updates its local copy of the ledger to include the new block, and the transaction is now considered confirmed.

Real-world example: When Alice sends 1 BTC to Bob, that transaction sits in a "mempool" of unconfirmed transactions until a miner includes it in a block. After roughly one confirmation (~10 minutes), and especially after 6 confirmations, the transaction is treated as effectively irreversible by exchanges and merchants.

Why it matters: This process is what gives blockchain its two headline properties: transparency (anyone can inspect the ledger) and tamper resistance (rewriting history means redoing the consensus work for every subsequent block, on a majority of the network, faster than everyone else combined).

Common misunderstanding: "Confirmed" doesn't mean "instant." Many students assume blockchain transactions settle immediately; in practice there's a deliberate delay (multiple confirmations) built in precisely so that the network has time to reach consensus and reduce the risk of temporary forks.

Applications of Blockchain in Computer Science

Blockchain's real value shows up wherever multiple parties need a shared, trustworthy record without a common trusted authority:

  1. Cryptocurrency Systems — Bitcoin and Ethereum use blockchain to enable peer-to-peer value transfer without banks as intermediaries.
  2. Supply Chain Management — Walmart and Maersk use blockchain to track goods from origin to shelf, making fraud and contamination sources easier to trace.
  3. Smart Contracts — Self-executing code stored on a blockchain that automatically enforces agreed-upon terms (covered in depth in the next chapter).
  4. Identity Verification — Blockchain-based systems let individuals control and selectively share verified identity credentials.
  5. Healthcare Records — Distributed, tamper-evident storage for medical records that can be shared securely across providers.

Why it matters: These applications share a pattern — multiple mutually distrusting parties (competitors, governments, patients, and hospitals) need to agree on facts without one of them being the sole gatekeeper. Recognizing this pattern is how you evaluate whether a "we're putting X on the blockchain" pitch is genuinely useful or just marketing.

Common misunderstanding: Not every data problem needs a blockchain. If a single trusted organization is fine (e.g., a company's own internal inventory database), a regular database is faster, cheaper, and simpler. Blockchain earns its overhead only when trust must be distributed among multiple independent parties.

Practical Examples

Example 1: Cryptocurrency Transaction

Alice wants to send 1 BTC to Bob:

  1. Alice initiates the transaction through her wallet software, signing it with her private key.
  2. The transaction is broadcast to the Bitcoin network.
  3. Miners verify the transaction and group it with others into a candidate block.
  4. Once mined, the block is added to the blockchain, updating both Alice's and Bob's balances across every node's copy of the ledger.

Example 2: Supply Chain Tracking

A farmer grows wheat and sells it to a miller:

  1. The farmer registers a "wheat" token on the blockchain representing a specific batch.
  2. When the wheat is harvested, the farmer updates the token's status.
  3. When the wheat is transported to the miller, the miller receives the token and records receipt.
  4. Every step is permanently recorded, so a food-safety regulator or retailer can trace the batch's full history in seconds instead of days.

Key Terms

TermDefinition
BlockchainA distributed, append-only ledger of transactions replicated across a network of nodes and linked via cryptographic hashes.
BlockA batch of verified transactions bundled together with a timestamp and a reference to the previous block.
NodeA computer participating in the blockchain network, typically holding a copy of the ledger and relaying/validating transactions.
Miner / ValidatorA network participant that proposes new blocks by solving a puzzle (mining) or being selected based on stake (validating).
Consensus MechanismThe protocol (e.g., Proof of Work, Proof of Stake) that lets a decentralized network agree on the valid state of the ledger.
DecentralizationThe absence of a single controlling authority; control and record-keeping are spread across many independent participants.
ImmutabilityThe property that once data is recorded and confirmed, it is computationally impractical to alter without detection.
Distributed LedgerA database whose complete or partial copy is shared, synchronized, and maintained across multiple independent locations/nodes.

Common Mistakes

Misconception 1: "Blockchain and Bitcoin are the same thing." Why it's wrong: Bitcoin is one specific application (a digital currency) built using blockchain technology. Conflating the two hides the fact that blockchain is a general-purpose data structure usable for many other purposes. Correct understanding: Blockchain is the underlying technology; Bitcoin, Ethereum, supply-chain platforms, and smart contract systems are all separate applications built on top of (possibly different) blockchains.

Misconception 2: "Data on a blockchain is impossible to change, period." Why it's wrong: Blockchains are tamper-evident and tamper-resistant, not tamper-proof. If an attacker controls enough of the network's computing power or stake (a "51% attack"), they can rewrite recent history — it's just extremely expensive and detectable. Correct understanding: Immutability is a strong practical guarantee backed by economics and cryptography, not an absolute mathematical impossibility.

Misconception 3: "Blockchain transactions are instant and free." Why it's wrong: Every transaction must be broadcast, verified, and included in a block through a consensus process, which takes time (minutes on Bitcoin) and usually costs a transaction fee to incentivize miners/validators. Correct understanding: Speed and cost vary by platform and network congestion; blockchains trade some speed and cost for security and decentralization compared to a centralized database.

Comparison and Connections

AspectTraditional Centralized DatabaseBlockchain
ControlSingle organization owns and can modify dataDistributed among network participants
Trust modelYou trust the organization running the databaseYou trust the protocol and cryptography, not any one party
SpeedVery fast (no consensus needed)Slower (requires network-wide consensus)
ModifiabilityRecords can be edited or deleted by administratorsRecords are practically immutable once confirmed
Failure modeSingle point of failureResilient to individual node failure
Best suited forInternal systems with one trusted operatorMulti-party systems with no single trusted authority

Practice Questions

Recall 1: What are the five core components of a blockchain? Answer guidance: Blocks, chain, nodes, miners/validators, and the consensus mechanism — with a one-line description of each.

Recall 2: Define "consensus mechanism" in your own words. Answer guidance: The protocol that lets a decentralized set of nodes agree on the single valid state of the ledger without a central authority making the call.

Understanding 1: Explain why chaining blocks together using hashes makes tampering detectable. Answer guidance: Each block's hash depends on its own content plus the previous block's hash; changing any past transaction changes that block's hash, which no longer matches what the next block references, breaking the chain and alerting all nodes.

Understanding 2: Why can't a single company just run its own private "blockchain" and get the same trust benefits as Bitcoin? Answer guidance: If one company controls all the nodes, it could theoretically rewrite history at will; the trust in public blockchains comes specifically from many independent, mutually distrusting parties validating the ledger.

Application 1: A hospital network wants multiple independent clinics to share patient records without any one clinic controlling the master copy. Would blockchain be a reasonable fit? Justify your answer. Answer guidance: Yes, potentially — multiple independent parties (clinics) need a shared, trustworthy, auditable record with no single trusted party; blockchain's decentralization and tamper-evidence fit this scenario, though privacy of medical data (who can read what) still needs a separate solution such as permissioned access or off-chain encrypted storage.

Application 2: A single retailer wants to track its own internal warehouse inventory. Would blockchain add value here? Justify your answer. Answer guidance: Generally no — there's only one trusted party (the retailer), so a normal database is faster, cheaper, and simpler; blockchain's overhead (consensus, replication) buys decentralization benefits that aren't needed when there's no multi-party trust problem.

Analysis 1: Compare a 51% attack on a Proof-of-Work blockchain to an insider attack on a centralized database. What is similar and what is different about the risk? Answer guidance: Both represent a trusted-majority failure; the centralized case requires compromising one organization's access controls, while the 51% attack requires controlling a majority of network-wide computing power — generally far more expensive and visible on large public chains, which is why bigger networks are considered more secure.

Analysis 2: Evaluate the trade-off blockchain makes between speed and trust compared to a centralized ledger. Answer guidance: Blockchain sacrifices raw speed and adds fees/latency (waiting for consensus and confirmations) in exchange for removing the need to trust a single central party; whether this trade-off is worth it depends on whether the use case actually has a multi-party trust problem to solve.

FAQ

Is blockchain the same as cryptocurrency? No. Cryptocurrency is one application of blockchain technology. Blockchain is the general-purpose distributed ledger structure; cryptocurrencies are digital money systems built on top of it.

Who owns a public blockchain like Bitcoin's? No single entity owns it. It's maintained collectively by all the nodes and miners/validators who choose to participate, following the shared protocol rules.

Can blockchain data ever be deleted? Practically, no — once a transaction is confirmed with enough subsequent blocks built on top of it, removing or altering it would require redoing all that consensus work, which is economically infeasible on large networks.

Why do blockchains need miners or validators at all? Someone has to propose the next block and be economically incentivized to follow the rules honestly; miners/validators do this work in exchange for block rewards and/or transaction fees.

Is blockchain always better than a regular database? No. Blockchain is worth its overhead only when multiple independent parties need to trust a shared record without one central authority. For single-owner data, a conventional database is simpler and faster.

Quick Revision

  • Blockchain = a distributed, append-only ledger replicated across many nodes, linked via cryptographic hashes.
  • Core components: blocks, chain, nodes, miners/validators, consensus mechanism.
  • Each block references the hash of the previous block — this chaining makes tampering detectable.
  • Transaction lifecycle: create → broadcast → verify → bundle into block → consensus → append → network updates.
  • Blockchain is tamper-resistant, not tamper-proof (a 51% attack is theoretically possible but expensive).
  • Decentralization removes the need for a single trusted intermediary.
  • Bitcoin is an application of blockchain, not a synonym for it.
  • Blockchain trades speed/cost for trust and resilience compared to centralized databases.
  • Applications beyond currency: supply chain tracking, smart contracts, identity verification, healthcare records.
  • Use blockchain when multiple mutually distrusting parties need a shared source of truth; skip it for single-owner data.
  • Consensus mechanisms (Proof of Work, Proof of Stake, etc.) are what let decentralized nodes agree without a referee.
  • More independent nodes generally means stronger security but slower consensus.

Prerequisites: Basic understanding of hashing and cryptographic hash functions; basic networking concepts (peer-to-peer networks); familiarity with digital signatures/public-key cryptography is helpful.

Related Topics: Distributed systems and the CAP theorem; peer-to-peer networking; digital signatures and public-key infrastructure.

Next Topics: Smart Contracts (see next chapter); Blockchain Platforms (Ethereum, Hyperledger, Corda); Blockchain Security and Privacy (consensus mechanisms, cryptography, and attack vectors in depth).