0x01 preview Web3 utility
Web3 has become a catch-all term for the vision of a new, better internet. At its core, Web3 uses blockchains, cryptocurrencies, and NFTs to give power back to the users in the form of ownership. A 2020 post on Twitter said it best: Web1 was read-only, Web2 is read-write, and Web3 will be read-write-own.
you might ask What are the layers of Web3? let's dive into more details in the blockchain network
Blockchain technology is an amalgamation of various technologies coming together under one roof to help the system run smoothly. Mathematical computation, cryptography, game theory, peer-to-peer systems, and validation protocols essentially join forces to power blockchain operations.
However, since blockchains eliminate the presence of a central governing authority, all transactions must be robustly protected, and data must be stored securely on a distributed ledger. The distributed ledger technology (DLT) works on a pre-set protocol with various computers across the network (or nodes) arriving at a ‘consensus’ to validate transactional data. Each node adds, scrutinizes, and updates entries as they come.
Blockchains have a layered architecture to facilitate this unique way of authenticating transactions. There are five layers involved, each with its distinct functionality.
0x02 The Hardware Infrastructure Layer:
Hardware infrastructure layer
Clients request content or data from application servers while browsing the web or utilizing any apps, which is known as the client-server architecture. Clients can now connect with peer clients and share data. A peer-to-peer (P2P) network is a large group of computers that share data.
Blockchain data lies securely stored in a data server. When we browse the web or use any blockchain apps, our machines request access to this data from the server. The framework that facilitates this data exchange is known as the client-server architecture. It is nothing but a vast network of devices communicating with each other and requesting data from one another. This is how a distributed ledger gets created. Each device communicating with another device on the network is a node. Each node randomly verifies transactional data.
0x03 The Data Layer
Data layer: This layer acts as the block chain data structure and physical storage. The ledger is built using a linked list or Merkel trees, of blocks, which are encrypted using asymmetric encryption.
Merkle tree encodes the blockchain data in an efficient and secure manner. It enables the quick verification of blockchain data, as well as the quick movement of large amounts of data from one computer node to the other on the peer-to-peer blockchain network.
Blockchains are nothing but a long chain of ‘blocks’ containing transaction data. When the nodes validate a certain number of transactions, the data is bundled into a ‘block,’ added to the blockchain, and linked with the previous block of data. The ‘Genesis Block’ is the first block in the chain and therefore does not need to be linked with any previous block. Instead, the subsequent block is linked with the Genesis block, and the process is repeated every time a new block is added. This is how a blockchain forms and continuously grows.
Every transaction is ‘digitally signed’ with the private key of the sender’s wallet. Only the sender has access to this key, thus ensuring that the data can neither be accessed nor be tampered with by anybody else. This is called ‘finality’ in blockchain terminology. The digital signature also protects the owner’s identity, which is itself encrypted, thus ensuring maximum security.
0x04 The Network Layer
The Ethereum network, or layer one, is what people allude to when they say Ethereum. This layer is in charge of consensus processes, programming languages, block time, dispute resolution, and the rules and parameters that maintain a blockchain network’s basic functionality. It is also known as the implementation layer.
The P2P framework enables various nodes to exchange transaction data to arrive at a consensus about the validity of a transaction. This means that every node must be able to discover other nodes on the network for fast communication. It is the network layer that facilitates this ‘inter-node communication’. As node discovery, block creation, and block addition are also managed by this layer, it is also referred to as the ‘Propagation Layer.’
0x05 The Consensus Layer
The consensus layer is the most necessary and critical layer in any blockchain, whether it is Ethereum, Hyperledger or another. The consensus layer is in charge of validating the blocks, ordering them, and guaranteeing that everyone agrees.
This is the most critical layer in blockchain operations. This layer is responsible for validating transactions, and without it, the entire system will fail. This layer runs the protocol that requires a certain number of nodes to verify one transaction. Therefore, every transaction is processed by multiple nodes that must then arrive at the same result and agree on its validity. This framework maintains the blockchain’s decentralized nature as no node has sole control over any transactional data, and the role is distributed. This is called the consensus mechanism.
With so many nodes processing transactions, bundling them up, and adding them to the blockchain, multiple blocks may get created simultaneously, resulting in a branch in the blockchain. However, there must always be a single chain block addition, and the consensus layer also ensures that this conflict is resolved
0x06 The Application Layer:
Smart contracts, chaincode, and decentralized applications (DApps) make up the application layer. The application layer protocols are further subdivided into the application and the execution layers. The application layer comprises the programs that end-users utilize to communicate with the blockchain network.
This is the layer on which smart contracts and decentralised applications (dApps) run. Smart contracts make decisions based on certain triggers such as contract expiration dates, achievement of spot prices, etc. The actions that follow these decisions are executed by dApps. And all of this happens on the application layer.
dApps also facilitate the communication between user devices and the blockchain. Therefore, the application is like the user-facing front end, while the main blockchain is the backend, where the data remains securely stored.
So, there you have it — the 5 layers of a blockchain that help it function smoothly. However, if you have been reading about blockchains, you must have also come across terms like layer-0, layer-1, layer-2, and so on. What are these layers, then? Let’s find out.
0x07 Layer 0
Layer 0 is the initial stage of blockchain that allows various networks to function, such as Bitcoin, Ethereum, and many more. Layer 0 also provides blockchain with a facility of cross-chain interoperability communication from top to different layers. Layer 0 provides the underlying infrastructure for blockchain.
0x08 Layer 1
A layer-1 blockchain is a set of solutions that improve the base protocol itself to make the overall system a lot more scalable. There are two most common layer-1 solutions, and these are the consensus protocol changes as well as sharding. This layer governs the protocols that ensure security across the blockchain network. Layer 1 encompasses the consensus mechanism, coding language, and all the rules embedded in the code for the operations of the blockchain. Therefore, sometimes this is also called the ‘Implementation Layer.’ When users mention the Bitcoin blockchain, they are referring to this layer.
0x09 Layer 2
Layer 2 refers to a secondary framework or protocol that is built on top of an existing blockchain system. The main goal of these protocols is to solve the transaction speed and scaling difficulties that are being faced by the major cryptocurrency networks. Layer 2 is a new network that handles all the transaction authentication and decongests layer 1. Layer 1 only handles the creation and addition of blocks to the blockchain. The new layer-2 network sits over the layer 1 network and continuously communicates with it.
The Lightning Network is an example of a layer 2 blockchain sitting on the Bitcoin blockchain.
0x10 Layer 3
Layer 3 is often referred to as the application layer. It is a layer that hosts DApps and the protocols that enable the apps. While some blockchains such as Ethereum or Solana (SOL) have a thriving variety of layer 3 apps, Bitcoin is not optimized to host such applications.
Smart contracts and dApps that only handle decision-making and execution of follow-up actions from layer 3. Since the maximum functionality of the blockchain is derived from the innovation of dApps, this is the layer that interfaces between the real-world applications and the underlying layers that facilitate everything.
Above those are tedious concept， now we have some fun parts (hope so ) :)
First, let’s take a look at the composition of Web3. According to Coinbase’s classification, Web3 can be roughly divided into 4 layers.Protocol layer，Infrastructure / Category Primitives，User Case Layer，Access Layer respectively
Core Elements of Web3: Blockchain, Crypto Assets, Smart Contracts and Oracles
Layers Of The Web 3.0 Architecture
- The application layer will have the dApp browser, application hosting, dApp, and user interfaces applications that serve as the entry point for all manner of Web3 activities.
- The second stage of layers basically goes into the technology layer. This layer covers all the important tools involved to create and run the application layer. It usually covers data feeds, off-chain computing, governance (DAOs), state channels, and side chains.
- The protocol layer covers the different consensus algorithms, participation requirements, virtual machines and many more.
- The network layer acts as a transportation medium and interface for the peer-to-peer network and decides how data is packetized, addressed, transmitted, routed, and received. It mainly consists of RLPx, Rolls your Own, and Trusted Execution Environments (TEE).
- At the bottom of the stack, we have the infrastructure layer. This is made up of the underlying blockchain architecture on top of which everything else gets built.
If all of this is making your head spin, you’re not alone! Cobbling together all of these tools is complex and can lead to a painful developer experience.
With growing concerns over data privacy each day, web3 innovations are going to come up faster than ever. It is important that you equip yourself with a basic understanding of this space as it is going to impact the way we work.