Skip to content
ComputerCS
Start learning

Emerging Technologies · Lesson 6.4–6.5

Blockchain Technology: Structure, Applications and Implications

Study peer-to-peer distributed ledgers, blocks and hashes, immutability, consensus, cryptocurrencies, smart contracts, supply-chain tracking, Blockchain 2.0 and the practical limits of the technology.

01

Learning objectives

  • Explain how peer-to-peer participants maintain a shared ledger.
  • Describe blocks, cryptographic hashes, previous-block references and immutability.
  • Explain how consensus helps participants agree on the accepted ledger.
  • Identify cryptocurrency, smart contracts and product tracking as blockchain applications.
  • Describe Blockchain 2.0 and decentralised applications at a basic level.
  • Evaluate security, privacy, performance, governance and resource implications.
02

Lesson notes

Blockchain is a type of distributed ledger: participating computers keep and update copies of a shared record according to agreed protocol rules. In a peer-to-peer (P2P) network, participants communicate directly with other network participants rather than relying entirely on one central server. P2P communication helps distribute the ledger, but participants still need rules for validating transactions and agreeing on the accepted history.

A block groups a set of records or transactions. It normally includes its own data, a timestamp or other metadata, and a cryptographic hash reference to the preceding block. A cryptographic hash maps input data to a fixed-length digest. Changing the contents of an earlier block changes its digest, so the reference stored in the next block no longer matches. This makes tampering detectable; it does not mean data can never be changed or that every claim entered into the ledger is true.

Consensus is the procedure by which distributed participants agree on which transactions and blocks are accepted. Different blockchains use different consensus approaches and assumptions. Consensus helps nodes coordinate a shared ledger even when they do not all trust one central administrator. It does not automatically make a blockchain private, inexpensive or suitable for every use case.

Cryptocurrencies use blockchain-like ledgers to record transfers of digital tokens. Smart contracts are programs deployed to a blockchain that execute when defined conditions are met. They can support automated token transfers, agreements or supply-chain processes. A smart contract only acts on the information and rules available to it; coding defects, inaccurate external data and governance disputes remain possible.

Blockchain can support product tracking by recording events such as manufacture, shipment and receipt across organisations. Participants may be able to verify that a record has not been silently changed after it was accepted. The original event still needs trustworthy evidence: a blockchain cannot independently prove that a physical shipment actually contained the stated product.

Blockchain 2.0 refers to uses beyond simple cryptocurrency transfers, especially programmable smart contracts and decentralised applications. Potential benefits include shared records and programmable workflows; trade-offs include transaction throughput, latency, storage growth, energy or resource use, privacy and governance. If a single trusted organisation can operate an ordinary database, a blockchain may add complexity without delivering useful value.

03

Worked code examples

Worked example

The example demonstrates that even a small change in input produces a different SHA-256 digest. A real blockchain also needs validation rules, peer-to-peer communication and consensus.

import hashlib
previous_hash = "0" * 64
record = "Product batch A received at warehouse 2"
digest = hashlib.sha256((previous_hash + record).encode()).hexdigest()
changed = hashlib.sha256((previous_hash + record + "!").encode()).hexdigest()
print("Original:", digest[:16])
print("Changed:", changed[:16])
print("Hashes differ:", digest != changed)
Output
Original: 47cf72d9b818e190
Changed: fd462a5b33dd15cb
Hashes differ: True
04

Key terminology

Distributed ledger

A record shared and maintained by multiple participating nodes.

Peer-to-peer network

A network in which participants communicate directly with other participants.

Hash

A fixed-length digest computed from input data.

Immutability

The property that accepted records are difficult to alter without detection.

Consensus

Rules that allow distributed participants to agree on the accepted ledger state.

Smart contract

Code that executes on a blockchain according to defined conditions.

Blockchain 2.0

Blockchain applications that use programmable contracts and decentralised applications beyond basic token transfers.

05

Common misconceptions

Common mistake

A blockchain proves that the real-world event recorded in it was true.

Correct understanding

It can help protect the record after acceptance, but the original input still needs trustworthy verification.

Common mistake

Every blockchain is anonymous and private.

Correct understanding

Some ledgers are public and transparent; identity and privacy properties depend on the design.

Common mistake

Blockchain is always better than a conventional database.

Correct understanding

A shared ledger is useful only when its trust model and benefits justify its complexity and cost.

06

Check your understanding

1. What is the role of a previous-block hash?

2. Why are peer-to-peer networks important in many blockchains?

3. Blockchain 2.0 is associated with:

NERDLYY · FEEDBACK

Help shape Nerdlyy

Your feedback goes directly to the team. We read every submission.

No reply needed — you can send feedback without sharing contact details.