This article explains the basic terms and concepts of mining.
So, as we already know from my previous article, mining solves 2 main tasks:
A node in the Bitcoin network (node) is defined, which temporarily gets the right to write the next block to the blockchain. This achieves consensus in the peer-to-peer network.
Bitcoin coins are issued (additionally issued), which are rewarded (incentive) to the miner who writes the new block.
The first task is solved with the help of an algorithm called Proof-of-Work (PoW).
Let's start with it.
PoW (Proof-of-Work)
An algorithm by which the bitcoin mining network comes to consensus, determining which of the mining nodes will write the generated block to the blockchain.
The essence of PoW boils down to two main points:
The need to perform some fairly complex and time-consuming computational task. In the Bitcoin network, this is the selection of a hash code that meets specified criteria.
The ability to quickly and easily verify the result.
PoW is used in Bitcoin, Etherium and many other cryptocurrencies.
PoS (Proof-of-Stake), an alternative PoW algorithm for reaching consensus when writing a block to the blockchain, where the probability of writing a new block to the blockchain and receiving a corresponding reward is proportional to the user's ownership stake in the system:
An individual currency holder with a share P of the total number of coins in circulation creates a new block with probability P.
PoS is used in the DASH cryptocurrency protocol.
Bitcoins per Block or Block Reward (bitcoins per block) is a reward paid to a miner for successfully solving a cryptographic problem and attaching a block to the blockchain. For Bitcoin, this amount was originally 50 BTC, but every 210,000 blocks this amount is halved (about every 4 years). Read about it in the article "Plain and Simple: Why Bitcoin's Number is Limited". The basic question of all newbies in mining is "are crypto mining rigs easy to setup"?
Currently (July 2017) the reward is 12.5 BTC per block. The next halving to 6.25 BTC is expected in 2020.
Main mining parameters
Nonce is a numerical parameter sought in the course of mining (PoW algorithm) and written in the block header. Actually, the purpose of mining, as a competitive process for the right to add a block of transactions to the blockchain, is the selection of such Nonce that the sought-for block hash (Block Hash) is less than some specified Target number, which is equivalent to obtaining a block hash starting with a certain number of zero bits.
Difficulty Target, also called difficulty bits or bits - target difficulty - is the maximum number that must not be exceeded by the block hash (Block Hash) sought during mining. Actually it defines the number of zero bits at the beginning of the target hash. Often it is called Target.
Target is the number itself, while bits is a special format for writing Target to the block header. Two numbers are written in bits: the first byte is the exponent, and the remaining three bytes are the mantissa. To get the Target from the bits, use the following formula:
Target = mantissa * 2^(8 * (exponent - 3))