It’s called blockchain because transactional data is stored in blocks that are linked together to form a chain.” As the number of transactions increases, the size of the blockchain also increases. To better understand this amazing invention, let’s discuss its architecture. The components of the architecture were combined by different companies and then modified, leading to different blockchain projects like Bitcoin, Ethereum, Hyperledger, and others. In this blog, we will cover the Bitcoin blockchain architecture for the sake of simplicity.
The following is a list of architectural components:
- P2P network
- Consensus Algorithm
Before we talk about architecture, let’s get a few things clear in our heads:
– Blockchain is not Bitcoin; Blockchain is the technology behind Bitcoin.
– Bitcoin is a digital token or cryptocurrency, whereas blockchain is a ledger for tracking transactions of these digital tokens.
– Bitcoin without blockchain is impossible, but you can have a blockchain without bitcoin.
The smallest building block of a blockchain system is called a transaction. They usually consist of a recipient address, a sender address, and a value. This is exactly like a standard credit card statement. The owner transfers the value by signing a generated hash by adding the previous transaction and the recipient’s public key.
The transaction is then publicly announced on the network, and all nodes independently keep a copy of their blockchain, and the currently known “status” is calculated by processing each transaction in the order that it appears on the blockchain. Transactions are grouped and sent to each node in the form of blocks. As new transactions are distributed across the network, they are independently verified and “processed” by each node. Each transaction is marked in time and collected in one block.
Blocks contain information as transactions and block headers. A block is a data structure, the purpose of which is to group sets of transactions and replicate them to all nodes in the network. Blocks in the blockchain are created by miners. Mining creates valid blocks that are accepted by other networks. Nodes take pending transactions, check if they are cryptographically correct, and package them in blocks stored on the blockchain. The block header is metadata that helps validate a block. The rest of the block contains transactions. It can be any number of transactions grouped into a single block depending on the miner’s choice.
Different Types of Blocks
1. Most of the blocks only extend the current main blockchain, which is also the longest chain in the network. This block is called the “main branch block”.
2. Some blocks refer to the parent block that is not on the longest blockchain. This block is called a “side branch block”.
3. Some blocks refer to a parent block that is not known to the node processing the block. They are known as the “orphan block”.
Currently, the side branch block may not be part of the main branch, but as more blocks are mined to pass as a parent, the side branch will likely be reorganized into the main branch. This introduces the concept of branching.
Blockchain is a peer-to-peer (P2P) network that works over the IP protocol. A P2P network is a flat topology without a central node. All nodes provide services in the same way and can use them when working together via a consensus algorithm. Peers add the computing and storage power needed to maintain the network. P2P networks tend to be more secure because they don’t have a single point of attack or failure, as is the case with centralized networks. Blockchain can be either a permission-based network or a permission-free network. A permissionless network is also known as a public blockchain because anyone can join the network, while a permission-based blockchain is known as a consortium blockchain. A pre-verification of all the participants in the network is required in a permission-based blockchain or private blockchain from parties that are usually known to each other. In a typical blockchain architecture, each node on the network stores a local copy of the blockchain. The decentralization of the blockchain architecture is the only advantage of the P2P network on which it is built.
This way of synchronizing all copies of a single ledger is because of a consensus algorithm. The consensus mechanism ensures that each local copy each party has is consistent with each other and up-to-date. The copies that each node has are identical or similar to each other. It can be said that consensus algorithms are at the core of every blockchain architecture.