Blockchain
Blockchain
Bitcoin vs Blockchain
Blockchain Mining
Blockchain
6
Stuart W. Scott
Haber Stornetta
What is blockchain?
Blockchain
6
What is Blockchain?
C
A B
C
A B
C
“ What the internet did for
communications,
blockchain will do for trusted
transactions.
”
- Ginni Rometty (THINK Forum 2017)
5
How Blockchain Network
Works?
Hashing
Algorithm
Hashing Algorithm
Block No.-1
Data
Prev Hash:000000000
Hash:0000D8C42
Block
Hashing Algorithm
Block No.-1
Data
Prev Hash:000000000
Hash:0000D8C42 Fingerprint
Block
Hashing Algorithm
Block No.-
Data
SHA 256
Prev Hash:
Hash:
Hashing Algorithm
Encrypt
ed data
5819E961F19967B4ECB24
Document, Audio , Video 29085E17909CFFD4DCB6
SHA256 267D0067F6CAEC22150A
etc.
7B1
This has 64
hexadecimal characters.
Each character is of 4 bits.
So in total it has 64* 4 bits
i.e. 256 bits.
Hashing Algorithm
Block No.-1
Data
Prev Hash:000000000
Hash:0000D8C42
Hashing Algorithm
Data Data
Genesis Block
Hashing Algorithm
Avalanche
Deterministic ABC 845
Effect
Fast
Computation
Blockchain is nothing but a data structure build upon the concept of Hash functions.
https://emn178.github.io/online-tools/sha256.html
Immutable Ledger
Immutable Ledger
Maintain Register
A B C D E F
Distributed P2P network
A B
C
Distributed P2P network
A B
C
Distributed P2P network
A B
C
Distributed P2P network
A B
C
Distributed P2P network
A B
C
Business networks and assets transfer
• An asset is anything that can be owned or controlled
to produce value, for example, goods and services.
• Transactions describe the exchange of assets Contracts are a set of business terms that should
between participants. be met by participants before a transaction is
completed.
7
Business networks and market growth
• A market is the flow of assets across business networks:
o Public (market or car auction).
o Private (supply chain financing or bonds).
8
Problem…
Participant
B’s records
Participant Bank
A’s records records
Blockchain
11
Blockchain platforms
Blockchain
Mining
How Does a Blockchain Work?
Blockchain Mining
Transaction Solve Mathematical Miner Solved Miners Verify the Block is added
Problem Problem First Validity
How Mining
works: The
Nonce
How Mining Works ?
Nonce
Target
How Mining Works ?
Nonce:
➢ The nonce is the number that blockchain miners
are solving for.
How Mining Works ?
Target:
➢Target is a number used in mining.
➢It is a number that a block hash must be below for
the block to be added on to the blockchain.
Hashing Algorithm
5819E961F19967B4ECB24
Document, Audio, Video, SHA25 29085E17909CFFD4DCB62
etc. 6 67D0067F6CAEC22150A7B
1
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
A21ADC Fees:0.002
Timestamp:
B24ABE Fees:0.006
Transactions:
43AFBC Fees:0.007
E23AB2 Fees:0.004
Prev Hash:000000000
F23A6C Fees:0.005 Hash:
Mempool
(Behind the scenes)
The Mining Mission
Miners aim to find a specific hash value for each new block. The first miner to discover the correct hash receives a block
reward. This reward is paid in newly minted Bitcoins. Here, the mission is to find a hash value for the new block. The miner
who finds the hash value first is rewarded with some bitcoins called block reward
preencoded.png
Difficulty Level
Finding hash value is not a big deal. Every node can do that.
Therefore, a difficulty level is associated with it to make the nodes
compete with each othe
Competition
Nodes compete to solve the hash problem.
Measurement
Difficulty is a measure of the challenge.
preencoded.png
Nonce
Since the data of a block remains same, the hash is always
same. Therefore, the only possibility to try out different hash
values is by associating a nonce with the content of the
block. The nonce is an arbitrary string of 32-bit length.
Range of Nonce = 0 to 2^32 –1 ≃ 0 to 4 x10^9
preencoded.png
Mining Process: Steps
1 Transaction Verification
Verify pending transactions.
2 Block Creation
Construct a new block.
3 Nonce Iteration
Try different nonce values.
4 Hash Submission
Submit the winning hash.
preencoded.png
The Nonce
Block No.-
Nonce:
Data:
Prev Hash:
Hash:
The Nonce
Block No.-
Nonce:
Prev Hash:
Hash:
Hash:
The Nonce
Block No.- 6
Nonce:
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash:
The Nonce
Block No.- 6
Nonce: 23
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash: 00001ba1
The Nonce
Block No.- 6
Nonce: 50
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash: 0000fb12
The Nonce
Block No.- 6
Nonce: 3
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash: 0000acc12
The Nonce
Block No.- 6
Nonce: 1001
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash: 0000ef23
Hashing Algorithm
5819E961F19967B4ECB24290
Document, Audio, Video, SHA256 85E17909CFFD4DCB6267D00
etc. 67F6CAEC22150A7B1
This has 64
hexadecimal characters.
Each character is of 4 bits.
So in total it has 64* 4 bits
i.e. 256 bits.
How Mining Works ?
• d2fd3930d274b202fe8e7cb431e38a8b64ec396e15f5717e60493234b0de210a
• 52d095795c1dc87ff2f6b4d9b005a1fe2cfed01103763c9443f6d4496df8e800
• 0000005432d9f64f6e05c019f9302162100163b6cdba06bd72eee35cd19aebf
Block No.-6
Nonce:
Data:
RAM>Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash:
How Mining Works ?
Nonce:
Data:
RAM>Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash:
Smallest
How Mining Works ?
Nonce:
Data:
RAM->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash:
Smallest
How Mining Works ?
Nonce:100
Data:
RAM>Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: cd19aebf
Smallest
How Mining Works ?
Nonce:76
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: 1da81a0e
Smallest
How Mining Works ?
Nonce: 201
Data:
RAM>Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: b474e220
Smallest
How Mining Works ?
Nonce:512
Data:
RAM->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: 0000b6aa
Smallest
Understanding Mining Difficulty
Current Target:
0000000000000000000b3ce90000000000000000000000000000
000000000000
19 leading
0's
Understanding Mining Difficulty
Q) Who adjusts the difficulty ?
Time
Electricity
Taki
Bills
ng
Start All
Mathematical Over Again
problem solving Attitude
skill
Fast
Computers
Mining
Pool
Mining Pools
Mining Pools
Mining Pools
CPUs Vs
GPUs Vs
ASCIs
CPUs Vs GPUs Vs ASCIs
GPU< 1 GH/s
Message
Verification
Function
Signature
Yes/
No
PUBLIC KEY VS
BITCOIN ADDRESS
PRIVATE AND PUBLIC KEY
Message
Verification
Function
Signature
Yes/
No
PRIVATE AND PUBLIC KEY
Bitcoin
Private Key Public Key
Address
Message
Verification
Function
Signature
Yes/
No
SMART CONTRACT
Smart Contract
If IOT
detected a Yes Cancel delivery
temperature> and do not pay
30 degree to A.
Celsius
No
Note-Assuming
optimum Do delivery and
temperature <30 transfer money to
degree Celsius. A.
TYPES OF BLOCKCHAIN
There mainly four types of Blockchains that have
emerged after Bitcoin introduced Blockchain to the
world.
1.Public Blockchain:
2.Private Blockchain:
3.Consortium or Federated Blockchain
4.Hybrid Blockchain
Consensus
Protocol
Consensus Protocol
• Proof of Work is one of the first consensus protocols used in blockchain applications. It is
based on computing the hash values and validating the transactions until a specified
number of trailing zeros are found in the hash value. The number that generates the
hash with the specified number of trailing zeros is known as a nonce.
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
A B
E
Orphan Block
Orphan Block
CONSENSUS PROTOCOL
A B
C
CONSENSUS PROTOCOL
Note-
• All the transaction in the Orphan Block will be dropped and the miner that had mined the block will not get any reward.
• An orphan block is a block that has been solved within the blockchain network but was not accepted by the
network.
• There can be two miners who solve valid blocks simultaneously. The network uses both blocks until one chain
has more verified blocks than the other. Then, the blocks in the shorter chain are orphaned
• The longest chain is what individual nodes accept as the valid version of the blockchain
• The rule that nodes adopt the longest chain of blocks allows every node on the network to
agree on what the blockchain looks like, and therefore agree on the same transaction history.
STRUCTURE OF BLOCKCHAIN
• Each block has a Block header and a list of transactions as shown above.
• Go to https://www.blockchain.com/explorer to see the bitcoin block structure.
• WHAT IS A BLOCK HEADER?
• The block header is made up of metadata (data about data). It helps to verify
the validity of a block.
As you can see in the architecture diagram, the block header of a block
consists of:
• Version
• Timestamp
• Hash
• Difficulty-Level
• Nonce
• Merkle Root
• No of Transactions → Number of transaction in a block.
• Output total + Estimated transaction volume→ total amount of bitcoin that have been transferred.
• Transaction Fee → Fee taken by bitcoin network.
• Height → The 1st block has no 1, second block has no 2 and so on... 500312 is the sequence no of
this block.
• Timesatmp → The timestamp marks the time of each transaction. In a way, it proves when and what
has happened on the block.
• Relayed By → BTC TOP is the minor who has mined (validated) this block.
• Difficulty → Difficulty level to find the value of hash.
• Bits and size→ how many bits in the block and size in Kb
• Version → Bitcoin architecture version
• Nonce → nonce is random number used to generate Hash.
• Block Reward → Bitcoin, miner earned by mining this block.
NONCE RANGE
Block No.-1
Nonce:
Nonce is a 32 bit
number.
Data
Range of Nonce = 0 to 2^32 –
Prev Hash:000000000
1 ≃ 0 to 4 x10^9
Hash:0000D8C42
NONCE RANGE
SHA 256
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxx
Q) So what the miners do when all the nonce get exhausted and miners
have not
hit the target ?
That there are not enough nonce to generate the valid
hash.
All Possible Hashes
Largest
Smallest
TIMESTAMP
Block No.-1
Nonce:
Data
Prev Hash:000000000
Hash:
TIMESTAMP
Block No.-1
Nonce:
Timestamp: 1622186555
SHA 256
Data
Prev Hash:000000000
Hash:
Further examples by (selected) industry
27
Shared ledger
12
Smart contract
13
Privacy
The ledger is shared, but
• Participants require: participants require privacy and
• Appropriate privacy and confidentiality confidentiality.
between subsets of participants.
• An identity that is not linked to a
transaction.
• Transactions must be authenticated.
• Cryptography is central to these
processes.
14
Bitcoin versus blockchain for business
17
Example:
Supply chain
22
Example:
Audit and compliance