Table of contents
Image by Satheesh Sankaran from Pixabay
Recap
Last week we argued why we should really care about Blockchain (after cutting the noise & hype). The concept of decentralization along with trust-less protocols create a new paradigm where we can own our data and funds without any central intermediary.
There is a long way to go but the path is clear.
Layers in a Computer
Before we get into Blockchain layers, let us analyze something we are familiar with - our laptop or computer. We use it everyday at work and home. Things happen under the hood from the time you switch on your computer or laptop. What happens under the hood? Let us see
- Our laptop or computers consist of switches, circuits, boards, disks etc. This is what we call Hardware.
- Once the computer starts up, there is something called BIOS (Basic Input-Output system which is used to start the computer system after it is powered on. The BIOS also manages the data flow between the computer's operating system (which we will discuss in a bit!!) & the attached devices like hard disk, keyboard, mouse etc. (You can read more about BIOS here)
- We all heard about Windows operating system, Mac OS & Linux for desktops or laptops, IOS or Android for mobiles & tablets . These are what we call Operating Systems. What is an operating system?
As per Wikipedia,
An operating system (OS) is SYSTEM SOFTWARE that manages COMPUTER HARDWARE, SOFTWARE RESOURCES, & provides common services for computer programs.
That means if we open multiple applications (Say, word and excel) together, it is the operating system which ensures optimal utilization of computer resources so that both the programs can perform efficiently when they are open together. If we try to open like 50 excel files, we can see that the computer becomes slow or maybe "hangs". This is because the operating system cannot allocate the necessary computer resources to run that much files.
- The next is Application Software which is defined (as per wikipedia) as :
An application program or software is a computer program designed to carry out a specific task other than the one relating to operating the computer itself, typically to be used by end users
Some good examples of Application Software are Microsoft Word used for word processing, Microsoft Excel for spreadsheets etc.
If we layer the above aspects from bottom to top, it will look like the diagram below:
Now, with that understanding, let us explore the layers in a Blockchain.
Blockchain Layers
We know that Blockchain is a decentralized network of nodes. So, how can it have layers? A Blockchain is like one large computer consisting of multiple computers, laptops or mobiles connected to each other as nodes run by shared & underlying consensus & security protocols. (We will talk more about EVM or Ethereum Virtual Machine at a later stage!!)
The layers in a Blockchain are as below with Layer 0 at the bottom & Layer 3 at the top:
- Layer 0 - Hardware & Networking
- Layer 1 - Protocol Layer (consensus, mining, security, decentralization)
- Layer 2 - Transaction Layer (Blocks, transactions etc)
- Layer 3 - Application Layer (Decentralized Apps, DAOs etc)
Layer 0 - Hardware & Networking
Blockchains are constructed using P2P (Peer-to-Peer) network architecture which means in simple terms - multiple computers connected to each other to form a network mesh where data or information can be shared & value transferred.
Also, the nodes "communicate" with each other to propagate transactions, validate transactions and come to an agreement on the legitimacy of the transaction. This communication is made possible through Layer 0 networking.
Layer 1 - Protocol Layer
This is the most important layer in a Blockchain where the basis of "agreements" for nodes to validate & agree on transaction validity & legitimacy is coded. And which ultimately results in transaction authentication. In other words, the consensus, proof-of-work protocols etc exist in this layer. Without this layer, no validation or authentication can happen thus stripping away a key functionality.
Layer 2 - Transaction Layer
A Blockchain consists of a series of Hashed blocks connected to each other through Block headers. These blocks contain transaction records. Blockchain has an "append-only" data structure which means blocks keep getting added but existing blocks cannot be deleted or altered. Since this transaction data is stored in multiple computers forming nodes, this is also known as Distributed Ledger Technology.
Layer 3 - Application Layer
The Application layer is what the end user sees when trying to access the Blockchain. The layer consists of programs that end-users use like Decentralized Applications (also called DApps), User Interfaces (UIs), Smart Contracts etc.
It is the layer 3 or Application Layer which links the Blockchain to the real world and gives rise to use cases and makes a Blockchain useful. We can think of the IOS or Android ecosystem where it is the apps in those phones which connects the end user to the underlying architecture within the Iphone or the Android phone and creates value to the end user.
Let us visualize the above layers as :