<p>In my opinion, it is one of the greatest misconceptions about Bitcoin that miners solve a "hard problem". Many news sources explain it like that, but in fact it's not true.</p>

<p>All a miner does is guessing until he got something right. A miners takes his block of transactions (including the coinbase transaction that sends the fees and block reward to himself) and calculates the hash of it. Hash calculation is a very common procedure and is not at all "hard". The hash he gets needs to match a certain condition. This condition gets harder as more miners try it (see <a href="https://en.bitcoin.it/wiki/Difficulty">Difficulty</a>). When the miner got a hash that fits the condition, he can publish it to all other Bitcoin clients and the block is added to the block chain.</p>

<p>The reason that miners with more computer power have a larger chance of winning the block is because they can simply guess faster. They can calculate more hashes per second to test against the condition, (Mining power is expressed in Hashes/second.)</p>

<p>The need for proof-of-work is there because the Bitcoin protocol wants that a block is found only once every 10 minutes approximately. So, as more miners enter the game, it has to become harder to do. The POW makes sure that finding a block is not easy and takes the some time. That's also the reason that the difficulty raises as more people mine. Every 2 weeks, the algorithms adjusts the difficulty so that again one block is found every 10 minutes at the average hashpower of the previous two weeks.</p>

<p>So, to answer your second question: If you could find an alternative method for achieving exactly the same thing as currently is done in Bitcoin mining, it could replace it. But Bitcoin is programmed as it is and won't probably ever change this method. But there are alt-coins that use different methods for distributing the coins and securing the block chain.</p>

CC BY-SA 3.0
2013-11-08T16:59:01.277Z
In fairness, I call mining math "hard" not because it's an objectively difficult problem but because it's unlikely you or I would have an easy time doing 2 rounds of sha256 with a pencil and paper.
David Perry
CC BY-SA 3.0
2013-11-08T19:50:52.583Z
It's often called a "hard mathematical puzzle" of which you have to find a solution. Which is not the case. But indeed, although every single computer sold today can perform a sha256, it's not something many people can do by hand :)
Steven Roose
CC BY-SA 3.0
2013-11-08T14:44:04.747Z
2013-11-08T14:44:04.747Z
Steven Roose
<p>In a nutshell, mining solves the problem of achieving a globally agreed ordering of transactions and selection of one of several incompatible transactions.</p>
<hr />
<p>Here's the problem that needs a solution:</p>
<p>If I have 10 Bitcoin and I simultaneously introduce to two distant parts of the network a transaction that gives 10 Bitcoin to Alice and a transaction that gives 10 Bitcoin to Bob.</p>
<p>Different nodes (wallets etc) will receive the two transactions in a different order, some get the Alice transaction first and reject the Bob transaction as a doublespend attempt. Others vice versa.</p>
<p>How does the whole world eventually agree which of Bob and Alice have the 10 Bitcoin?</p>
<hr />
<p>Mining provides a mechanism for periodically selecting a node that specifies an ordering (and hence chooses which transaction gets rejected). It also provides the basis for resolving conflicting views of transaction-order between parts of the network.</p>
<p>Mining provides an immutable and verifiable continuous record of this ordering.</p>

CC BY-SA 4.0
2021-04-16T16:37:09.903Z
2021-04-16T16:43:28.820Z
2021-04-16T16:43:28.820Z
RedGrittyBrick
<p>I think the concern was that a p2p node is easier to falsify than a solution that requires great effort. </p>

CC BY-SA 3.0
2013-11-09T19:23:47.723Z
2013-11-09T19:23:47.723Z
user7636
<p>With mining that takes time, synchronization gets easier. Forks happen in the blockchain and these forks need to be resolved, where the nodes select the chain that is longest. </p>

<p>It is very hard for distributed nodes to resolve and come to an agreement if new blocks are added to forked blockchains simultaneously at high speed in different parts of the network.</p>

<p>Another reason is if several miners work on similar blocks, it is unlikely that they will finish at the same time, since the random number that generates a small enough hash could come at any time, which most likely means very different times for different miners, so one wins clearly.</p>

<p>That is how I understand the need for mining.</p>

CC BY-SA 3.0
2013-11-10T01:45:58.197Z
2013-11-10T01:45:58.197Z
jeorgen
<p>Of course, the function of mining is to secure the blockchain, but I'm looking for a more abstract summary of what the exact problem is that mining tries to solve? I believe its called the <a href="http://pages.cs.wisc.edu/~sschang/OS-Qual/reliability/byzantine.htm" rel="nofollow">Byzantine Generals problem</a>, but can it be described in a couple of sentences?</p>

<p>The network needs to select one random stranger out of a large group at a fixed schedule, and uses a 'hashing-lottery' as a reasonably fair method to do so. Is that a good definition of the reason why POW is needed?</p>

<p>In other words: Suppose I developed an alternative method to select a random p2p node every few minutes, who gets to publish the next block, could that replace cpu-based proof of work?</p>

CC BY-SA 3.0
2013-11-09T13:22:38.647Z
@David The title may be duplicate, but the question is totally different. I know all about hash collisions and the technical background of mining, I just want to know what properties an alternative should have to be able to replace mining.
Maestro
CC BY-SA 3.0
2013-11-09T17:32:37.127Z
@David: the question is (obviously) totally different. And interesting!
Stéphane Gimenez
<protocol><mining-theory><proof-of-work><consensus><architecture>
What is the problem that mining solves?
Maestro
# What is the problem that mining solves?

(Asked by: username_0 on 2013-11-08)

Of course, the function of mining is to secure the blockchain, but I'm looking for a more abstract summary of what the exact problem is that mining tries to solve? I believe its called the [Byzantine Generals problem](http://pages.cs.wisc.edu/~sschang/OS-Qual/reliability/byzantine.htm), but can it be described in a couple of sentences?

The network needs to select one random stranger out of a large group at a fixed schedule, and uses a 'hashing-lottery' as a reasonably fair method to do so. Is that a good definition of the reason why POW is needed?

In other words: Suppose I developed an alternative method to select a random p2p node every few minutes, who gets to publish the next block, could that replace cpu-based proof of work?

**Tags:** protocol, mining-theory, proof-of-work, consensus, architecture

> **Comments:**
> **username_0**: @username_3 The title may be duplicate, but the question is totally different. I know all about hash collisions and the technical background of mining, I just want to know what properties an alternative should have to be able to replace mining.  
> **username_1**: @username_3: the question is (obviously) totally different. And interesting!  

---

## 4 answers

### Answer by username_2 on 2013-11-08. Score: 7

In my opinion, it is one of the greatest misconceptions about Bitcoin that miners solve a "hard problem". Many news sources explain it like that, but in fact it's not true.

All a miner does is guessing until he got something right. A miners takes his block of transactions (including the coinbase transaction that sends the fees and block reward to himself) and calculates the hash of it. Hash calculation is a very common procedure and is not at all "hard". The hash he gets needs to match a certain condition. This condition gets harder as more miners try it (see [Difficulty](https://en.bitcoin.it/wiki/Difficulty)). When the miner got a hash that fits the condition, he can publish it to all other Bitcoin clients and the block is added to the block chain.

The reason that miners with more computer power have a larger chance of winning the block is because they can simply guess faster. They can calculate more hashes per second to test against the condition, (Mining power is expressed in Hashes/second.)

The need for proof-of-work is there because the Bitcoin protocol wants that a block is found only once every 10 minutes approximately. So, as more miners enter the game, it has to become harder to do. The POW makes sure that finding a block is not easy and takes the some time. That's also the reason that the difficulty raises as more people mine. Every 2 weeks, the algorithms adjusts the difficulty so that again one block is found every 10 minutes at the average hashpower of the previous two weeks.

So, to answer your second question: If you could find an alternative method for achieving exactly the same thing as currently is done in Bitcoin mining, it could replace it. But Bitcoin is programmed as it is and won't probably ever change this method. But there are alt-coins that use different methods for distributing the coins and securing the block chain.

> **Comments:**
> **username_3**: In fairness, I call mining math "hard" not because it's an objectively difficult problem but because it's unlikely you or I would have an easy time doing 2 rounds of sha256 with a pencil and paper.  
> **username_2**: It's often called a "hard mathematical puzzle" of which you have to find a solution. Which is not the case. But indeed, although every single computer sold today can perform a sha256, it's not something many people can do by hand :)  

---

### Answer by username_4 on 2021-04-16. Score: 3

In a nutshell, mining solves the problem of achieving a globally agreed ordering of transactions and selection of one of several incompatible transactions.

---

Here's the problem that needs a solution:

If I have 10 Bitcoin and I simultaneously introduce to two distant parts of the network a transaction that gives 10 Bitcoin to Alice and a transaction that gives 10 Bitcoin to Bob.

Different nodes (wallets etc) will receive the two transactions in a different order, some get the Alice transaction first and reject the Bob transaction as a doublespend attempt. Others vice versa.

How does the whole world eventually agree which of Bob and Alice have the 10 Bitcoin?

---

Mining provides a mechanism for periodically selecting a node that specifies an ordering (and hence chooses which transaction gets rejected). It also provides the basis for resolving conflicting views of transaction-order between parts of the network.

Mining provides an immutable and verifiable continuous record of this ordering.


---

### Answer by username_5 on 2013-11-09. Score: 2

I think the concern was that a p2p node is easier to falsify than a solution that requires great effort.


---

### Answer by username_6 on 2013-11-10. Score: 2

With mining that takes time, synchronization gets easier. Forks happen in the blockchain and these forks need to be resolved, where the nodes select the chain that is longest.

It is very hard for distributed nodes to resolve and come to an agreement if new blocks are added to forked blockchains simultaneously at high speed in different parts of the network.

Another reason is if several miners work on similar blocks, it is unlikely that they will finish at the same time, since the random number that generates a small enough hash could come at any time, which most likely means very different times for different miners, so one wins clearly.

That is how I understand the need for mining.


---

