Introduction & Outline
Lesson Plan
- Aim
- An overview of blockchain
- Blockchain and database maintenance
- Learning Objectives
- Understand the main idea & basics of blockchain
- Differences from traditional ones
- Assumed Previous Knowledge
- Wireless Communication System
Outline
- Blockchain Classifications
- Blockchain and Database Maintenance
- Users/Nodes in a Blockchain Network
- Layers in Blockchain
Blockchain Classifications
Blockchain networks can be classified as
- public
- private
- consortium.
From an access permission perspective, it can also be classified as
- permissioned blockchain
- permissionless blockchain.
- Public blockchain network—permissionless
- Private Blockchain Network—Permissioned
- Consortium Blockchain Network—Permissioned
Public Blockchain Network—Permissionless
- Any blockchain node can join or leave at any time.
- Any blockchain node can participate in mining process.
- Completely decentralized
- e.g., Bitcoin
Private Blockchain Network—Permissioned
- Nodes can join or leave the network with the permission from the central entity.
- Completely centralized
- Miners are selected a priori
Consortium Blockchain Network—Permissioned
- Neither completely centralized nor completely decentralized
- Nodes can join or leave the blockchain network with the permission from the consortium of nodes.
- Not all the nodes can validate the transactions.
- Partially centralized
General Issues with Public Blockchain
- Limited Transactions
- Scalability
- Pseudonymity
- Limited Block Size
- Energy Consumption
Limited Transactions
Bitcoin blockchain can handle less than 10 transactions per second (Tps), while Ethereum blockchain can handle less than 50 Tps.
Scalability
Public blockchain systems are designed for different communication technologies, the amount of participating blockchain nodes will increase exponentially. This will have an adverse effect on mining time as well as size of the blockchain.
Pseudonymity
This partial visibility of identity may also trigger other privacy attacks and malicious nodes may exploit this vulnerability.
Double spending
Limited Block Size
Public blockchain to date has limited block size. For instance, Bitcoin has 1 MB Block size.
Energy Consumption
Due to the reliance of public blockchain system (such as Bitcoin) on PoW cryptographic puzzle, a huge amount of energy is consumed.
Blockchain and Database Maintenance
Database System
- Centralized
- In centralized database systems, maintenance is the responsibility of central entity and this central entity needs to be highly reliable and trusted
- Distributed
- In distributed database systems, multiple designated nodes are responsible for database maintenance
Blockchain System
Lack of trusted entity and ledger need to be maintained in the presence of designated nodes.
- Public Blockchain
- Ledger is maintained by all the nodes collectively.
- An entity is needed to resolve any conflict or makes protocols.
- Consortium Blockchain
- A consortium of nodes is responsible for updating and maintaining the blockchain.
- Private Blockchain
- Only a single node (few nodes) is responsible for blockchain maintenance. It resembles the centralized system.
Database System, DLT and Public Verifiability
Public verifiability means allowing the system (ledger) to be verifiable by the public, i.e., public can verify the state of the system at any time to trace and track any transaction or ledger entry.
- In traditional database systems, central server is responsible for managing the database.
- In blockchain system, P2P underlying network architecture is running at the back to manage the system.
Comparison
We compare these features of blockchain systems with DBMS.
Hashing
In traditional database system, hashing is not applied to each data entry in the database, however, in blockchain system, hashing plays a critical role and applies to different stages.
Public/Private Key
Public/private encryption is generally not applied in database systems; however, this is an essential requirement in blockchain systems
Sequence of Records
In database systems, transactions not maintained sequentially, but in blockchain systems, transactions should be placed sequentially and linked together.
Consensus
Not required in database systems to maintain and update the state of the ledger. However, in blockchain systems, it is an essential requirement.
Immutability
Blockchain records are immutable, i.e., no previous entry or transaction recorded in the ledger can be modified. This feature is not present as such in database systems.
Ledger Dissemination
In traditional database systems, once any update is made in the ledger, the state of the ledger is not required to disseminate among the participating nodes. However, this dissemination is essential in blockchain systems.
Trust and public availability of blockchain
Trust and public availability of blockchain systems is one such unique feature that distinguishes it heavily from traditional database systems.
- Blockchain, in essence, remove the trusted third party from the middle among the transacting parties and build trust publicly in untrusted and unknown environment
- Moreover, the public availability and transparency makes blockchain system more popular among their traditional counterparts, i.e., database systems.
Users/Nodes in a Blockchain Network
Before the user/node is considered as part of the blockchain network
- User/node has to generate public/private key pair for authentication purpose.
- User/node has to establish a minimum number of peer connection (direct connections) with other nodes in the blockchain network
The types of blockchain nodes and their involvement in different aspects within the blockchain system
Classified
- Full Blockchain Nodes
- Lightweight Blockchain Nodes
- Miner Nodes (Functionality Nodes)
In terms of dealing with transactions, we can have
- Leader nodes
- Validator nodes
Or
- Sender nodes
- Receiver nodes
Users/Nodes in a Blockchain Network
Full Blockchain Nodes
- Keep the full copy of the blockchain ledger locally.
- Participate in transaction verification without reference to any node externally.
- Participate in routing
Lightweight Blockchain Nodes
- Only keep the header of each block and then reference to the external nodes when complete information is required.
- Participate in routing.
Participate in routing.
- Carry the consensus mechanism and responsible to publish the block in the blockchain.
- The most powerful nodes in the blockchain network, which can change the state of the blockchain network.
- A node in a blockchain, which participates in consensus mechanism, i.e., miner node can only create and add a block to the blockchain
Leader Nodes
- Leader nodes are those blockchain nodes that create blocks.
- The leader node can be elected and serves during a specific time.
Validator Nodes & miner nodes
- Validator nodes are those blockchain nodes which validate the blocks.
- Validator nodes can also be called as miner nodes.
Sender Nodes
- Sender nodes can creating transaction and issue a transaction to multiple blockchain nodes.
- Sender nods have to sign transactions with their individual private key
Receiver Nodes
- Receive transactions issued by sender nodes.
Layers in Blockchain
Six layers
Layers in Blockchain
Application Layer
- It directly interacts with the user
- In this layer, different applications run over the client and the client uses the applications to interact with the blockchain system.
Virtualization and Smart Contract Layer
- This layer is responsible for virtualization and smart contract related execution.
- This layer also interacts with the user machine and responsible to compile blockchain code.
Consensus Layer
- The consensus layer is responsible to manage and reach consensus in a P2P network.
- This layer operates and interacts at network level in the blockchain network.
- It dictates which consensus protocol needs to be executed and how to follow the rules to achieve consensus.
Network and OS Layer
- This layer is the core layer responsible for managing the underlying network services and operations over a blockchain network.
- In this layer, communication mechanism, peer discovery, routing, and peer-to-peer network are managed.
Data Organization and Topology Layer
- This layer is responsible for data organization and topology management.
- It includes tasks such as hashing, data storage cryptographic algorithms, data ordering, side chain, sharding, and off-chain related issues.
- It also includes issues such as transaction models, and Merkle Tree management.
Hardware Layer
- This layer deals with the underlying hardware of the blockchain nodes. The performance of blockchain nodes depends upon the architecture used, i.e., whether its CPU or GPU, etc.