You are on page 1of 18

Blockchain Mining

Blockchain Mining
Mining, in the context of blockchain technology, is the process of validation and adding
transactions to the large distributed public ledger of existing transactions, known as the
blockchain

Transaction Solve Mathematical  Miner Solved Miners Verify  the  Block is added


          Problem Problem First          Validity 
(Behind the scenes)
DF123 DF123
ABC56 ABC56
EF123 EF123
BBC66 BBC66

DF123
ABC56
EF123
BBC66

DF123
ABC56
EF123
BBC66
So what do miners actually do?
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

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 other. The difficulty level is a measure of how
difficult is to find the hash.

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
How Mining Works ?

Nonce:
 The nonce is the number that blockchain miners are solving for.
The Nonce is a random whole number, which is a 32-bit (4 byte) field, which is adjusted by the
miners, so that it becomes a valid number to be used for hashing the value of block. Nonce is
the number which can be used only once. Once the perfect Nonce is found, it is added to the
hashed block.

The miners keep changing the nonce in a brute force manner and the
corresponding hash is computed each time. This is the real game and the
computational power of nodes really matters here because the miners have to try
out large combinations of ‘Nonce’. The node which equipped with dedicated
hardware and high computational power has a greater chance to win this game
and get the block reward.
• Those who find hash first will broadcast the block along with the
nonce. By receiving this, others stop mining and validate whether the
received hash satisfies the specified difficulty level. If yes, the nodes
show their acceptance by adding it to the blockchain
The Nonce

Block No.-

Nonce:

Data: SHA 256

Prev Hash:
Hash:
Hash:
The Nonce

Block No.- 6

Nonce:
Data:
Rohit->Ravi 400 coins
Ram->pankaj 200 coins
Prev Hash: 0000AB23
Hash:
The Nonce

Block No.- 6

Nonce: 23
Data:
Rohit->Ravi 400 coins
Ram->pankaj 200 coins
Prev Hash: 0000AB23
Hash: 00001ba1
Hashing Algorithm

5819E961F19967B4ECB242
Document, Audio, Video, SHA25
9085E17909CFFD4DCB626
etc. 6
7D0067F6CAEC22150A7B1

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 ?
• Hexadecimal Numbers
Decimal Hexadecimal Decimal Hexadecimal
0 0 11 B
1 1 12 C
2 2 13 D
3 3 14 E
4 4 15 F
5 5
6 6
7 7
8 8
9 9
10 A
How Mining Works ?

• d2fd3930d274b202fe8e7cb431e38a8b64ec396e15f5717e60493234b0de210a
• 52d095795c1dc87ff2f6b4d9b005a1fe2cfed01103763c9443f6d4496df8e800
• 0000005432d9f64f6e05c019f9302162100163b6cdba06bd72eee35cd19aebf

Smallest- 0000000.......................0 Largest- fffffffffffff..................f


How Mining Works ?

All Possible Hashes

Block No.-6

Nonce:

Data:
Kshitij->Rakesh 500 coins​
Raj->Bella 200 coins
Prev Hash: 0000AB23
Hash:
How Mining Works ?

All Possible Hashes

Block No.-6 Largest

Nonce:

Data:
Kshitij->Rakesh 500 coins​​
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash:
Smallest
How Mining Works ?

All Possible Hashes

Block No.-6 Largest

Nonce:76

Data:

Prev Hash: 0000AB23 Target('0000')


Hash: 1da81a0e
Smallest
How Mining Works ?

All Possible Hashes

Block No.-6 Largest

Nonce:512

Data:
Rohit >Ravi 500 coins 
Ram->Pankaj 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: 0000b6aa
Smallest
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.
The target adjusts every 2016 blocks (roughly two
weeks) to try and ensure that blocks are mined once
every 10 minutes on average. 

You might also like