Understanding distributed systems and the importance of decentralization.
To begin exploring the fundamentals of Blockchain technology, we must first understand what distributed systems are, as the roots of Blockchain technology are in distributed systems [1].
What are Distributed Systems?
Think of a distributed system like a group project with classmates spread across different locations. Each person has a copy of the project's main document (data replication) and is responsible for completing specific tasks (computational work). Even though everyone is working independently on their part, they stay in sync through regular updates to the shared document, so that in the end, it feels like a single, cohesive project.
This setup ensures that if someone’s computer goes down (node failure), the project isn’t lost because others have copies. Together, they maintain the project’s progress, making it feel to an outsider as if it’s a single, unified effort.
As you might be wondering, the description of a distributed system sounds so much like what a blockchain is. Well, there’s a key difference, and we’d explore that when describing decentralization.
It’s Distributed, So Why Decentralize?
Extending our analogy using the group project:
In a distributed system, everyone has a copy of the project and works independently on their tasks, but there’s still a project leader (the master node) coordinating who does what and when. This leader makes the final decisions, ensuring that everyone stays on track.
In a decentralized system, there’s no single project leader. Instead, each member has equal control and can coordinate with others directly. Decisions are made collaboratively, with everyone working together to keep the project aligned. If one person can’t participate, the project continues smoothly because the responsibilities are spread among all participants, not dependent on any single leader.
A Blockchain as a decentralized distributed system.
A typical blockchain system achieves decentralization by eliminating the project leader
from our analogy. Since a blockchain consists of multiple computers (or nodes) working independently, there must be a way for these nodes to agree on the project’s valid state. This agreement is managed through an algorithm known as a consensus mechanism.
To understand how nodes collaborate in a blockchain system, let’s explore three foundational elements that enable blockchain operations:
1. Communication: The Internet as the Blockchain’s Network
The communication layer of a blockchain is the internet itself, which was originally designed as a decentralized communication system. To ensure nodes on a blockchain network can share data efficiently, blockchains often use a gossip protocol [4]. This protocol allows each node to relay information (like transactions) to a small subset of other nodes, who then pass it along to others, much like a ripple effect. In this way, each transaction or piece of information propagates quickly and reaches most or all nodes without requiring a centralized broadcast.
2. Computation: Processing and Verifying Transactions
The computation layer is where nodes perform the work needed to verify transactions and execute the consensus mechanism. When a transaction is communicated across the network, each node independently verifies it, ensuring it adheres to network rules (like having sufficient balance for a transfer).
After transactions are verified, nodes package them into blocks and submit these blocks as candidates to be added to the blockchain. Depending on the consensus mechanism (like Proof of Work or Proof of Stake), nodes engage in different processes to agree on which block should be added next. This distributed computation replaces any single point of control, making the system resistant to centralized influence.
3. Storage: Keeping the Blockchain’s History
Finally, the storage layer in a blockchain ensures every node can access the full history of transactions (or, at least, sufficient parts of it). Once a block is finalized through consensus, it is added to the blockchain, which is essentially a distributed ledger stored across all participating nodes. This means each node has a copy of the blockchain’s history, which guarantees data availability and integrity.
These three layers work together to allow decentralized blockchains to achieve a unified, immutable record of transactions without relying on any single, centralized authority. The communication layer spreads transactions, the computation layer verifies and orders them, and the storage layer preserves them, creating a resilient and transparent system that reflects a single shared truth.
Technical Exercise: Building Your Own Gossip Protocol.
To solidify the concept of distributed systems, this exercise guides you in creating a simple gossip protocol using TypeScript and Node.js. This hands-on activity will help you experience how nodes communicate in a decentralized network, allowing you to grasp the fundamentals of data sharing and consistency.
In this exercise, you’ll learn how to:
Establish node-to-node communication using UDP, simulating peer connections.
Create and propagate messages that include essential information, like a unique message ID, content, and a time-to-live (TTL) to prevent endless propagation.
Ensure message consistency across multiple nodes, mimicking real-world gossip protocols used in blockchain networks.
As you progress, each node in the network will propagate messages to a subset of its peers, creating a self-propagating message network where data consistency is achieved through simple, randomized sharing. This exercise offers a practical approach to understanding how a decentralized network operates, as each node independently receives, verifies, and distributes data without relying on a central controller.
This exercise provides a foundational experience that mirrors how many blockchain networks ensure data propagation and consistency—so, once you've completed it, you'll have hands-on knowledge to apply as you explore more advanced blockchain concepts.
References
Bashir, Imran. Mastering Blockchain: Distributed ledger technology, decentralization, and smart contracts explained. Packt Publishing, 2018, pp. 12.
Bashir, Imran. Mastering Blockchain: Distributed ledger technology, decentralization, and smart contracts explained. Packt Publishing, 2018, pp. 44.
Bashir, Imran. Mastering Blockchain: Distributed ledger technology, decentralization, and smart contracts explained. Packt Publishing, 2018, pp. 36.
Bashir, Imran. Mastering Blockchain: Distributed ledger technology, decentralization, and smart contracts explained. Packt Publishing, 2018, pp. 23.