UNIT- 3 Blockchain Architecture and Components
Blockchain Architecture and Components
1. Introduction to Blockchain Architecture
Blockchain is a decentralized and distributed ledger technology (DLT) that stores transactions
across a network of computers. Unlike traditional centralized systems, blockchain ensures
immutability, transparency, and security by recording data in linked blocks.
Each block contains transaction records, and these blocks are cryptographically connected, forming a
chain.
The architecture of blockchain is composed of several key components that together maintain its
trustless, secure, and decentralized nature.
2. Core Components of Blockchain Architecture
(a) Block
A block is the fundamental unit of blockchain.
Each block contains:
1. Block Header – Metadata about the block (e.g., block number, timestamp, nonce, difficulty,
Merkle root).
2. Block Body – Contains actual transaction records.
Structure of a Block:
Block Header
o Block version
o Previous block hash
o Merkle root
o Timestamp
o Difficulty target
o Nonce
Block Data
o List of valid transactions
(b) Transaction
A transaction is the smallest unit of operation in a blockchain, representing a data exchange (like
transfer of cryptocurrency, smart contract execution, or asset transfer).
Each transaction includes:
Sender’s address
Receiver’s address
Amount/data
Digital signature for authentication
(c) Chain
The chain is the sequential linking of blocks using cryptographic hashes.
Each block references the hash of the previous block.
This ensures immutability: changing one block would alter the entire chain, making
tampering nearly impossible.
(d) Peer-to-Peer (P2P) Network
Blockchain operates on a P2P distributed network where all nodes maintain a copy of the ledger.
Types of Nodes:
o Full Node – Maintains complete blockchain and validates transactions.
o Light Node – Stores partial blockchain for quick verification.
o Mining Node – Solves cryptographic puzzles to create new blocks.
The network enables consensus without a central authority.
(e) Consensus Mechanism
Consensus is the agreement process among nodes to validate transactions and add them to the
blockchain.
Common mechanisms include:
Proof of Work (PoW) – Requires solving complex puzzles (used in Bitcoin).
Proof of Stake (PoS) – Validators are chosen based on stake/ownership of coins.
Delegated Proof of Stake (DPoS) – Stakeholders elect delegates to validate transactions.
Practical Byzantine Fault Tolerance (PBFT) – Tolerates malicious nodes and ensures
agreement in distributed systems.
(f) Cryptography
Cryptography ensures security and integrity in blockchain.
Hash Functions (SHA-256, Keccak-256): Provide fixed-size output for any input; used in
linking blocks.
Public-Key Cryptography: Used for digital signatures, ensuring sender authenticity and data
integrity.
Merkle Tree: A binary tree of hashes that allows efficient and secure verification of large
data sets.
(g) Smart Contracts
A smart contract is a self-executing code stored on the blockchain that automatically executes
actions when predefined conditions are met.
Example: In Ethereum, smart contracts run on the Ethereum Virtual Machine (EVM).
(h) Wallets and Addresses
Wallets store cryptographic keys (private and public keys).
Address: A unique identifier derived from the public key, used to send/receive transactions.
(i) Ledger
The blockchain itself is a distributed ledger where all validated transactions are permanently stored.
Immutable (cannot be altered once recorded)
Transparent (all participants can verify transactions)
3. Characteristics of Blockchain Architecture
Decentralization – No central authority controls the system.
Transparency – All transactions are visible to participants.
Immutability – Once recorded, transactions cannot be changed.
Security – Strong cryptography prevents tampering.
Consensus-driven – Transactions are validated collectively.
Peer-to-Peer (P2P) Network in Blockchain
A Peer-to-Peer (P2P) network is the foundational communication model of blockchain. Unlike
traditional client-server architecture, where a centralized server manages data and transactions, in a
P2P network, all nodes (computers) are equal participants. Each node can act as both a client and a
server, meaning they can request and provide data simultaneously.
Blockchain relies on this decentralized structure to ensure transparency, security, and fault
tolerance.
Key Characteristics of P2P in Blockchain
1. Decentralization
o No central authority or server.
o Every node has a copy of the distributed ledger (blockchain).
2. Transparency
o All participants share the same data, so every transaction is visible to all nodes.
3. Security
o Data is secured using cryptography.
o Altering one copy of the ledger is useless because all nodes validate transactions.
4. Fault Tolerance
o Even if some nodes go offline, the network continues functioning.
5. Scalability
o Nodes can be added or removed without disrupting the network.
Working of P2P in Blockchain
1. Transaction Initiation
o A user (node) initiates a transaction (e.g., sending cryptocurrency).
2. Transaction Broadcast
o The transaction is broadcasted to all connected peer nodes.
3. Validation
o Each peer node verifies the transaction using consensus mechanisms (e.g., Proof of
Work, Proof of Stake).
4. Block Formation
o Validated transactions are grouped into blocks.
5. Block Propagation
o The new block is sent across the network so every peer updates its copy of the
blockchain.
6. Immutable Ledger
o All nodes store the updated blockchain, making the data tamper-proof.
Types of P2P Networks in Blockchain
1. Unstructured P2P – Random connections between peers.
2. Structured P2P – Organised connections using Distributed Hash Tables (DHT).
3. Hybrid P2P – Combines client-server and P2P for efficiency.
Advantages of P2P in Blockchain
Eliminates single point of failure.
Increases trust among participants.
Provides resistance against censorship.
Enhances data redundancy and availability.
Steps in Recording and Validating a Transaction in Blockchain
Blockchain records every transaction in a secure, transparent, and immutable way. The entire
process of recording and validating a transaction goes through multiple well-defined stages:
1. Transaction Initiation
A user creates a transaction request (e.g., sending cryptocurrency, executing a smart contract,
or transferring digital assets).
The transaction contains:
o Sender and receiver addresses
o Transaction amount/data
o Digital signature (generated using the sender’s private key for authenticity).
2. Transaction Broadcast
The transaction request is broadcast to the peer-to-peer (P2P) blockchain network.
All connected nodes receive the transaction and store it temporarily in the mempool
(unconfirmed transaction pool).
3. Transaction Verification
Network nodes verify the validity of the transaction by checking:
o Digital signature → confirms sender’s identity.
o Ownership and balance → ensures the sender has sufficient funds/assets.
o Double-spending check → prevents the same digital asset from being used twice.
o Protocol rules → ensures the transaction follows blockchain rules.
Only valid transactions are processed further.
4. Transaction Bundling into a Block
Verified transactions are grouped by a miner/validator into a candidate block.
The block contains:
o Transaction list
o Hash of the previous block (to maintain linkage)
o Merkle root of all transactions
o Timestamp, Nonce, and Block header information
5. Consensus Mechanism
The candidate block undergoes the blockchain’s consensus mechanism to be accepted.
o Proof of Work (PoW): Miners solve cryptographic puzzles.
o Proof of Stake (PoS): Validators are chosen based on stake.
o Other consensus models (PBFT, DPoS, etc.) depending on blockchain type.
This ensures agreement among nodes without a central authority.
6. Block Validation and Addition
After consensus, the block is considered valid.
It is added to the blockchain, forming a link with the previous block through its hash.
This ensures immutability — altering one block would break the entire chain.
7. Ledger Update
The distributed ledger across all network nodes is updated with the new block.
Every participant maintains the same synchronized copy of the blockchain.
8. Transaction Confirmation
Once the block is added, the transaction is permanently recorded.
Users receive confirmation.
In cryptocurrency systems, multiple confirmations (further blocks added after it) increase
the security of the transaction.
Immutability in Blockchain
One of the most defining features of blockchain is immutability — the inability to alter or delete data
once it is recorded. Immutability ensures that blockchain acts as a trustworthy, tamper-proof
ledger, which is why it is widely used in cryptocurrencies, supply chain tracking, healthcare records,
and other critical applications.
Blockchain achieves immutability not through a single mechanism, but through a combination of
cryptographic design, structural linking, consensus rules, and distributed validation.
1. Cryptographic Hashing of Blocks
Every block in a blockchain has a unique digital fingerprint known as a hash, generated by a
cryptographic hash function (e.g., SHA-256 in Bitcoin).
A hash is highly sensitive to input data: even changing a single letter or number in a
transaction creates a completely different hash value.
Each block contains its own hash and the hash of the previous block, thereby forming a
secure chain.
If someone tries to change the data inside one block, its hash changes immediately. This
makes all following blocks invalid because the ―chain of hashes‖ breaks.
Thus, cryptographic hashing provides a first layer of immutability by making any tampering
instantly detectable.
2. Linking of Blocks in a Chain
Blocks are not isolated; they are interconnected.
Block N contains the hash of Block N-1.
Block N+1 contains the hash of Block N.
This creates a linked structure where each block depends on the one before it.
If an attacker wants to modify Block 10 in a chain of 1,000 blocks, they would need to
recalculate the hash of Block 10, then Block 11, then Block 12, and so on — an impossible
task without enormous computational resources.
This interlinked structure ensures that data is historically permanent.
3. Consensus Mechanisms
Even if someone tries to modify blocks, blockchain has built-in consensus protocols that govern how
new blocks are validated and accepted.
In Proof of Work (PoW), a malicious actor would need to redo the computational work for
all subsequent blocks faster than the rest of the network.
In Proof of Stake (PoS), the attacker would need to control the majority of the
cryptocurrency stake to force acceptance of tampered blocks.
In both cases, the cost and difficulty of such an attack make manipulation practically infeasible.
4. Distributed Ledger Across Nodes
Blockchain is maintained on a peer-to-peer (P2P) network where thousands of nodes keep a
complete copy of the ledger.
If someone tries to tamper with their local copy, the other nodes reject it because it does not
match the majority.
This redundancy ensures that even if some nodes are compromised, the correct data is
preserved across the network.
This decentralization makes blockchain highly resistant to tampering or censorship.
5. Finality of Transactions
Once a transaction is confirmed and written into a block, and that block is added to the chain, it
becomes permanent. In most blockchains, after multiple confirmations (e.g., 6 confirmations in
Bitcoin), the probability of reversal becomes near zero. This ensures transaction finality — a
guarantee that data cannot be undone or overwritten.