Back to blogs
Written by
Cyfrin Team
Published on
April 30, 2024

Blockchain Architecture Layers: Guide and Topology

Learn the intricacies of blockchain architectures like Ethereum and Bitcoin, broken down into easy-to-understand pieces. From functional layers to layers 1 and 2.

Table of Contents

When discussing blockchain architecture, we refer to the components, layers, and overall technology that comprise a complete blockchain system. Each layer has a unique role, from storing data to maintaining network connectivity and ensuring consensus across the system.

Understanding how these layers work together to make up a system is crucial for blockchain, smart contract developers, and anyone seeking to leverage blockchain technology effectively.

In this article, we’ve broken down the intricacies of blockchain architectures into easy-to-understand pieces. We’ll explain what is the scalability trilemma, what blockchain functional layers are and how they work together to form the architecture of the layer 1,2, and 3 chains we’ve heard about.

Before getting into the different parts making up a complete blockchain architecture, it is important to understand the issues that all of these components try to solve: making the blockchain scalable.

What is blockchain scalability?

The term "scaling" in blockchain technology means improving the system's (chain) capacity for processing transactions, typically measured in transactions per second or TPS, a key metric that defines the ability of a payment system to serve, or not, a considerable number of users.

This isn’t a new metric for payment systems - Visa, for example, a traditional payment system, can handle more than 65,000 TPS. On the other hand, Bitcoin has a TPS (transactions per second) processing power of only 4 to 7. This makes chains need to scale and improve their ability to serve more users (transactions per second).

The reality is that scaling a chain isn’t as simple as it sounds. There’s in fact one issue - called the Blockchain Scalability Trilemma.

The Blockchain Scalability Trilemma

Vitalik Buterin first coined this term to describe the three properties that a high-performing blockchain must have:‍

Decentralization

Security

Scalability

Image showing the scalability trilemma every blockchain architecture has
The scalability trilemma describes blockchain architecture limitations

‍The thesis of this trilemma is that a blockchain can only achieve two of these three goals simultaneously.

The trilemma suggests that making a blockchain highly scalable and secure might require some degree of centralization. If you want it to be highly decentralized and secure, it might struggle with scalability, as each node in the network might have, for example, to validate every transactions, which can slow down processing times and increase costs.

To solve this problem, clever developers have decided to take blockchains like Ethereum or Bitcoin and instead of trying to create a single chain that is both scalable, secure, and decentralized, they would make two chains:

  • Layer 1 (Ethereum, Bitcoin):  to focus on fundamental changes in blockchains at their core
  • Layer 2 (zkSync, LightingNetwork): to add additional structures on top of layer 1 to enhance performance without compromising the blockchain's core functionality. For example, if a layer one blockchain focuses on security and decentralization, it can be the job of an L2 to focus on scale.

Before getting too in-depth into what Layer 1 and Layer 2 blockchains are, let’s understand what we mean when we refer to the term “layer” in the context of blockchain architectures.

What is a blockchain Layer?

When we talk about blockchain layers, there are two types of layers we can refer to in the context of a blockchain architecture:

  • Functional layers: these layers are the core components that dictate a blockchain’s basic operations, security measures, and application support.
  • Blockchain layers: These layers represent the tech stacks developed to solve one or multiple parts of the scalability trilemma addressing chain-specific challenges and are usually known as layer 1, layer 2, layer 3, etc.

Functional Blockchain layers

Imagine a blockchain as a cake.

Each layer from the bottom up is essential, forming the structure and functionality of the whole. The functional layers are the ingredients' mixing methods and baking to create a functional and delicious base cake (blockchain).

Image showing the blockchain architecture layers composing a chain stack

Let’s see what those layers are:

Type of Blockchain  Description  Keywords 
Hardware Layer  Provides the necessary infrastructure to host a blockchain  Hardware, mining equipment, computerss 
Data Layer  Ensures secure and persistant message transmission.  Blocks, ledger, signature algorithms, cryptographic keys 
Network Layer  Provides the technology fo peer node interaction  p2p network 
Consensus Layer  Set rules for node agreement on the current chain state  Based on Proof-of-work, Proof-of-stake, Delegated-proof-of-stake 
Application Layer  Provides blockchain-based applications for the end user  Smart contracts, Dapps 

Hardware/infrastructure layer

Blockchain architecture extends to both hardware and infrastructure. This forms the physical foundation of the blockchain, encompassing all the necessary infrastructure for executing computational work, processing transactions, and performing cryptographic calculations. This includes servers, computers, and mining equipment.

The infrastructure layer also comprises virtual machines, which function like operating systems and host smart contracts. Blockchains frequently have their native virtual machines, like the Ethereum Virtual Machine for Ethereum.

Data layer

This layer stores the chain's transaction history and ledger data in a structured and immutable way. The data is organized into blocks. Each block is cryptographically linked to the one before it, forming a chain. This chain offers a secure and unchangeable record of transactions.

Although the details of transaction addition and hashing aren't the main focus, it's crucial to acknowledge the data layer's role in safeguarding integrity and privacy. This layer defines most cryptographic primitives used in the protocol–signature algorithms, such as the elliptic curve digital signature algorithm, cryptographic libraries, and public-private key pairs.

Network Layer

The network layer enables effective discovery and interaction among peers, called nodes.

The Network layer manages the communication protocols that connect nodes within the chain. This layer is essential to maintaining the decentralization nature of the blockchain, allowing peer-to-peer transactions.

Consensus Layer

This layer achieves agreement among its nodes on the validity of transactions. It employs several mechanisms like PoW (Proof-of-Work), PoS (Proof-of-Stake), or DPos (Delegated-Proof-of-Stake), each with its method for validating transactions and securing the networks.

Note that, for example, ETH's consensus mechanism is Gasper and not proof-of-stake. Proof-of-stake is a part of it's consensus mechanism.

Application Layer

The application layer is the end product of the entire system offering specific products for the users, i.e., wallet, lending, staking, etc.

This is the layer on which smart contracts and apps are built, as well as any other software that runs on the top of the chain. This layer is the interface between the blockchain and its users, making the technology accessible and usable for various purposes.

The combination of the functional layers led to the creation of a new blockchain (cake), also known as Layer 1 - which is also a layer, but very different.

Blockchain Architecture Layers

As we said above, all blockchain functional layers work together to form another type of layer, the architecture layer - what we refer to when we call Layer 1, 2 and 3 blockchains

image showing how all the blockchain functional layers put together, merge to create a blokchain layer 1

There are 4 common types of Blockchain layers:

Chain  Description 
Layer 0  Provides blockchain-based applications for the end user. 
Layer 1  Provides the necessary capacities to host a blockchain. 
Layer 2  Ensures secure and confident message transmission 
Layer 3  Provides for peer node interaction 

Layer 0 Blockchain

Layer 0 Blockchain aim to exchange the interoperability between different chains and ensure the robustness of the underlying infrastructure. This includes interoperability protocols, network consensus mechanisms, and the foundational internet and hardware supporting the chain.

Layer 1 Blockchain

Layer 1 blockchains are an improvement over layer 0, the layer on which the blockchain functionality is maintained, which is known as the implementation layer and includes chains like Ethereum, Bitcoin, and Solana.

Layer 2 Blockchain

Layer 2 blockchains are meant to extend the functionality of the Layer 1, often processing transactions off the main chain (L1) and then sending the transactions as batches back to the L1 to “settle”. Layer 2 solutions have many optimizations and scalability solutions to increase performance, reduce latency, and lower gas fees. However, there are also examples of L2s that don’t process transactions and instead extend some other blockchain functionality. For example, an oracle solution (where it gets real-world data and computation) is also considered an L2.

Layer 2 solutions use a lot of different mechanisms to achieve scalability. Here are some examples of popular ones:

  • Blockchain Rollups (zkSync, optimism) - Rollups gather multiple transactions into a single package and process them off the main chain.
  • Nested Blockchains (OMG Foundation) - This structure allows the parent blockchain to delegate transactions to the child chains, reducing the main chain's workload
  • State Channels (Bitcoin Lightning, Ethereum's Raiden Network) - Allow participants to conduct numerous transactions amongst themselves off-chain, using a multi-signature wallet as a secure intermediary

Layer 3 Blockchain

Layer 3 blockchains include cross-chain applications, user interface designs, and APIs, allowing easy interaction with the chain. L3 aims to abstract most of the chain's inner complexity to offer end-users and developers a simplified and integrated experience across various chains.

Before wrapping, it is important to understand that other than differences in functional layers or additional technologies implemented, blockchain architectures can vary based on the type of the blockchain, its goal, and target use cases.

Types of Blockchain architectures

When we talk about blockchain architectures is also imporant to note that Blockchains can be permissioned (limiting access) or permissionless (open to all), this distiction creates 4 types of blockchain architectures, each solving a different problem and focusing on different components of the scalability trilemma:

Type  Description  Permissions  Scalability  Example 
Public Blockchain  A decentralized blockchain accessible to anyone with an internet connection  Permissionless  Limited  Bitcoin 
Private Blockchain  A blockchain that is only accessible to a select group of individuals, nodes, or organizations  Permissioned  High  Corda 
Hybrid Blockchain  A blockchain that combines the features of both public and private blockchains  Permissioned  High  Dragonchain 
Consortium Blockchain  A blockchain that is governed by a consortium of organizations or nodes  Permissioned  High  R3 Corda, Hyperledger Fabric 

Public Blockchains

Public blockchains are open to everyone and do not have permission restrictions. They utilize various consensus mechanisms. However, due to the growing demands of a large user base, scalability can pose a challenge. Bitcoin and Ethereum are prime examples of public blockchains.

Private Blockchains

Private blockchains cater to enterprise needs. They are permissioned blockchains, accessible only to certain individuals, typically within business organizations. Hyperledger Fabric is a well-known private blockchain.

Hybrid Blockchains

Public and private blockchains each have their own strengths and weaknesses. Hybrid blockchains, aim to combine the best features of both types.

Consortium Blockchains

Consortium blockchains are owned and managed collaboratively. They are formed when several private nodes come together to create a consortium blockchain.

Blockchain architecture summary

In conclusion, it is critical for developers and users to understand how chains work, blockchain architectures, and their underlying technology, including the various functional and blockchain layers.

As we’ve seen, each blockchain layer serves a unique purpose, contributing to a blockchain system's overall functionality and success.

As the technology evolves and matures, we may see new layers and architectures emerge that further enhance its capabilities. We encourage you to keep exploring, learning, and innovating in this exciting field.

If you want to learn more about smart contract development, security, and how blockchain works, sign up on Cyfrin Updraft and get access to 70hrs+ of web3 development courses, completely for free.

Happy Coding!‍

Secure your protocol today

Join some of the biggest protocols and companies in creating a better internet. Our security researchers will help you throughout the whole process.
Stay on the bleeding edge of security
Carefully crafted, short smart contract security tips and news freshly delivered every week.