What is bitcoin mining?

Calvin Cheng
2 min readOct 22, 2017

--

https://cdn0.tnwcdn.com/wp-content/blogs.dir/1/files/2014/02/bitcoin-mining-730x430.jpg

Yesterday, I mentioned the solution to the double-spending problem is to assign a node as the judge, aka miner, to collect transactions within past 10 minutes. You may argue why don’t we just let nodes vote for their preferred version of transaction records instead of finding someone to collect transactions? It is a good idea as it looks so democratic. However, how do we prevent someone from voting repeatedly? Who can be the vote counter? If there is one, how can we ensure the vote counter doesn’t alter the voting number? Since there is no convincing solution to these questions, a mining process is introduced in the bitcoin system.

Mining is a process that a miner collects transactions within the past 10 minutes and construct a block by solving a mathematical equation. A block is a dataset including the 10-minute collection of transactions, timestamp and the answer to the mathematical equation. The equation is somewhat like 3x^2+2x-3 < 0.03 and the miner needs to solve x. The actual equation is much more difficult such that the miner can only guess the answer. How difficult is it? Currently, you need 700 billion of computers to guarantee you can solve the equation every 10 minutes. That means you can hardly solve the equation even you own all computers on earth. Most miners use specialized hardware to perform mining which is much more efficient than using desktop computers.

Since the miner consumes electricity to run the hardware to solve the equation, the miner can get newly created bitcoin as a compensation. That’s why miners are called miners as the process of constructing a block also creates an extra amount of currency in the bitcoin system. Basically, miners mine digital gold. After they solve the equation, the block including the answer to that mathematical equation is broadcasted to all nodes in the bitcoin network. Now every node can store a unanimous version of transaction records.

I know you still have an unaddressed question. Why do miners need to calculate a very difficult mathematical equation? Firstly, since every node can be the miner if they solve the equation, there will be many blocks spreading around at the same time when the equation is not difficult enough. Then, it cannot solve our original problem, i.e. different nodes storing different versions of records result in a split in the bitcoin network. Secondly, it can increase the barrier to be a miner which can reduce the number of malicious people to make use of the role as miners to attack the bitcoin network.

In short, mining is a consensus mechanism which determines transactions to be included within past 10 minutes and create new bitcoin by solving a very difficult equation.

--

--

Calvin Cheng
Calvin Cheng

Written by Calvin Cheng

Blockchain Engineer • DevOps • Certified Hyperledger Fabric Administrator (CHFA) • Full Stack

Responses (1)