Bitcoin Software Layer Architecture.

·

4 min read

In this article, we will go through the main software layers of the Bitcoin blockchain network. This will give us a higher level of understanding of Bitcoin while incorporating future technological advancements that can be made to Bitcoin to make it more secure, immutable, and decentralized.

Before we start, we should have the following image in mind as we describe different layers and the part they play to make it work;

bit36.png

Note that this is just a generalized overview of how the whole network is structured. In later articles, we will learn about its peer-to-peer network architecture and the bitcoin core.

The source code of Bitcoin and Ethereum blockchains is open source anyone can access it in the links provided in the references section. This allows anyone to contribute to it, such transparency is key for participants to trust the network.

Layer 1

This is where the actual distributed ledger that stores all executed transactions are located. It runs on top of the TCP/IP network layer. This layer also defines how new blocks are verified through mining and consensus. The protocol on how transactions are propagated to the entire network is also included here. This layer holds the original Bitcoin as designed back in 2009 by Satoshi Nakamoto.

A BIP(Bitcoin Improvement Proposal) is a document that lists modifications made to a blockchain to improve its functionality in some way. A transaction is said to be On-Chain if it was executed on the bitcoin L1 network. We will also learn about BIPs in later articles, in the meantime, we can check out the link in the references section regarding Bitcoin BIPS. For the Ethereum blockchain, we have EIPs. This is also included in the references section.

This layer suffers from problems such as high transaction fees, this issue has resulted in new chains being derived from this layer's source code. Layer 1 Bitcoin is also slow, the hash rate is higher and thus miners employ a lot of computational power as PoW(Proof-of-Work). Bitcoin's consensus algorithm(PoW) consumes a lot of energy. Note that as the price of bitcoin changes in the financial markets, the transaction fee does not change.

The mentioned issues above give rise to layer 2 protocols which we discuss in the following section.

Layer 2

We have seen the shortcomings of Layer 1 Bitcoin, and as innovation never sleeps, protocols were created on top of the original Bitcoin to make it faster in terms of processing transactions and reducing transaction costs. This is also seen as a cause for the scalability issues of Bitcoin.

In later articles we shall discuss chain splits, this is whereby the main chain splits into two chains, it can be caused by disagreements between network participants or two miners solving the puzzle at the same time. An example of Layer 2 cryptocurrency is Bitcoin Cash, a derivative of the original L1 Bitcoin with lower transaction fees and faster transactions.

Layer 2 solutions solve the previously discussed issues by processing transactions off-chain and then updating the L1 decentralized ledger in a batch mode.

Layer 2s can also be sidechain solutions that support interoperability between different blockchains or Off-chain solutions whose operations happen outside the main L1. Transactions in L2 Bitcoin chains are faster and cheaper compared to their L1 counterparts.

Layer 3

In the bitcoin layered model, this is the application layer. This layer allows developers to create decentralized applications on top of the blockchain. It is comprised of a server/client interface and a backend that serves as an interface to L1 and L2. This is similar to how an app can be built on top of AWS or GCP. In building an app most critical aspects such as cryptography are outsourced, so as authentication, hosting, etc. All these services are controlled by a centralized entity(Amazon, Google). Layer 3 of a blockchain solves this by allowing a single identity for everything. By having a wallet, a participant is able to use an app to interact with the blockchain. In the case of Ethereum, accounts are used as interfaces to the blockchain.

All this is functionality is evident in Solana and Etherium blockchain networks, L1 Bitcoin is meant for the storage and exchange of value.

Layer 4

This layer allows user applications such as enterprise solutions to operate on the blockchain. These could be payment processors, wallets, escrows, and other financial products.

Layer 3 and 4 leverage Layer 2 protocols so they can deliver one of the most important aspects of a blockchain, decentralization, that is provided by bitcoin and add scalability to it.

Summary

A blockchain consists of three major layers, layers I, II, and III. The base layer - Layer 1 of Bitcoin involves the underlying bitcoin architecture. Layer 2 involves protocols used in the network. Layer 3 is categorized by decentralized applications built on top of blockchain technology.

References

Bitcoin source code

Ethereum source code

Bitcion BIPs

Ethereum EIPs