SlideShare a Scribd company logo
Chapter 2
How Blockchain Works?
• Understanding SHA256 Hash
• Immutable Ledger
• Distributed P2P Network
• How Mining Works? (The NONCE and Cryptographic Puzzle)
• Byzantine Fault Tolerance
• Consensus Protocols: Proof of Work, Proof of State, Défense Against Attackers,
Competing Chains
• Blockchain Demo
Introduction
• Blockchain first came to fame in October 2008,to light when a white paper
on “Bitcoin:A peer-to-peer electronic cash system” as part of proposal for
Bitcoin published by a person or Group of individuals name ‘Satoshi
Nakamoto’.
• Blockchain is the backbone technology of digital cryptocurrency Bitcoin.
Bitcoin is a type of digital currency that we can transfer within the Bitcoin
network without the help of mediators. We can store Bitcoin in a digital
wallet or e-wallet.
• Cryptocurrency wallet or crypto wallet like BitGo is a device or a program
or a service which stores public or private keys for cryptocurrency
transactions.
• Blockchain technology records transaction in a digital ledger which is
distributed over the network thus making it incorruptible.
Introduction
• People and institutions who do not know or trust each other, live in
different countries are subject to different authorities, and who have
no legally binding agreements with each other, can now interact over
the internet without the need for trusted third parties like banks,
internet platforms and other types of clearing institutions.
• Storing data across a peer-to-peer network eliminates problems
emerging from the vulnerability of centralized servers while using
different cryptographic methods to secure the network.
Working of Blockchain Technology
Hashing
• Hashing is essential to Blockchain in cryptocurrency. A hash is a
mathematical function that converts an input of arbitrary length into
encrypted output of fixed length.
• Hashing in Blockchain ensures that all blocks are well formed and
temper-free and thus the Blockchain will remain secure and virtually
un-breakable.
Properties of hashing
1. Collision Free: It is impossible to find two input texts that produces
the same hash value.
2. Easy to generate: It is easy to generate a hash value for a particular
input using hash function.
3. Irreversible :It is impossible to generate original text from the hash
value.
4. Commitment :It is not feasible to modify original text without
resulting a change in hash value thus enabling data integrity.
Process of hashing
Concept of Hash Function
• A hash function takes any input like numbers, words etc. and through
the use of an algorithm, produces an output of a specific length.
• A hash function maps the data of any arbitrary size to data of fixed
size. Bitcoin uses SHA-256 hash function that produces a hash of size
256 bits.
• The process of applying on the data is called hashing
Features of hash function
1. Pre-image Resistance: The hash function works in only one
direction i.e. we cannot deduce the input from the output.
Consequently , for two sets of input, even if the inputs only differ by
the smallest detail, the outputs should be wildly different and not
resemble one another.
2. Collision Resistance: When a hash function produces the same or
identical output for two different inputs, this is called a collision. It
is imperative that collisions are avoided in order to guarantee data
integrity.
Concept of hashing
Understanding SHA256 Hash
• The Secure Hash Algorithm(SHA) is a family of cryptographic hash functions
published by the National Institute of Standards and Technology(NIST).
• Cryptographic hash function SHA-256 takes input of any size and the
output is always a fixed size 256 bits(32 bytes).
• SHA-0 is the first version of the SHA algorithm. In 2004, several
weaknesses were exposed in the algorithm, resulting in the creation of a
new stronger version of SHA-0 called SHA-1.
• In 2005, an attack of SHA-1 reported that it would find a collision in fewer
hashing operations.SHA-2 was created to overcome SHA-1 vulnerabilities
and it could be implemented with a digest size of 224,256,284 and 512 bits.
Understanding SHA256 Hash
• SHA-2 is a widely used standard in modern cryptographic
applications. Bitcoin uses the SHA-256 variant as a hashing algorithm
to solve Proof-of-Work(PoW) puzzles.SHA-3 is the latest family of
hash functions with 224,256,384 and 512 bit variants.
• SHA-256 hash function commonly used in Blockchain Technology.
• SHA-256 is a popular hashing algorithm used in Bitcoin encryption, it
was introduce when the network launched in 2009.
• The top three SHA-256 Blockchain projects by market capitalization
are Bitcoin(BTC), Bitcoin Cash(BCH) and Bitcoin satoshi’s vision(BSV)
Process of SHA-256
Immutable Ledger
• Immutable ledger in blockchain refers to any records that have the
ability to remain unchanged.
• It cannot be altered and hence the data cannot be changed with ease,
thereby making sure that the security is quite tight.
• Immutability means that it is very difficult to make changes without
collusion.
• The central idea behind the blockchain ledger is the security of data
and the proof that data has not been changed or altered.
Understanding Blockchain
Immutability
• Immutability is defined as the ability of a blockchain ledger to remain unchanged, unaltered, and indelible.
• Each of the blocks of information like facts or transaction details is carried out with the help of a
cryptographic principle or a hash value.
• Now, this hash value has an alphanumeric string generated by each block individually.
• Each of the blocks contains a hash value or digital signature for itself and for the previous one as well.
• This, in turn, makes sure that the blocks are retroactively coupled together and unrelenting.
• It is this functionality of blockchain technology that makes sure no one is able to interfere with the system or
change the already saved data into the block.
• In this regard, it is also quite essential to know that blockchain is distributed and decentralized in nature.
• Here a consensus is made among the different storing a copy of the data.
• It is this consensus that makes sure the originality of data is righty maintained.
• Immutability is undoubtedly one of the most definitive features of blockchain technology and also brings out
the best use cases of smart contracts that can be deployed.
• The concept can simply redefine the entire process of auditing of data to make it much more efficient, and
cost-effective, along with bringing about more trust as well as integrity into the data.
How to Achieve Immutability?
• To understand how to achieve immutability, clarification of the concept of cryptographic hashing is essential.
• Nowadays, the generation of a cryptographic is not quite a dreadful task.
• It is because of the fact that modern programming languages come with an array of hash functions.
• With the help of these hash functions, it is just required to pass a set of bytes and the function will be
returning a checksum signature.
• These functions always generate a string of length of 64 characters and we would always be getting the fixed
string length regardless of the size of the input, which is referred to as a digital signature.
The digital signature points to the exact data that the users input.
• But hash cannot be reverse-engineered which means that the users cannot make use of this output string
for the purpose of finding the input data.
• This, in turn, results in the immutability of the blockchain ledger.
• In this system, each of the transactions is verified with the help of a blockchain network.
• It includes blocks of information embedded with timestamps and is secured by a hashing process.
• It links together and incorporates the hash of the last block. This mechanism plays a major role in developing
the chronological chain which helps in joining each of the blocks.
How to Achieve Immutability?
• The meta-data of the last block is always included by hashing at the time of
generating a new hash for it.
• This, in turn, helps in creating a link between the block and the chain,
thereby making it unbreakable.
• Once this is done, none can alter or delete the data of the block which is
placed in the blockchain.
• It is because whenever anyone would be attempting to make a change, the
modification is rejected by the subsequent block since the hash of the
block would not be valid anymore.
• To state in a line, it would come like this.
Immutability = Cryptography + Blockchain Hashing Process
Benefits of Immutable Ledger in
Blockchain
• Security is Tight in Blockchain
The immutable ledger on the blockchain is quite secure. We already know
that blockchain is distributed ledgers. It means that there is no central
point of authority that can control it. Thus, at any point in time, the hackers
try to compromise the data, it is just next to impossible to do the same at
the time when it is managed with more than two servers or nodes.
Additionally, each of the actions that are made on a digital ledger is
encrypted with a unique hash code to which the majority of the nodes
must agree upon the action. This, in turn, makes sure that there is a free as
well as a transparent flow of data along with protecting the information
from being corrupted.
Benefits of Immutable Ledger
in Blockchain
• Ensures Authenticity and High Quality
It is known that an immutable ledger on blockchain benefits the users with
its high level of security and traceability. These features play a significant
role in effectively dealing with the fraudulent market. Every year
counterfeit goods result in costing a huge sum of money to authorized
brands, but the use of blockchain in this regard could certainly be the
revolutionary solution. It works by registering different items on the
blockchain system where the manufacturers can very easily provide all the
required information to their customers regarding the origins of the
products, their historic records, current and previous owners. By just
tagging the items on a blockchain, the buyers would be able to understand
whether the item is authentic or not.
Benefits of Immutable Ledger
in Blockchain
• Readily Benefits Supply Chain Management
Supply chain management is another area where the immutable ledger on
blockchain proves to be immensely beneficial. The entire process of exchanging
goods needs to be handled with a lot of responsibility. At the time of transporting
items, there are chances of loss, stealing, misplacing, or damage. Keeping this in
mind, a number of logistics companies have already started using blockchain to
avail the benefits.
On the other hand, there are some companies that are currently experimenting
with blockchain before using the same in their mainstream. With the use of
blockchain technology, the parties are allowed to very quickly share data. Most
importantly, even the slightest inconvenience caused at the time of a shipment
would be registered. A digital ledger in this regard plays a crucial role in providing
very tight security by enhancing transparency as well as traceability of goods in
the supply chain.
Benefits of Immutable Ledger
in Blockchain
• Higher Level of Privacy
The information which we share or put online is always vulnerable to
outside harm, like leaks, hacks, and personal threats. We tend to treat
the data as private and try to make sure that that privacy is not easily
compromised in this regard. The use of blockchain can prove to be
quite beneficial here since it is different from the standard database
which ensures that privacy is much better for the users. Blockchain is
anonymous, and each of the users is protected with encrypted codes
which makes it next to impossible to detect the account information
of any of the users. But it is to be kept in mind that levels of privacy
depend on a specific blockchain and the security features it
possesses.
Immutability
It is the most desired property to maintain the atomicity of the blockchain transactions.
Once a transaction is recorded, it cannot be altered.
If the transactions are broadcast to the network, then almost everyone has a copy of it.
With time, when more and more blocks are added to the blockchain, the immutability
increases and after a certain time, it becomes completely immutable.
For someone to alter the data of so many blocks in a series is not practically feasible
because they are cryptographically secured.
So, any transaction that gets logged remains forever in the system.
Link to Video
Introduction to P2P Network and its Types
● Peer to peer network, commonly known as P2P is a decentralized network
communications model that consists of a group of devices (nodes) that collectively
store and share files where each node acts as an individual peer.
● In this network, P2P communication is done without any central administration or
server, which means all nodes have equal power and perform the same tasks.
● P2P architecture is suitable for various use cases and can be categorized into
structured, unstructured, and hybrid peer-to-peer networks.
● The unstructured peer-to-peer networks are formed by nodes randomly from
connection to each other, but they are inefficient than structured ones.
● In structured peer-to-peer systems, the nodes are organized, and every node can
efficiently search the network for the desired data.
● Hybrid models are actually a combination of P2P and client-server models, and when
compared to the structured and unstructured P2P systems, these networks tend to
present improved overall performance.
● Today, P2P networks are the foundation of most of the cryptocurrencies, thus,
making up a significant portion of the blockchain industry.
P2P vs. Traditional Client-Server Systems
● Before understanding the role of these networks in blockchain, let’s
distinguish between P2P and traditional client-server architecture.
● The critical difference between both the systems is that in Client-Server,
there is a dedicated server and specific clients whereas, in P2P, it is
maintained by a distributed network of users, where each node can act
both as a server and a client.
Role of P2P in Blockchain
● P2P is a technology that is based on a very simple principle, and that is the
concept of decentralization.
● The peer-to-peer architecture of blockchain allows all cryptocurrencies to be
transferred worldwide, without the need of any middle-man or intermediaries
or central server.
● With the distributed peer-to-peer network, anyone who wishes to participate
in the process of verifying and validating blocks can set up a Bitcoin node.
● Blockchain is a decentralized ledger tracking of one or more digital assets on a
peer-to-peer network.
● When we say a peer-to-peer network, it means a decentralized peer-to-peer
network where all the computers are connected in some way, and where each
maintains a complete copy of the ledger and compares it to other devices to
ensure the data is accurate.
● This is unlike a bank, where transactions are stored privately and are managed
only by the bank.
P2P: Advatages
• As blockchain is a decentralized system of peer to peer network, it is highly
available due to decentralization.
• Because of P2P networking capability, even if one peer gets down, the other
peers are still present. Thus nobody can take down the blockchain.
• P2P networks offer greater security compared to traditional client-server
systems.
• When you are using cloud computing to store your data, you need to trust
AWS and Google drives, but with the blockchain, because it utilizes peer to
peer network you don’t need to trust any third parties which can modify your
crucial data. These are non-resistant to censorship by central authorities.
• These networks are virtually immune to the Denial-of-Service (DoS) attacks.
• The distributed peer-to-peer network, when paired with a majority consensus
requirement, gives blockchains a relatively high degree of resistance to
malicious activity.
Distributed P2P Network
Peer to peer networks is defined as the group of devices that are connected together to create a network .
The network, once formed, can be used to share files and store them as well. In any of the peer-to-peer networks, all the nodes
generally have equal power and can use the same tasks.
In a P2P network, the users are themselves responsible for maintaining the distributed network.
As it is a peer to peer network, there is no need for a central authority or administrator.
This means that each node needs to act as both client and server to other nodes on the server.
Each of the nodes has a copy of the file.
By doing so, each node acts as a server and needs to either download files from other nodes or upload them to other nodes.
Link to video
Node to have two distinct functions.
The first function is to act as a client when downloading files from other nodes on the network
The node can act as a server when it is required to serve files to other nodes.
This sharing and receiving aspect can be done by a node simultaneously, which makes the P2P network so efficient and fast.
The network tends to become more efficient as the network grows.
Types of the peer to peer network
● Unstructured P2P networks
● Structured P2P networks
● Hybrid P2P networks
Mining
• Blockchain mining is a process to validate every step in the
transactions while operating Bitcoins or other cryptocurrencies.
• The people involved here are known as Blockchain miners, and these
miners function is to authenticate the transfer of currency from a
computer in the network to another.
• The main objective of mining is to ensure that the quality and security
of the decentralized network.
• Mining, in the context of Blockchain technology , is the process of
adding transactions to the large distributed public ledger of existing
transactions.
Mining
• Blockchain mining is used to secure and verify Bitcoin transactions.
Mining is the process by which new Bitcoin is added to the money
supply.
• The process of new coin generation is called mining. Bitcoin mining is
the process of creating new Bitcoin by solving a computational puzzle.
• Mining is serves to secure the Bitcoin system against transactions or
fraudulent transactions spending the same amount of Bitcoin more
than once, known as double spend.
• Miners provide processing power to the Bitcoin network in exchange
for the opportunity to be rewarded Bitcoin. Miners confirm new
transactions and record them on the global ledger.
Mining
• A new block, containing transactions that occurred since the last
block, is mined every ten minutes, according adding those
transactions to the Blockchain.
• Transactions that become part of a block and added to the Blockchain
are considered confirmed, which allows the new owners of Bitcoin to
spend the Bitcoin they received in those transactions.
• Miners receive two types of rewards for mining that is new coin
created with new each block, and transaction fees from all the
transactions included in the block.
Mining
• To earn this rewards, the miners compete to solve a difficult
mathematical problem based on a cryptographic hash algorithm.
• The solution to the problem, called the Proof of Work(PoW) , is
included in the new block and acts as proof that the miner expended
significant computing effort.
• The competition to solve the PoW algorithm to earn rewards and the
right to record transactions on the Blockchain is the basis for Bitcoins
security model.
Working of Mining
• Blockchain mining is a process used to validate new transactions. Mining is
an essential activity in the Blockchain network.
• It is the way the peer-to-peer network verifies transactions and reaches
common consensus without requiring central authority.
• The mining process starts when miners are trying to validate new
transactions and record them on the Blockchain.
• The miners are competing to solve a difficult mining puzzle based on
cryptographic hash algorithm.
• The solution found is called PoW. When a block is solved, all the
transactions contained in the candidate block are considered validated, and
the new block is confirmed.
Working of Mining
• This new block will be appended to the Blockchain. The time taken to
confirm a new block is approximately 10 minutes for Bitcoin, but for other
coins it is much faster.
• So, if we send or receive Bitcoin, it will take approximately 10 minutes for
the transaction to be confirmed.
• Miners receive a reward when they solve the complex mathematical
problem. There are two types of rewards namely, new Bitcoins and
transaction fees.
• Mining ensures that only legitimate transactions are verified in the
Blockchain of any given cryptocurrency.
• Mining uses cryptographic hash function called double SHA-256
Working of Mining
• If we consider a block to mine first, we need to collect the new
transactions into a block, and then we hash the block to form a 256-
bit block hash value.
• When the hash initiate, the block has been successfully mined and is
directed to the Bitcoin Blockchain network, and that has turned into
the identifier for the block.
• In many cases, the hash is not successful, so we need to alter the
block to some extent and try again and again.
Mining process in Blockchain
Nonce
• Nonce stands for number used only once.
• Nonce is a 32-bit random number which can be used one time.
• Nonce is often used on cryptographic hash functions and
authentication protocols.
• The nonce in a Bitcoin block is a 32-bit field whose value is adjusted
by miners so that the hash of the block will be less than or equal to
current target of the network.
• In the Blockchain technology, a nonce refer to a psedo-random
number that is utilized as a counter during the process of mining.
Nonce
• The miners create a block and verify it and will be rewarded for
using their CPU power to do so.
• The block which gets more than 50% consensus will be added
to the block chain.
• During the verification of Block, the miners will complete
the Proof of Work which covers all the data of the block, and
checks whether the hash value of the current block is lesser
than the target.
• To create a block which will be accepted by most of the network
participants, Miners compete to complete the Proof of Work at
the earliest.
• The difficulty of the work is adjusted to take at least 10 minutes
per Block, which has become a standard time to add a block to
the block chain in case of Bitcoin Network.
• Once the perfect Nonce is found, it is added to the hashed
block. Along with this number, the hash value of that block will
get rehashed and creates a difficult algorithm.
• It is compared to the existing target, whether it is lower or equal
to the current target.
• Miners test and discard millions of Nonce per second until they
find that Golden Nonce which is valid.
• In order to complete the verification faster than other miners,
miners compete with each other using their computer hashing
power.
• Once the Golden Nonce is found, they can complete the Block
and add it to the Block Chain and there by receive the Block
reward.
• In cryptography, a nonce is an arbitrary number that can be used just once
in a cryptographic communication. It is often a random number issued in
an authentication protocol to ensure that, same communication is not
reused.
• There will be some constant information, timestamp, hash value with
difficulty, and the nonce which when passed through Hash algorithm –
SHA256 will become a new block. Here nonce plays a very important role.
• As we have already discussed, millions of nonce values are tried until the
Golden Nonce is found.The target hash value is defined as the difficulty
and the iterative calculation of the hash value requires the miner’s
computer resources.
• Only with the correct Nonce value, proof of work can be created and thus
giving birth to a new Block in the Block chain.
Chapter 2.pptx

More Related Content

Similar to Chapter 2.pptx

Blockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfBlockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdf
adinugroho751867
 
Quantum Secured Blockchain
Quantum Secured BlockchainQuantum Secured Blockchain
Quantum Secured Blockchain
ravi sahal
 
Blockchain Session 1
Blockchain Session 1Blockchain Session 1
Blockchain Session 1
DSCPICT
 
Blockchain, working [blockchain vs bitcoin] pros and cons
Blockchain, working [blockchain vs bitcoin] pros and consBlockchain, working [blockchain vs bitcoin] pros and cons
Blockchain, working [blockchain vs bitcoin] pros and cons
Jerin Sebastian
 
Blockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency RegulationsBlockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency Regulations
Amir Rafati
 
Blockchain and bitcoin
Blockchain and bitcoinBlockchain and bitcoin
Blockchain and bitcoin
Tejhaskar Ashok Kumar
 
Blockchain fundamentals
Blockchain fundamentalsBlockchain fundamentals
Blockchain fundamentals
Ahmed Mekawy
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchains
Brett Colbert
 
Introduction to Blockchain & development
Introduction to Blockchain & developmentIntroduction to Blockchain & development
Introduction to Blockchain & development
Abdullah Aziz
 
Blockchain Fundamentals
Blockchain FundamentalsBlockchain Fundamentals
Blockchain Fundamentals
Provide Technologies
 
BLOCKCHAIN.pptx
BLOCKCHAIN.pptxBLOCKCHAIN.pptx
BLOCKCHAIN.pptx
ChelladuraiBose1
 
How Blockchain Can Be Used In Supply Chain Management & How It Works?
How Blockchain Can Be Used In Supply Chain Management & How It Works?How Blockchain Can Be Used In Supply Chain Management & How It Works?
How Blockchain Can Be Used In Supply Chain Management & How It Works?
Blockchain Council
 
What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?
PECB
 
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain,  Hyperledger, DeFi, Web 3.0 - understanding and conceptsBlockchain,  Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
keithfernandez19
 
Blockchain
BlockchainBlockchain
Blockchain
Abhinand Valasseri
 
Blockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction CourseBlockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction Course
Jean-Marc Seigneur
 
Block chain technology
Block chain technologyBlock chain technology
Block chain technology
Md. Syful Azam
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and Cryptocurrencies
nimeshQ
 
BlockChain Techonology - Unit 1.pptx
BlockChain Techonology   -   Unit 1.pptxBlockChain Techonology   -   Unit 1.pptx
BlockChain Techonology - Unit 1.pptx
os3558995
 

Similar to Chapter 2.pptx (20)

Blockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfBlockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdf
 
Quantum Secured Blockchain
Quantum Secured BlockchainQuantum Secured Blockchain
Quantum Secured Blockchain
 
Blockchain Session 1
Blockchain Session 1Blockchain Session 1
Blockchain Session 1
 
Blockchain, working [blockchain vs bitcoin] pros and cons
Blockchain, working [blockchain vs bitcoin] pros and consBlockchain, working [blockchain vs bitcoin] pros and cons
Blockchain, working [blockchain vs bitcoin] pros and cons
 
Blockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency RegulationsBlockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency Regulations
 
Blockchain and bitcoin
Blockchain and bitcoinBlockchain and bitcoin
Blockchain and bitcoin
 
Blockchain fundamentals
Blockchain fundamentalsBlockchain fundamentals
Blockchain fundamentals
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchains
 
Introduction to Blockchain & development
Introduction to Blockchain & developmentIntroduction to Blockchain & development
Introduction to Blockchain & development
 
Blockchain Fundamentals
Blockchain FundamentalsBlockchain Fundamentals
Blockchain Fundamentals
 
BLOCKCHAIN.pptx
BLOCKCHAIN.pptxBLOCKCHAIN.pptx
BLOCKCHAIN.pptx
 
How Blockchain Can Be Used In Supply Chain Management & How It Works?
How Blockchain Can Be Used In Supply Chain Management & How It Works?How Blockchain Can Be Used In Supply Chain Management & How It Works?
How Blockchain Can Be Used In Supply Chain Management & How It Works?
 
What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?
 
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain,  Hyperledger, DeFi, Web 3.0 - understanding and conceptsBlockchain,  Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
 
Blockchain
BlockchainBlockchain
Blockchain
 
BlockChain.pptx
BlockChain.pptxBlockChain.pptx
BlockChain.pptx
 
Blockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction CourseBlockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction Course
 
Block chain technology
Block chain technologyBlock chain technology
Block chain technology
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and Cryptocurrencies
 
BlockChain Techonology - Unit 1.pptx
BlockChain Techonology   -   Unit 1.pptxBlockChain Techonology   -   Unit 1.pptx
BlockChain Techonology - Unit 1.pptx
 

Recently uploaded

Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
muralinath2
 
justice-and-fairness-ethics with example
justice-and-fairness-ethics with examplejustice-and-fairness-ethics with example
justice-and-fairness-ethics with example
azzyixes
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
IqrimaNabilatulhusni
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
anitaento25
 
Hemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptxHemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptx
muralinath2
 
Predicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfPredicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdf
binhminhvu04
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
Lab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerinLab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerin
ossaicprecious19
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
YOGESH DOGRA
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
aishnasrivastava
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
SAMIR PANDA
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
AADYARAJPANDEY1
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
muralinath2
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
Lokesh Patil
 

Recently uploaded (20)

Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
 
justice-and-fairness-ethics with example
justice-and-fairness-ethics with examplejustice-and-fairness-ethics with example
justice-and-fairness-ethics with example
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
 
Hemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptxHemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptx
 
Predicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfPredicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdf
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
Lab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerinLab report on liquid viscosity of glycerin
Lab report on liquid viscosity of glycerin
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
 

Chapter 2.pptx

  • 1. Chapter 2 How Blockchain Works? • Understanding SHA256 Hash • Immutable Ledger • Distributed P2P Network • How Mining Works? (The NONCE and Cryptographic Puzzle) • Byzantine Fault Tolerance • Consensus Protocols: Proof of Work, Proof of State, Défense Against Attackers, Competing Chains • Blockchain Demo
  • 2. Introduction • Blockchain first came to fame in October 2008,to light when a white paper on “Bitcoin:A peer-to-peer electronic cash system” as part of proposal for Bitcoin published by a person or Group of individuals name ‘Satoshi Nakamoto’. • Blockchain is the backbone technology of digital cryptocurrency Bitcoin. Bitcoin is a type of digital currency that we can transfer within the Bitcoin network without the help of mediators. We can store Bitcoin in a digital wallet or e-wallet. • Cryptocurrency wallet or crypto wallet like BitGo is a device or a program or a service which stores public or private keys for cryptocurrency transactions. • Blockchain technology records transaction in a digital ledger which is distributed over the network thus making it incorruptible.
  • 3. Introduction • People and institutions who do not know or trust each other, live in different countries are subject to different authorities, and who have no legally binding agreements with each other, can now interact over the internet without the need for trusted third parties like banks, internet platforms and other types of clearing institutions. • Storing data across a peer-to-peer network eliminates problems emerging from the vulnerability of centralized servers while using different cryptographic methods to secure the network.
  • 5. Hashing • Hashing is essential to Blockchain in cryptocurrency. A hash is a mathematical function that converts an input of arbitrary length into encrypted output of fixed length. • Hashing in Blockchain ensures that all blocks are well formed and temper-free and thus the Blockchain will remain secure and virtually un-breakable.
  • 6. Properties of hashing 1. Collision Free: It is impossible to find two input texts that produces the same hash value. 2. Easy to generate: It is easy to generate a hash value for a particular input using hash function. 3. Irreversible :It is impossible to generate original text from the hash value. 4. Commitment :It is not feasible to modify original text without resulting a change in hash value thus enabling data integrity.
  • 8. Concept of Hash Function • A hash function takes any input like numbers, words etc. and through the use of an algorithm, produces an output of a specific length. • A hash function maps the data of any arbitrary size to data of fixed size. Bitcoin uses SHA-256 hash function that produces a hash of size 256 bits. • The process of applying on the data is called hashing
  • 9. Features of hash function 1. Pre-image Resistance: The hash function works in only one direction i.e. we cannot deduce the input from the output. Consequently , for two sets of input, even if the inputs only differ by the smallest detail, the outputs should be wildly different and not resemble one another. 2. Collision Resistance: When a hash function produces the same or identical output for two different inputs, this is called a collision. It is imperative that collisions are avoided in order to guarantee data integrity.
  • 11. Understanding SHA256 Hash • The Secure Hash Algorithm(SHA) is a family of cryptographic hash functions published by the National Institute of Standards and Technology(NIST). • Cryptographic hash function SHA-256 takes input of any size and the output is always a fixed size 256 bits(32 bytes). • SHA-0 is the first version of the SHA algorithm. In 2004, several weaknesses were exposed in the algorithm, resulting in the creation of a new stronger version of SHA-0 called SHA-1. • In 2005, an attack of SHA-1 reported that it would find a collision in fewer hashing operations.SHA-2 was created to overcome SHA-1 vulnerabilities and it could be implemented with a digest size of 224,256,284 and 512 bits.
  • 12. Understanding SHA256 Hash • SHA-2 is a widely used standard in modern cryptographic applications. Bitcoin uses the SHA-256 variant as a hashing algorithm to solve Proof-of-Work(PoW) puzzles.SHA-3 is the latest family of hash functions with 224,256,384 and 512 bit variants. • SHA-256 hash function commonly used in Blockchain Technology. • SHA-256 is a popular hashing algorithm used in Bitcoin encryption, it was introduce when the network launched in 2009. • The top three SHA-256 Blockchain projects by market capitalization are Bitcoin(BTC), Bitcoin Cash(BCH) and Bitcoin satoshi’s vision(BSV)
  • 14. Immutable Ledger • Immutable ledger in blockchain refers to any records that have the ability to remain unchanged. • It cannot be altered and hence the data cannot be changed with ease, thereby making sure that the security is quite tight. • Immutability means that it is very difficult to make changes without collusion. • The central idea behind the blockchain ledger is the security of data and the proof that data has not been changed or altered.
  • 15. Understanding Blockchain Immutability • Immutability is defined as the ability of a blockchain ledger to remain unchanged, unaltered, and indelible. • Each of the blocks of information like facts or transaction details is carried out with the help of a cryptographic principle or a hash value. • Now, this hash value has an alphanumeric string generated by each block individually. • Each of the blocks contains a hash value or digital signature for itself and for the previous one as well. • This, in turn, makes sure that the blocks are retroactively coupled together and unrelenting. • It is this functionality of blockchain technology that makes sure no one is able to interfere with the system or change the already saved data into the block. • In this regard, it is also quite essential to know that blockchain is distributed and decentralized in nature. • Here a consensus is made among the different storing a copy of the data. • It is this consensus that makes sure the originality of data is righty maintained. • Immutability is undoubtedly one of the most definitive features of blockchain technology and also brings out the best use cases of smart contracts that can be deployed. • The concept can simply redefine the entire process of auditing of data to make it much more efficient, and cost-effective, along with bringing about more trust as well as integrity into the data.
  • 16. How to Achieve Immutability? • To understand how to achieve immutability, clarification of the concept of cryptographic hashing is essential. • Nowadays, the generation of a cryptographic is not quite a dreadful task. • It is because of the fact that modern programming languages come with an array of hash functions. • With the help of these hash functions, it is just required to pass a set of bytes and the function will be returning a checksum signature. • These functions always generate a string of length of 64 characters and we would always be getting the fixed string length regardless of the size of the input, which is referred to as a digital signature. The digital signature points to the exact data that the users input. • But hash cannot be reverse-engineered which means that the users cannot make use of this output string for the purpose of finding the input data. • This, in turn, results in the immutability of the blockchain ledger. • In this system, each of the transactions is verified with the help of a blockchain network. • It includes blocks of information embedded with timestamps and is secured by a hashing process. • It links together and incorporates the hash of the last block. This mechanism plays a major role in developing the chronological chain which helps in joining each of the blocks.
  • 17. How to Achieve Immutability? • The meta-data of the last block is always included by hashing at the time of generating a new hash for it. • This, in turn, helps in creating a link between the block and the chain, thereby making it unbreakable. • Once this is done, none can alter or delete the data of the block which is placed in the blockchain. • It is because whenever anyone would be attempting to make a change, the modification is rejected by the subsequent block since the hash of the block would not be valid anymore. • To state in a line, it would come like this. Immutability = Cryptography + Blockchain Hashing Process
  • 18. Benefits of Immutable Ledger in Blockchain • Security is Tight in Blockchain The immutable ledger on the blockchain is quite secure. We already know that blockchain is distributed ledgers. It means that there is no central point of authority that can control it. Thus, at any point in time, the hackers try to compromise the data, it is just next to impossible to do the same at the time when it is managed with more than two servers or nodes. Additionally, each of the actions that are made on a digital ledger is encrypted with a unique hash code to which the majority of the nodes must agree upon the action. This, in turn, makes sure that there is a free as well as a transparent flow of data along with protecting the information from being corrupted.
  • 19. Benefits of Immutable Ledger in Blockchain • Ensures Authenticity and High Quality It is known that an immutable ledger on blockchain benefits the users with its high level of security and traceability. These features play a significant role in effectively dealing with the fraudulent market. Every year counterfeit goods result in costing a huge sum of money to authorized brands, but the use of blockchain in this regard could certainly be the revolutionary solution. It works by registering different items on the blockchain system where the manufacturers can very easily provide all the required information to their customers regarding the origins of the products, their historic records, current and previous owners. By just tagging the items on a blockchain, the buyers would be able to understand whether the item is authentic or not.
  • 20. Benefits of Immutable Ledger in Blockchain • Readily Benefits Supply Chain Management Supply chain management is another area where the immutable ledger on blockchain proves to be immensely beneficial. The entire process of exchanging goods needs to be handled with a lot of responsibility. At the time of transporting items, there are chances of loss, stealing, misplacing, or damage. Keeping this in mind, a number of logistics companies have already started using blockchain to avail the benefits. On the other hand, there are some companies that are currently experimenting with blockchain before using the same in their mainstream. With the use of blockchain technology, the parties are allowed to very quickly share data. Most importantly, even the slightest inconvenience caused at the time of a shipment would be registered. A digital ledger in this regard plays a crucial role in providing very tight security by enhancing transparency as well as traceability of goods in the supply chain.
  • 21. Benefits of Immutable Ledger in Blockchain • Higher Level of Privacy The information which we share or put online is always vulnerable to outside harm, like leaks, hacks, and personal threats. We tend to treat the data as private and try to make sure that that privacy is not easily compromised in this regard. The use of blockchain can prove to be quite beneficial here since it is different from the standard database which ensures that privacy is much better for the users. Blockchain is anonymous, and each of the users is protected with encrypted codes which makes it next to impossible to detect the account information of any of the users. But it is to be kept in mind that levels of privacy depend on a specific blockchain and the security features it possesses.
  • 22. Immutability It is the most desired property to maintain the atomicity of the blockchain transactions. Once a transaction is recorded, it cannot be altered. If the transactions are broadcast to the network, then almost everyone has a copy of it. With time, when more and more blocks are added to the blockchain, the immutability increases and after a certain time, it becomes completely immutable. For someone to alter the data of so many blocks in a series is not practically feasible because they are cryptographically secured. So, any transaction that gets logged remains forever in the system. Link to Video
  • 23. Introduction to P2P Network and its Types ● Peer to peer network, commonly known as P2P is a decentralized network communications model that consists of a group of devices (nodes) that collectively store and share files where each node acts as an individual peer. ● In this network, P2P communication is done without any central administration or server, which means all nodes have equal power and perform the same tasks. ● P2P architecture is suitable for various use cases and can be categorized into structured, unstructured, and hybrid peer-to-peer networks. ● The unstructured peer-to-peer networks are formed by nodes randomly from connection to each other, but they are inefficient than structured ones. ● In structured peer-to-peer systems, the nodes are organized, and every node can efficiently search the network for the desired data. ● Hybrid models are actually a combination of P2P and client-server models, and when compared to the structured and unstructured P2P systems, these networks tend to present improved overall performance. ● Today, P2P networks are the foundation of most of the cryptocurrencies, thus, making up a significant portion of the blockchain industry.
  • 24. P2P vs. Traditional Client-Server Systems ● Before understanding the role of these networks in blockchain, let’s distinguish between P2P and traditional client-server architecture. ● The critical difference between both the systems is that in Client-Server, there is a dedicated server and specific clients whereas, in P2P, it is maintained by a distributed network of users, where each node can act both as a server and a client.
  • 25. Role of P2P in Blockchain ● P2P is a technology that is based on a very simple principle, and that is the concept of decentralization. ● The peer-to-peer architecture of blockchain allows all cryptocurrencies to be transferred worldwide, without the need of any middle-man or intermediaries or central server. ● With the distributed peer-to-peer network, anyone who wishes to participate in the process of verifying and validating blocks can set up a Bitcoin node. ● Blockchain is a decentralized ledger tracking of one or more digital assets on a peer-to-peer network. ● When we say a peer-to-peer network, it means a decentralized peer-to-peer network where all the computers are connected in some way, and where each maintains a complete copy of the ledger and compares it to other devices to ensure the data is accurate. ● This is unlike a bank, where transactions are stored privately and are managed only by the bank.
  • 26. P2P: Advatages • As blockchain is a decentralized system of peer to peer network, it is highly available due to decentralization. • Because of P2P networking capability, even if one peer gets down, the other peers are still present. Thus nobody can take down the blockchain. • P2P networks offer greater security compared to traditional client-server systems. • When you are using cloud computing to store your data, you need to trust AWS and Google drives, but with the blockchain, because it utilizes peer to peer network you don’t need to trust any third parties which can modify your crucial data. These are non-resistant to censorship by central authorities. • These networks are virtually immune to the Denial-of-Service (DoS) attacks. • The distributed peer-to-peer network, when paired with a majority consensus requirement, gives blockchains a relatively high degree of resistance to malicious activity.
  • 27. Distributed P2P Network Peer to peer networks is defined as the group of devices that are connected together to create a network . The network, once formed, can be used to share files and store them as well. In any of the peer-to-peer networks, all the nodes generally have equal power and can use the same tasks. In a P2P network, the users are themselves responsible for maintaining the distributed network. As it is a peer to peer network, there is no need for a central authority or administrator. This means that each node needs to act as both client and server to other nodes on the server. Each of the nodes has a copy of the file. By doing so, each node acts as a server and needs to either download files from other nodes or upload them to other nodes. Link to video
  • 28. Node to have two distinct functions. The first function is to act as a client when downloading files from other nodes on the network The node can act as a server when it is required to serve files to other nodes. This sharing and receiving aspect can be done by a node simultaneously, which makes the P2P network so efficient and fast. The network tends to become more efficient as the network grows.
  • 29. Types of the peer to peer network ● Unstructured P2P networks ● Structured P2P networks ● Hybrid P2P networks
  • 30. Mining • Blockchain mining is a process to validate every step in the transactions while operating Bitcoins or other cryptocurrencies. • The people involved here are known as Blockchain miners, and these miners function is to authenticate the transfer of currency from a computer in the network to another. • The main objective of mining is to ensure that the quality and security of the decentralized network. • Mining, in the context of Blockchain technology , is the process of adding transactions to the large distributed public ledger of existing transactions.
  • 31. Mining • Blockchain mining is used to secure and verify Bitcoin transactions. Mining is the process by which new Bitcoin is added to the money supply. • The process of new coin generation is called mining. Bitcoin mining is the process of creating new Bitcoin by solving a computational puzzle. • Mining is serves to secure the Bitcoin system against transactions or fraudulent transactions spending the same amount of Bitcoin more than once, known as double spend. • Miners provide processing power to the Bitcoin network in exchange for the opportunity to be rewarded Bitcoin. Miners confirm new transactions and record them on the global ledger.
  • 32. Mining • A new block, containing transactions that occurred since the last block, is mined every ten minutes, according adding those transactions to the Blockchain. • Transactions that become part of a block and added to the Blockchain are considered confirmed, which allows the new owners of Bitcoin to spend the Bitcoin they received in those transactions. • Miners receive two types of rewards for mining that is new coin created with new each block, and transaction fees from all the transactions included in the block.
  • 33. Mining • To earn this rewards, the miners compete to solve a difficult mathematical problem based on a cryptographic hash algorithm. • The solution to the problem, called the Proof of Work(PoW) , is included in the new block and acts as proof that the miner expended significant computing effort. • The competition to solve the PoW algorithm to earn rewards and the right to record transactions on the Blockchain is the basis for Bitcoins security model.
  • 34. Working of Mining • Blockchain mining is a process used to validate new transactions. Mining is an essential activity in the Blockchain network. • It is the way the peer-to-peer network verifies transactions and reaches common consensus without requiring central authority. • The mining process starts when miners are trying to validate new transactions and record them on the Blockchain. • The miners are competing to solve a difficult mining puzzle based on cryptographic hash algorithm. • The solution found is called PoW. When a block is solved, all the transactions contained in the candidate block are considered validated, and the new block is confirmed.
  • 35. Working of Mining • This new block will be appended to the Blockchain. The time taken to confirm a new block is approximately 10 minutes for Bitcoin, but for other coins it is much faster. • So, if we send or receive Bitcoin, it will take approximately 10 minutes for the transaction to be confirmed. • Miners receive a reward when they solve the complex mathematical problem. There are two types of rewards namely, new Bitcoins and transaction fees. • Mining ensures that only legitimate transactions are verified in the Blockchain of any given cryptocurrency. • Mining uses cryptographic hash function called double SHA-256
  • 36. Working of Mining • If we consider a block to mine first, we need to collect the new transactions into a block, and then we hash the block to form a 256- bit block hash value. • When the hash initiate, the block has been successfully mined and is directed to the Bitcoin Blockchain network, and that has turned into the identifier for the block. • In many cases, the hash is not successful, so we need to alter the block to some extent and try again and again.
  • 37. Mining process in Blockchain
  • 38. Nonce • Nonce stands for number used only once. • Nonce is a 32-bit random number which can be used one time. • Nonce is often used on cryptographic hash functions and authentication protocols. • The nonce in a Bitcoin block is a 32-bit field whose value is adjusted by miners so that the hash of the block will be less than or equal to current target of the network. • In the Blockchain technology, a nonce refer to a psedo-random number that is utilized as a counter during the process of mining.
  • 39. Nonce
  • 40. • The miners create a block and verify it and will be rewarded for using their CPU power to do so. • The block which gets more than 50% consensus will be added to the block chain. • During the verification of Block, the miners will complete the Proof of Work which covers all the data of the block, and checks whether the hash value of the current block is lesser than the target.
  • 41. • To create a block which will be accepted by most of the network participants, Miners compete to complete the Proof of Work at the earliest. • The difficulty of the work is adjusted to take at least 10 minutes per Block, which has become a standard time to add a block to the block chain in case of Bitcoin Network. • Once the perfect Nonce is found, it is added to the hashed block. Along with this number, the hash value of that block will get rehashed and creates a difficult algorithm.
  • 42. • It is compared to the existing target, whether it is lower or equal to the current target. • Miners test and discard millions of Nonce per second until they find that Golden Nonce which is valid. • In order to complete the verification faster than other miners, miners compete with each other using their computer hashing power. • Once the Golden Nonce is found, they can complete the Block and add it to the Block Chain and there by receive the Block reward.
  • 43. • In cryptography, a nonce is an arbitrary number that can be used just once in a cryptographic communication. It is often a random number issued in an authentication protocol to ensure that, same communication is not reused. • There will be some constant information, timestamp, hash value with difficulty, and the nonce which when passed through Hash algorithm – SHA256 will become a new block. Here nonce plays a very important role. • As we have already discussed, millions of nonce values are tried until the Golden Nonce is found.The target hash value is defined as the difficulty and the iterative calculation of the hash value requires the miner’s computer resources. • Only with the correct Nonce value, proof of work can be created and thus giving birth to a new Block in the Block chain.