The process that is required for the functioning of bitcoin network and also responsible for creating new bitcoins is called Bitcoin mining. The main part of bitcoin mining is earning bitcoin. There is a lot that happens behind the scenes which also runs the bitcoin network. Let's see what happens and how one can earn bitcoin by mining.
A miner has a open-source bitcoin mining software in his computer. Immense computing power is required for mining bitcoin. These miners are called the nodes of the network. Mining involves solving difficult mathematical cryptographic problems, based on the hash algorithm (the solution is the proof-of-work that gets added to the new block).
Miners are rewarded in two ways, first by producing new bitcoins and other by payment network trustworthy and secure, by verifying its transaction information.


We present you all the details of bitcoin mining and how to earn bitcoin from mining it
Mining Equipment

Bitcoin network is decentralised and peer-to-peer(A peer-to-peer (P2P) network consists of a group of devices that collectively store and share files). Each participant acts as an individual peer. Every member in the network has to maintain a copy of all previous transactions, in order to check if the future transactions are valid or not.
Let's say X wants to send 2 bitcoins to Y, the data like receiver's address, amount to be sent etc will be broadcasted to the network. All the transactions from the last ten minutes will be bundled into a block.

Now, the actual process begins,
Miner node sends himself a mining reward, where coins generate out of nowhere(What? Just continue reading). This transaction is called the Coinbase transaction. This is, in fact, the first transaction in the block.
Now every transaction in the block is hashed(Hashing means converting input into an encrypted output of fixed length. For, same input, the hash is always same but the odds of finding input from a given hash is 1 in 2^256)
The hashes of transactions are organised into a Merkle tree. That is hashes of transactions are paired and hashed again until the top of the tree is achieved. The topmost hash is known as the Root hash or Merkle Root.
The Merkle Root, Hash of the previous block and a random number called Nonce are placed in the block's header. Block header is of 80 bytes. Here, the block header is the input and Nonce is a variable.

Bitcoin's algorithm is SHA-256(Secure Hashing Algorithm, 256 bits). That is the output will be of 256 bits. The block header should be hashed through the function SHA-256. The output hash should be less than or equal to the target hash as set by the protocol. What miners computing power has to do is generate as many nonces as possible, until the target hash is achieved. A lot of trial and error is required to generate the target hash.

Hash is a 64 digit hexadecimal number. A Hexadecimal number represents numbers using a base of 16. It uses sixteen symbols, "0-9" to represent values zero to nine, "a-f" to represent values ten to sixteen. Each hexadecimal digit represents four binary digits or bits. So, a hash has 256 bits(SHA-256).
To mine successfully you need to have a high "hash rate," which is measured in terms of megahashes per second (MH/s), gigahashes per second (GH/s), and terahashes per second (TH/s) and it depends on the processing power of your computer.

Once the valid hash is found, a new block is generated.(So, the hash is like a fingerprint of the block) it is broadcasted to the network, and other nodes will check if the hash is valid and add the new block to their copy of the blockchain. Then the miner node who found the valid hash is rewarded with bitcoins and this is known as Block reward. Block reward at present is 12.5 BTC(Initially it was 50 BTC), it tends to decrease every four years due to a process known as Bitcoin Halving.

Whichever miner generated the new block, all their transactions are valid, right? Their Coinbase transaction also becomes valid and thus they get new bitcoins.



Source:blockchain.com/explorer


From the above image, 
00000000000000000000bb7e982b7cb5b4901f71ac4d1edf11969439a04c3b3d - this is a hash of the most recent block(as of writing this article).
Its the hash of 625127th block in bitcoin's blockchain.
Difficulty being 14.7 trillion and 1353 transactions are validated in this block. Block reward of 12.5 BTC for generating the new block and 0.0834 BTC fee reward for verifying the transactions.

Every validated block contains a block hash that represents the work done by the miner, hence it is known as Proof-of-Work(POW)
In order to ensure that the network produces a new block at a steady average rate(10 minutes per each block), the software is set to automatically adjust the Difficulty. If the network has a high hash rate, the difficulty will go up and vice-versa. When Nakamoto mined the genesis block(the first block), bitcoin's difficulty was 1, now it is 14 trillion.

Mining Pools
Miners with low hash power join a mining pool where they contribute their processing power towards the pool. Bitcoins generated in the mining pool will be shared proportionately according to the processing power contributed by the miners. Mining pools are maintained by private entities.

81% of the bitcoin network hash rate is controlled by China. Some of the top bitcoin mining pools are given below

1)Poolin
Mines about 18% of all blocks
2)F2 Pool
Mines about 17% of all blocks
3)BTC.com
Mines about 15%
4)Antpool
- About 11%
5)ViaBtc
- and about 9%

As you dig more into bitcoin you will find fascinating things as it is built with math and code. And understand that it is going to be revolutionary in the finance segment.

Post a Comment

Previous Post Next Post