Imagine an engineer building a towering skyscraper, an awe-inspiring structure that helps reshape the skyline of a city. The question is, “What makes it possible?” Is it just the grand design at the top that captures everyone’s attention?
No. It is the countless layers of steel, concrete, and infrastructure beneath the surface. That is what provides essential support and stability.
The same is true of Web3; the blockchain is our digital skyscraper, and its layers are the unseen architects — like the various layers of steel and concrete. Together, they work to shape the digital skyline that is Web3. But what are these layers? And how can we be sure they are strong enough to hold the blockchain?
This article will help you uncover these layers and better understand the intricate workings of the blockchain — even if you’re just a curious beginner.
To begin, are all blockchains the same?
Types Of Blockchains
Just like skyscrapers, there are different types of blockchains. Some allow you free access. Others? Not so much.
There are 4 types of blockchains:
- Public Blockchains
- Private Blockchains
- Hybrid Blockchains
- Consortium Blockchains
What features differentiate them from each other?
Public blockchains are blockchains that are open and permissionless. Anyone who wishes can share in validating transactions and contributing to the network. This is possible because public blockchains rely on a variety of consensus mechanisms to maintain the integrity of the ledger. However, scalability is usually a challenge on public blockchains. (Scalability will be explained in detail later.) Bitcoin and Ethereum are well-known examples.
Private blockchains are restricted and permissioned systems. A specific group or organization controls who accesses and participates in a private blockchain. They offer increased privacy and control over networks and data.
This, however, results in sacrificing the decentralization and openness characteristic of public blockchains. They are commonly used in industries where data privacy and restricted access are critical, such as supply chain management and enterprise solutions. Corda is an example of a private blockchain.
Hybrid blockchains combine elements of both public and private blockchains. Certain parts of the network are open to public participation and validation, while other parts are restricted and permissioned.
This design allows for flexibility in balancing the need for transparency and decentralization with the requirement for control and privacy. Hybrid blockchains desire to get the best out of public and private blockchains. Dragonchain is a prime example.
For consortium blockchains, a group of organizations or entities collaboratively maintain and control the network. Only a select group of trusted participants have the authority to validate transactions and maintain the ledger.
Consortium blockchains are often used where multiple organizations need to work together and share resources while still maintaining a degree of control over the blockchain’s operation. Hyperledger Fabric is an example of a consortium blockchain.
Layers of Blockchain Architecture
We mentioned at the outset that countless layers of steel, concrete, and infrastructure come together to form a skyscraper. The same thing is true of the blockchain.
There are 6 (5+1) layers of the blockchain (see if you can find the +1):
- The Hardware Layer
- The Data Layer
- The Network Layer
- The Consensus (Protocol) Layer
- Services and Optional Components Layer
- The Application Layer
What roles do each of these play in the workings of the blockchain?
The Hardware Layer
The hardware layer is the physical infrastructure and devices that support and enable the functioning of a blockchain network — all the physical stuff that makes it work.
In this layer, there are miners and validators — especially in blockchains that use Proof-of-Work consensus (like Bitcoin and Ethereum before). Miners are the builders; they use special machines (like powerful computers with graphics cards, fans, and stabilizers, popularly called GPU units) and electricity to create new blocks of data.
Validators are the supervisors; they run nodes (which are basically software programs) to confirm the blocks that are created and keep the system running smoothly.
To store all the blockchain data, some blockchains use special decentralized services like Filecoin, IPFS, Arweave, or Firebase. This is because the amounts of data generated are usually massive.
Within this hardware layer, you’ll also find different types of nodes or clients. There are full nodes that store the entire history of the blockchain, participate in important decision-making, and provide data when needed. Light nodes are the ‘quick summary’ version of nodes, while archive nodes store every little detail of transactions from the very beginning.
Additionally, the hardware layer includes something called virtual machines. They are the operating systems for smart contracts. Different blockchains use different virtual machines. For example, Ethereum has the Ethereum Virtual Machine (EVM). (This will be explained better in subsequent articles.)
The Data Layer
The data layer is the storage unit. It’s where all the important information is kept, and it’s structured in a specific way. It is just like building blocks in a line. These blocks store information about transactions like who sent what to whom, when it happened, and the quantity of what was sent.
The organization of blocks varies depending on the blockchain. For example, while Bitcoin uses a simple list of transactions, Ethereum is a bit fancier using something called a “state trie” to store information about smart contracts.
If you’re not entirely new to Web 3 or cryptocurrency, you might have heard of something called “public-private key pairs.”. Let’s explain this.
When you make a transaction on a blockchain, you use a public key. This is your address saying where the money should go. It’s just like getting a courier service to make a delivery to your front door.
However, you have a private key, which is like the key you use in entering your house which is at that address — something the delivery man cannot do. Private keys are what keep your data safe and ensure that only you can access and control your assets.
Now here’s the cool part; Every time a transaction happens, it is accompanied by a digital signature. With the help of a cryptographic mechanism, a signature is affixed and the correct private key is validated for the transaction without revealing what the signature is. No falsification of signatures.
Cryptographic signatures are created by signature algorithms. Two examples of such algorithms are The Elliptic Curve Digital Signature Algorithm and the Rivest–Shamir–Adleman.
The Network layer
The network layer is the communication system that connects all the participants in the blockchain. It allows computers and devices around the world to share information securely and quickly.
It’s like a vast network of physical roads and highways — in this case, allowing data to travel from one place to another. It is this layer that allows someone living in New York to make a transaction that moves swiftly and safely reaches someone in Lagos.
But how does it work? Computers and devices, which are typically called “nodes,” need to find each other so they can start working together. Each node sends out signals to find another node. Once they find each other, they form a connection and share information.
To ensure all this information is safe and unchanged while moving around, the network layer uses something called a Trusted Execution Environment (TEE).
How long does all this take? It depends totally on the blockchain. For example, Ethereum uses something called Recursive Length Prefixes. Like traffic rules, Recursive Length Prefixes define how long it takes for nodes to find each other, detect compatibility, and share data securely.
The Consensus (Protocol) Layer
The consensus layer is the referee and rule-setter of the system. Its primary job is to ensure that everyone in the blockchain network agrees on which transactions are valid and should be added to the blockchain. It is the mechanism that prevents any single person or group from bending the rules or cheating the system.
You know when you and your friends play a game and someone is appointed to decide the rules and keep track of the score? Exactly, the consensus layer does something similar for blockchain. It lays down the rules, checks that everyone is following them, and ensures that no one can manipulate the game.
Different blockchains “play by” different sets of rules, and these rules are set by something called protocols. These protocols include the consensus mechanisms and other rules governing how the blockchain works.
Consensus mechanisms differ between blockchains. For example, some blockchains like Bitcoin use Proof-of-Work, where participants compete to solve complex puzzles. Others, like Ethereum, use Proof-of-Stake, where validators are chosen based on how much cryptocurrency they “stake” as collateral.
In addition to the rules, the consensus layer manages how decisions are shared among participants using something called the propagation protocol. And to keep everything safe, there are protocol audits that make sure no one can break the rules and cheat — you could call them regular security checks.
Sometimes, blockchains also have what we call “sidechains.” Sidechains have their own consensus mechanisms and operate on their own rules. However, they are designed to give enhanced capabilities to the main chain. An example of a sidechain-mainchain relationship is that between Polygon and Ethereum.
Services And Optional Components Layer
The services and optional components layer is a toolbox filled with valuable tools and features that enhance the performance and possibilities of a blockchain network. Developers can choose from a variety of options to customize their blockchain and make it even more versatile, thanks to this layer.
The most exciting thing this layer does is create a bridge between the blockchain world, known as Web3, and the wider internet. It is always removing barriers and ensuring smooth communication between the blockchain and everything else online.
In this layer, you find components like Decentralized Autonomous Organizations (DAOs). These are committees that help manage and communicate within networks like Arbitrum and Polygon. However, you won’t find them on every blockchain. For example, Bitcoin and Ethereum operate differently.
Another nifty tool in this layer is the concept of oracles. Oracles are information messengers that bring real-world data, like the prices of assets, into the blockchain world. They help with tasks that require data from outside the blockchain. This makes it possible for the blockchain to perform calculations that rely on real-world information.
Then we have hot wallets. Hot wallets are digital wallets that store your blockchain assets and also serve as access points to interact with the blockchain. Some examples of hot wallets include Metamask and Bitget.
Last but not least, there are block explorers. These are the health monitors of the blockchain. They keep track of how everything works and detect technical problems and security issues early.
And yes, you guessed correctly. It’s the “+1.”
The Application Layer
The application layer is the final destination of the entire blockchain system. This is where users find specific products and services designed for their needs. It’s where you’ll find digital wallets for storing cryptocurrencies, lending platforms, and staking services.
At the heart of this layer is the “smart contract.” A smart contract is a set of self-executing computer instructions that determine how things work on the blockchain. It can handle various tasks, such as acting as an escrow for secure transactions, managing payment channels, or safeguarding assets in a vault.
Smart contracts have different names in different blockchain ecosystems. They are called “programs” in Solana or “chaincode” in Hyperledger.
However, here’s a thing to keep in mind: smart contracts can be vulnerable to attacks if there are errors in their code. They are attractive targets for hackers because any critical mistake in the code can be exploited for illegal gains. So, they need to be developed with the utmost care and undergo multiple thorough security checks.
Users usually do not interact directly with smart contracts. Instead, they rely on a front end, which is either a user-friendly website, an application, or both. It’s like the user interface (UI) of your smartphone apps, like Facebook or X.
This front end, or UI, makes it easy for you to use blockchain services without any of the technical complexities. An example of this is the Uniswap website, which combines a user-friendly interface with the power of smart contracts to enable decentralized trading of cryptocurrencies.
Blockchain Layers Explained
A skyscraper has multiple floors. The same thing applies to the blockchain.
The blockchain has 4 “floors”:
- Layer 0
- Layer 1
- Layer 2
- Layer 3
Are there any differences between the “floors”?
Layer 0, often referred to as “layer zero blockchain,” is the foundational layer of the entire blockchain ecosystem. All the hardware components required to make blockchain a reality come together in Layer 0.
These components include the internet, hardware, networking protocols, and various connections that enable the higher layers of the blockchain to work.
One crucial role of Layer 0 is to facilitate cross-chain interoperability. This means that it allows different blockchains to communicate and interact with each other, thereby creating a network that goes beyond the boundaries of a single blockchain. It’s like building bridges that connect various islands, enabling data and assets to flow between them.
Layer 1, often referred to as “L1,” is the first layer built on top of the foundational Layer 0. It is the cornerstone of the blockchain world and serves as the foundational level for blockchain technology. The most critical decisions about how a blockchain works are made here.
Two prominent examples of Layer 1 blockchains are Ethereum and Bitcoin, which are dominant players in the world of Web3. L1 blockchains are usually open for anyone to participate in and don’t require special permission.
A typical Layer 1 blockchain includes all the essential components of blockchain architecture — consensus mechanisms, data storage, and networking protocols.
One thing to note, however, is that the scalability of many Layer 1 blockchains is limited due to certain technical limitations. To address this, some Layer 1 blockchains have taken proactive steps to implement native scaling solutions.
For example, Ethereum is working on a technique called sharding to significantly boost its transaction processing capacity, aiming to make it faster and more efficient.
Layer 2, often referred to as “L2,” is the second layer built on top of the foundational L1. It is the extra boost that makes blockchain technology even more efficient. L2’s main job is to improve the scalability and performance of blockchain networks, making them faster and more cost-effective.
L2 blockchains achieve this by processing transactions with higher throughput and lower transaction fees (often referred to as “gas fees”). Layer 2 gets the best of both worlds: the security of Layer 1 and the speed and cost-efficiency of Layer 2.
Layer 2 blockchains use different consensus mechanisms compared to Layer 1. This means they have their own set of rules for confirming and validating transactions.
Layer 2 employs various creative methods to achieve its scaling goals. These can include running a side chain, using state channels, implementing rollup technologies, or even nested blockchains. Each of these approaches has its own way of optimizing how transactions are processed and settled, all while reducing the load on Layer 1.
A couple of standout examples are the Lightning Network and Stack. These are remarkable implementations of Layer 2 technology that enhance the Bitcoin network’s scalability and speed.
Layer 3, commonly called the “application layer,” is the top level of the blockchain stack. Its primary role is to host decentralized applications (DApps) and the various protocols that make other applications possible.
In this layer, the blockchain protocol is split into two significant sub-layers: the application layer and the execution layer. The application layer is where DApps and other applications operate. The execution layer handles the technical processes that make these applications function smoothly.
One of the most exciting features of Layer 3 is its capacity to separate blockchains and enable cross-chain capabilities — a crucial step towards achieving true interoperability.
Scalability, Security, Decentralization, and The Blockchain
They are the very foundation upon which the blockchain is built. But what are they?
What is Blockchain Scalability?
Blockchain scalability is the ability of a blockchain network to handle multiple transactions or operations efficiently as the network grows. It is all about how well a blockchain can scale up to accommodate more users, transactions, and data without slowing down or becoming too expensive to use.
Scalability is a critical aspect of blockchain technology because it determines how practical and useful a blockchain network is in the real world. A highly scalable blockchain can support a large number of users and transactions.
This would make it suitable for various applications — everything from simple peer-to-peer payments to complex smart contracts and DApps.
Blockchain scalability is often measured in terms of transactions per second (TPS) or operations per second (OPS). A blockchain that can process a higher TPS or OPS is considered more scalable because it can handle a larger volume of transactions within a given time frame.
What is Blockchain Security?
Blockchain security refers to the measures and mechanisms that protect a blockchain network and its data from unauthorized access, fraud, and tampering. It ensures the integrity, confidentiality, and availability of data and transactions within the blockchain.
This is especially crucial because blockchains are decentralized and immutable — once data is added to the blockchain, it cannot be altered or deleted. This makes them attractive targets for malicious actors.
Some popular security measures include encryption, consensus mechanisms, and cryptographic techniques.
It involves not only safeguarding data but also protecting the network itself. This involves preventing attacks like 51% attacks, where a single entity gains control of the majority of the network’s computational power, and could compromise the network’s integrity.
What is Blockchain Decentralization?
Blockchain decentralization is how control and decision-making are distributed across a network of participants rather than relying on a single central authority. In a decentralized blockchain network, no single entity has complete control over the network’s operations.
Instead, multiple independent participants, often referred to as nodes, collectively maintain and secure the blockchain. These nodes work together to validate transactions, reach consensus on the state of the blockchain, and ensure the integrity of the network.
Decentralization aims to eliminate the need for intermediaries and create a trustless environment where participants can interact directly and transparently.
The Blockchain Trilemma
There is a challenge of achieving a balance between the three fundamental aspects of blockchain technology mentioned above.
A theory suggests that it’s difficult to maximize all three of these aspects simultaneously; Improving one may come at the cost of the others. For example, increasing scalability might require sacrificing some degree of decentralization, or enhancing security might impact scalability.
That theory is called The Blockchain Trilemma.
In conclusion, understanding the layers of blockchain architecture is essential to fully understanding and benefiting from Web3. Just as a skyscraper relies on its structural layers for stability, the blockchain depends on its digital layers to ensure trust, security, and functionality.
More importantly, we hope it helps YOU and other scores of individuals and organizations harness the full potential of blockchain as the world keeps heading toward a decentralized future.
But for that to work, the blockchain trilemma has to be solved, right? Do you think the blockchain trilemma can be solved? Let us know in the comments.
Also, share this piece with your friends and subscribe to our newsletter so you do not miss our piece on solving the blockchain trilemma.