Blockchain Overview Paper
Blockchain Overview Paper
Background
In this part, we will explore various aspects of blockchain technology, including its demand
and role, structure, types, operation, version, applications, smart contracts, and consensus
mechanisms. We will also discuss how Blockchain can enhance security in a modern system
such as social media platforms. Additionally, we will discuss potential attacks on blockchain
systems and ways to mitigate them.
Figure 2.0 shows the general view of Blockchain, where the cube represents a block while the
connection between two blocks is called a chain.
Blockchain technology was invented by an anonymous person or group using the pseudonym
Satoshi Nakamoto in 2008. It was initially designed as a decentralized ledger to facilitate the
transfer of the Cryptocurrency Bitcoin. Blockchain technology quickly gained popularity due
to its ability to create a secure, transparent, and tamper-proof database that does not require
intermediaries.
The blockchain network operates on a peer-to-peer (P2P) system, where each node has a copy
of the database rather than relying on a central server. This decentralized architecture provides
increased security and certifies that there is no single point of failure in the network [13]. In
summary, a blockchain is a secure, transparent, and decentralized digital ledger that allows
information to be distributed rather than copied. Blockchains increase trust, security, and
efficiency in recording and maintaining data.
Figure (2.1) show the practical demo of how the general blocks look like and how the new
block is created. When we put the input data in genesis block the new hash is generated then
putting the new input data another block that’s is block number one is created and so on. The
previous Hash of Genesis block is Zero because it is first Block in Blockchain.Here generated
Hash is 64 bit long,when we give input data to SHA256 it generate a new Hash after mining
process of the transaction.
Figure 2.1: General Block View of Blockchain
2.2.1. Block
Before a block is added to the Blockchain, it must go through a process called "mining," where
a network of computers competes to solve a complex mathematical problem. The first
computer to solve the problem is rewarded with newly minted Cryptocurrency, and the block
is added to the Blockchain. Once a block is added to the Blockchain, it is considered permanent.
It cannot be altered without the consensus of most network participants, making the Blockchain
an immutable and secure ledger. Figure (2.2) represent the structure of Blocks and components
eof Block.
Block header: This is the first component of a block and contains important metadata
such as the block's unique identifier (hash), the hash of the previous block, the
timestamp of the block's Creation, and a nonce (a random number used in the mining
process).
List of transactions: This component contains the list of transactions that have been
verified and added to the block. Each transaction contains information such as the
sender, receiver, amount of Cryptocurrency transferred, and a digital signature to prove
ownership.
Merkle Tree: The Merkle tree is a cryptographic data structure used to verify the
integrity of a block's transactions efficiently. It allows for quick and secure Verification
of whether a particular transaction is included in the block without having to check
every transaction individually.
Block size: This refers to the total size of the block in bytes. Different blockchains may
have different block size limits.
Difficulty target: This is a value that is adjusted periodically to maintain a consistent
rate of block creation. It determines the level of difficulty in mining the block and is
used to regulate the rate at which new blocks are added to the Blockchain.
Nonce: This is a random number generated during the mining process that, when
combined with the other components of the block, creates a unique hash that meets the
difficulty target.
Previous hash: It is the combination of integer and alphabet 64-bit or 256-bit data. It
has information on the previous block.
Current hash: It is 64-bit or 256-bit data. It is an encrypted form combining the nonce,
data, and previous hash.
Time: There is a timestamp inside the block in the Blockchain.
Mine: Mining is a critical component of blockchain technology, as it ensures the
security and integrity of the Blockchain and incentivizes miners to maintain and
validate the network.
The structure of a block in the Blockchain is illustrated in Figure 2.2. The first block in the
Blockchain is called the genesis block, and it does not contain any transaction data. However,
every block except the first one consists of two fields - the block header and the block body.
The block body stores all the transactions that are added to the Blockchain. The block header
contains specific information, such as the previous block hash (which is the Merkle root hash
of the previous block), difficulty level (which indicates the difficulty level of the consensus
algorithm), timestamp (which stores the time when the transaction is completed), version
(which represents the version of the used protocol), nonce (which is used to show Proof of
work), and Merkle root tree (which is the hash of all the verified transactions in the block). By
including this information in the block header, the Blockchain ensures the integrity of the
transactions and the immutability of the data. The structure of the block in the Blockchain
facilitates the secure and reliable functioning of the decentralized system. All these components
work together to create a secure and immutable block in the Blockchain.
Figure (2.3) represents the working principle of Blockchain. Different stages have different
roles in processing the complete transaction.
2.3.1 Creation of transaction: When a user initiates a transaction, they create a digital record.
This record typically includes information about the sender, recipient, and amount of
Cryptocurrency being transferred.
2.3.2 Verification of transaction: It must be verified before the transaction is added to the
Blockchain. The verification process involves confirming that the user has sufficient funds to
complete the transaction and ensuring that the transaction complies with the Blockchain's rules
and protocols.
2.3.4 Broadcast of transaction: Once the transaction is verified, it is broadcast to the network
of nodes in the Blockchain. These nodes receive the transaction and validate it independently.
2.3.6 Confirmation of transaction: Once the transaction is included in a block and added to
the Blockchain, it is considered confirmed. This confirmation process ensures that the
transaction is secure and cannot be reversed or tampered with.
Overall, the working principle of Blockchain with respect to transactions involves creating,
verifying, broadcasting, and confirming transactions before they are added to the Blockchain.
This process ensures the integrity and security of the transactions and the overall blockchain
network.
There are mainly four versions of Blockchain Technology, Cryptocurrency, Smart Contract,
DApps, and Metaverse which are described in the following way-
Figure 2.4 Version of Blockchain
Blockchain 1.0 is the first generation of blockchain technology and refers specifically to its use
in Cryptocurrency applications. In this sense, Blockchain 1.0 is often used synonymously with
Bitcoin, as it was the first implementation of blockchain technology and is the most well-known
and widely used Cryptocurrency. Blockchain 1.0 focuses on creating a decentralized and secure
ledger to record financial transactions. The main features of Blockchain 1.0 include the use of
a peer-to-peer network, a decentralized consensus mechanism (such as proof-of-work), and a
secure and transparent ledger for recording transactions.
Although Blockchain 1.0 has been highly successful in Cryptocurrency, it has limitations
regarding its versatility and scalability. This led to the development of Blockchain 2.0, which
focuses on expanding the capabilities of blockchain technology beyond the realm of
Cryptocurrency. Web 1.0 was introduced in 2005 by Hall Finley. He implemented the DLT
(Distributed Ledger Technology) with the help of Bitcoin.
2.4.2 Blockchain 2.0 (Smart contracts)
Mining and scalability were the main problems of version 1.0. So smart contracts came into
the picture. Bitcoin was replaced with Ethereum. Blockchain 2.0, the second generation of
blockchain technology, refers to developing smart contracts on blockchain networks. A smart
contract is a self-executing contract written into code. This allows for the automation of various
processes and tasks, such as the transfer of assets, without the need for intermediaries.
In addition to the capabilities of Blockchain 1.0, Blockchain 2.0 adds the ability to execute
smart contracts and run decentralized applications (dApps) on the blockchain network. This
greatly expands the potential uses for blockchain technology and opens up new possibilities
for automation and decentralization in a variety of industries and applications.
One of the most well-known implementations of Blockchain 2.0 is Ethereum, which was
designed specifically to support the Creation and execution of smart contracts. Ethereum
provides a platform for developers to build decentralized applications and has become a leading
platform for the development of decentralized finance (DeFi) applications.
It is like a conventional app. Its front is written in any language, and its backend code runs on
a decentralized peer-to-peer network. Blockchain 3.0, also known as the third generation of
blockchain technology, refers to the evolution of decentralized applications (dApps) on
blockchain networks. A dApp is a decentralized application that runs on a peer-to-peer network
and operates without a central authority. Blockchain 3.0 builds upon the capabilities of
Blockchain 1.0 and Blockchain 2.0 by improving decentralized applications' scalability,
interoperability, and user experience. This is achieved through new consensus mechanisms,
such as sharding and Delegated Proof of Stake (DPoS), and new technologies, such as cross-
chain communication and non-fungible tokens (NFTs). The focus of Blockchain 3.0 is on
making decentralized applications more accessible, user-friendly, and practical for widespread
use. This includes the integration of blockchain technology with traditional systems and the
development of new and innovative decentralized solutions for a variety of industries and
applications.
Examples of blockchain networks considered part of the Blockchain 3.0 generation include
EOS, Cardano, and Polygon. These networks aim to provide a more scalable, efficient, and
user-friendly platform for developing and deploying decentralized applications.
2.4.4 Blockchain 4.0(web 3.0/metaverse)
Web 3.0 aims to create an autonomous, open, and intelligent internet, requiring decentralized
protocols that Blockchain can provide. Some third-generation Blockchains already support
Web 3.0, but the emergence of more Web 3.0-focused blockchains is expected with the rise of
Blockchain 4.0. These blockchains will feature seamless integration, cohesive interoperability,
automation through smart contracts, and censorship-resistant storage of peer-to-peer data files.
There exist four primary categories of blockchain networks which include public blockchains,
private blockchains, consortium blockchains, and hybrid blockchains figure(2.5). Every type
of these platforms has its own advantages, disadvantages, and optimal use cases.
2.5.1 Public: Anyone with internet access can join a public blockchain because it is open and
permissionless. People using public blockchains are said to be "Permissionless" or "trustless,"
which implies that they are not dependent on one another. The most well-known instance of a
public blockchain is Bitcoin.
2.5.3 Hybrid: A blockchain that includes factors of both private and public blockchains is
known as a hybrid blockchain. It offers the benefits of both types of Blockchain, such as
increased privacy, faster transaction times, increased security from private Blockchain, and
transparency and decentralization from the public Blockchain.
Blockchain technology has various applications across various industries, including finance,
supply chain, healthcare, voting, and more. Here are some specific examples of how blockchain
technology can be applied.
There is some different type of attack Figure (2.6) that occurs in blockchain application that
are-
2.7.1 Stolen Key: A stolen key attack in Blockchain refers to an unauthorized person gaining
access to a user's private key and using it to sign and authorize transactions on the blockchain
network. The private key is a cryptographic code that is used to prove ownership of digital
assets and is essential for carrying out any transaction on the blockchain network. If a user's
private key is stolen, the attacker can use it to transfer or spend the user's digital assets
without their consent. This can result in significant financial losses for the victim. To protect
against stolen key attacks, keeping private keys secure and not sharing them with anyone is
crucial. Users should also use secure wallets that employ advanced security measures like
multi-factor authentication and encryption to protect their private keys.
In a blockchain network, transactions are broadcasted to nodes in the network and validated by
nodes called validators or miners. A routing attack in this context would involve an attacker
manipulating the routing of transactions to specific validators or miners they control to increase
their chances of being the first to validate the transaction and receive the associated rewards.
To prevent routing attacks in Blockchain, it is important to implement robust security measures,
including a distributed consensus mechanism that ensures that multiple validators or miners
must agree on the validity of transactions before they are added to the Blockchain. Encryption
and other security protocols can also help prevent unauthorized access to the blockchain
network and protect against routing attacks.
2.7.2 Sybil Attack: A Sybil attack in the Blockchain is a type of attack where an attacker creates
multiple fake identities or nodes in a network to gain control of a significant portion of the
network's computational power. With this control, the attacker can manipulate the network to
their advantage and perform various malicious activities, such as double-spending, 51%
attacks, and routing attacks. In a blockchain network, validators or miners are responsible for
validating and adding transactions to the Blockchain. A Sybil attack can allow an attacker to
gain control of a significant portion of the validators or miners in the network, giving them the
power to manipulate the Blockchain.
One way to carry out a Sybil attack is to create multiple fake identities that pretend to be
different participants in the network, thereby increasing the attacker's overall voting power.
Another approach is to use botnets or compromised devices to increase the number of nodes
controlled by the attacker. To protect against Sybil attacks, blockchain networks often use
consensus mechanisms that require validators or miners to prove their computational power
and stake a certain amount of Cryptocurrency or tokens as collateral. This makes it more
difficult for attackers to create multiple identities or gain control of a significant portion of the
network. Other measures, such as using reputation systems and network analysis, can also help
detect and prevent Sybil attacks.
2.7.3 Attack 51%: A 51% attack in Blockchain is a type of attack where an attacker gains
control of more than 50% of the network's computational power, also known as the hash rate.
With this control, the attacker can manipulate the Blockchain in various ways, such as double-
spending, modifying transactions, and excluding or censoring transactions from specific users.
In a blockchain network, validators or miners are responsible for validating transactions and
adding them to the Blockchain. A 51% attack can allow an attacker to gain control of the
majority of validators or miners in the network, giving them the power to manipulate the
Blockchain. To carry out a 51% attack, an attacker must first acquire a significant amount of
computational power by mining or renting hash power from cloud mining services. Once they
control more than 50% of the network's computational power, they can begin to manipulate the
Blockchain.
An attacker can carry out a 51% attack by double-spending. This involves spending
Cryptocurrency twice by reversing transactions after they have been confirmed on the
Blockchain. By excluding the original transaction from the Blockchain and replacing it with a
new one, the attacker can effectively double-spend their Cryptocurrency. Another way an
attacker can manipulate the Blockchain is by censoring transactions. By excluding or censoring
transactions from specific users or groups, the attacker can create an unfair advantage for
themselves or their preferred users. To prevent 51% attacks, blockchain networks often use
consensus mechanisms that require validators or miners to prove their computational power
and compete to add new blocks to the Blockchain. Additionally, some networks use proof-of-
stake or alternative consensus mechanisms that reduce the risk of 51% attacks. Overall,
preventing 51% of attacks in Blockchain requires a combination of technical measures and
community awareness to ensure the security and integrity of the network.
2.7.4 Phishing attack: A phishing attack in the Blockchain is an attack where an attacker tricks
user into revealing their private keys or other sensitive information through fraudulent
websites, emails, or other means. The attacker then uses this information to access the victim's
cryptocurrency or blockchain assets.
2.7.5 Code exploration attack: A code exploration attack in the Blockchain is an attack where
an attacker examines the code of a blockchain application to identify vulnerabilities or
weaknesses that can be exploited. This can include identifying flaws in smart contract code or
other blockchain applications that can be used to steal Cryptocurrency or other assets.
2.7.6 Computer hacking: A computer hacking attack in the Blockchain is a type of attack
where an attacker gains unauthorized access to a blockchain network or node through various
means, such as exploiting vulnerabilities in software or hardware, stealing login credentials, or
launching a distributed denial of service (DDoS) attack. The attacker can then manipulate the
blockchain data, steal Cryptocurrency or other sensitive information, or carry out other
malicious activities.
The concept of smart contracts was first proposed by computer scientist Nick Szabo in 1994,
before the invention of blockchain technology. Szabo defined smart contracts as computerized
transaction protocols that execute the terms of a contract automatically without the need for
intermediaries. With the advent of blockchain technology, smart contracts became an essential
feature of decentralized applications (dApps) and blockchain-based platforms. The first
Blockchain to support smart contracts was the Ethereum blockchain, launched in 2015.
Ethereum introduced a new programming language called Solidity, which allowed developers
to create and deploy smart contracts on the Blockchain.
Smart contracts are executed automatically when predetermined conditions are met, and their
rules are encoded in computer code. Another example of a smart contract is supply chain
management. A smart contract can automate the verification and payment processes between
different parties in the supply chain, such as manufacturers, distributors, and retailers. This can
help increase transparency and efficiency in the supply chain while reducing the need for
intermediaries and the risk of fraud or errors.
2.9.1 Proof of Work (PoW): The consensus mechanism used by the original Blockchain,
Bitcoin. In PoW, network participants compete to solve complex mathematical problems, and
the first one to solve the problem is allowed to add the next block to the chain. The others
validate the solution and update their copies of the ledger. Figure (2.9.1) show the proof of
work transaction mechanism.
2.9.2 Proof of Stake (PoS): In PoS, instead of solving mathematical problems, participants are
selected to validate transactions based on the amount of Cryptocurrency they hold and are
willing to "stake" as collateral. This reduces the computational power needed compared to PoW
and is more energy efficient. Figure (2.9) shows different states of Proof of stack.
Figure 2.9: Working principle of Proof of Stack
PoS allows validators, also known as "forgers" or "stackers," to create new blocks and validate
transactions based on the amount of Cryptocurrency they hold as a stake in the network. In
other words, the more Cryptocurrency a validator holds, the more likely they are to be selected
to validate transactions and create new blocks. Unlike the Proof of Work (PoW) consensus
algorithm used in Bitcoin, where miners compete to solve complex mathematical problems to
validate transactions and create new blocks, the PoS validator simply needs to hold a certain
amount of Cryptocurrency in a "staking" wallet and keep it online to be eligible to create new
blocks.
PoS is considered more energy-efficient and less computationally intensive than PoW, as it
doesn't require miners to use large amounts of computational power to solve complex math
problems. It also reduces the likelihood of a 51% attack, as an attacker would need to control
a significant amount of Cryptocurrency to control the network.
2.9.3 Delegated Proof of Stake (DPoS): This is a variation of PoS, where token holders can
vote for a limited number of delegates who are responsible for validating transactions and
maintaining the network. DPoS stands for Delegated Proof of Stake and is a consensus
mechanism used in blockchain networks to validate transactions and create new blocks. In
DPoS, token holders of the network vote for a set of delegates to represent them and validate
transactions on their behalf. These delegates are responsible for producing blocks and verifying
transactions. They are rewarded with transaction fees and new coins for their work. The token
holders who voted for these delegates can also earn a share of the rewards based on their voting
weight.
The voting process in DPoS can be used to prevent centralization and increase the network's
security. By voting for trustworthy delegates who have a vested interest in the network's
success, the token holders can ensure that the network is being governed fairly and
transparently. DPoS is considered to be a faster and more energy-efficient consensus
mechanism than traditional Proof of Work (PoW) or Proof of Stake (PoS) mechanisms, as it
requires less computational power and electricity to produce blocks. Additionally, DPoS has
the advantage of being more scalable, as it allows for a larger number of transactions to be
processed in each block.
2.9.4 Practical Byzantine Fault Tolerance (PBFT): This consensus Algorithm is used in
permissioned blockchain networks, where all participants are known and trusted. In PBFT,
several nodes work together to validate transactions, and even if some of them are hacked, the
network can still function.
PBFT (Practical Byzantine Fault Tolerance) is a consensus algorithm designed to solve the
Byzantine Generals' Problem in distributed systems, including blockchain networks. The goal
of PBFT is to achieve consensus among a group of nodes in a network, even if some of the
nodes are malicious or fail.PBFT is a leader-based consensus algorithm, meaning that one node
is designated as the leader for each round of consensus. The algorithm proceeds in three phases:
the pre-prepare phase, the prepare phase, and the commit phase. In the pre-prepare step, the
leader sends a message to all other nodes in the network with a proposed transaction block. In
the preparation phase, the other nodes validate the transaction block and send a prepared
message to all other nodes indicating their agreement. In the commit phase, the leader waits
for at least two-thirds of the nodes to send a ready message before sending a commit message
to finalize the transaction block.
PBFT has several advantages over other consensus algorithms. For example, PBFT can handle
a larger number of nodes than some different consensus algorithms and tolerate a more
significant number of malicious nodes. However, PBFT also has some disadvantages, such as
the need for a designated leader and the requirement that nodes know the identity of all other
nodes in the network. Overall, PBFT is a well-studied and widely-used consensus algorithm in
blockchain networks.
2.9.5 Proof of Authority: In a PoA network, there is a designated set of validators, or
"authorities," responsible for verifying transactions and adding them to the Blockchain. These
validators are pre-selected and are often entities with a strong reputation, such as government
agencies or well-established companies. The main advantage of PoA is that it provides a more
efficient and scalable alternative to PoW and PoS while maintaining a high level of security.
This is because the validators are trusted and known entities, which makes it more difficult for
malicious actors to manipulate the network.
Each consensus mechanism has its trade-offs and is suitable for different use cases. Choosing
the right consensus mechanism depends on the specific requirements of the blockchain
application, such as the level of decentralization required, the degree of trust among
participants, and the desired level of performance.
2.10 Summary
This chapter provides an overview of Blockchain, its block structure, the role of Blockchain,
working principle, type of Blockchain, application of Blockchain, smart contract, consensus
algorithm used in Blockchain, and attack possible in blockchain system with its possible
solution.