<p>There are indeed many new transactions every second. The way miners deal with it is two-fold:</p>

<ol>
<li><p>If an appropriate proof-of-work is found on any merkle root, simply publish that block and any transactions that did not make it into the block go into the next block (assuming sufficient fees)</p></li>
<li><p>Otherwise, calculate a new merkle root every so often (varies per miner, but let's say for the sake of argument that it's 5 seconds) and try to calculate the proof-of-work with the transactions included.</p></li>
</ol>

<p>The reason why miners don't accept just 2 or 3 transactions is that it's just as much work to find the nonce for the proof-of-work whether there's 1 transaction or 1000 transactions. The probabilities remain the same. The nice thing about including more transactions as a miner is that you get more mining fees out of them.</p>

CC BY-SA 3.0
2015-11-28T19:44:21.237Z
anything you change about the block changes the has,  i.e. if you use a new timestam, add a transaction, change the order of transactions... there is no guarantee to find a block for any nonce.
Murch
CC BY-SA 3.0
2015-11-27T20:51:09.443Z
2015-11-27T20:51:09.443Z
Jimmy Song
<p>Looking at the fields in the <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow">block header</a>, the nonce field is a 32 bit integer.  This means that the nonce is an integer in the range from 0 to 4,294,967,295.  As you point out, a miner with just an off-the-shelf GPU can easily calculate this number of hashes in less than a second.  </p>

<p>In the early days of bitcoin, when the difficulty requirement was much lower than it is now, miners would scoop up a bunch of transactions, take the Merkle Root, use the current time as the timestamp, create the header, then iterate through the range of nonces - and they stood a decent chance of finding a nonce that (when combined with the rest of the info in the headers) produced a SHA256 hash that satisfied the difficulty requirement.  </p>

<p>But nowadays, with the difficulty requirement much higher, miners stand a very small chance of finding a nonce that (when combined with the rest of the info in the headers) produces a SHA256 hash that satisfies the difficulty requirement after iterating through the range of nonce values.  Therefore, they have to try again, by changing something else in the headers (e.g. the timestamp, or the transactions in the block), then iterate through the range of nonce values again in hopes of finding one that satisfies the difficulty requirement.  This process repeats many times, until finally a miner finds the winning combination of header information and nonce that produces a hash that satisfies the difficulty requirement - which should happen approximately every 10 minutes by design.</p>

CC BY-SA 3.0
2015-11-30T19:42:25.540Z
2015-11-30T19:42:25.540Z
mti2935
<p>I think that I understood most of the things about Bitcoin but there is still a mystery. </p>

<p>We can see on <a href="https://blockchain.info/" rel="nofollow">https://blockchain.info/</a> that there are up to 4/5 new transactions every seconds. 
My question are : 
Do miners recalculate the Merkle root 4 to 5 times per second ? 
What happens to transactions made exactly as the same time a block is released?</p>

<p>I have seen that miners can choose the transactions they want to accept, but if it was the case I would be a miner, then accept maybe 2 or 3 transactions, find the nonce and get the 25 bitcoins reward. Why is that not possible?</p>

<p>I thank you a lot for your answers and I hope you will be able to help me. Thank you.</p>

<mining-theory><merkle-tree><block-header><transaction-selection>
How often do miners recalculate the merkle root they're working on?
Second Bailout
# How often do miners recalculate the merkle root they're working on?

(Asked by: username_0 on 2015-11-27)

I think that I understood most of the things about Bitcoin but there is still a mystery.

We can see on <https://blockchain.info/> that there are up to 4/5 new transactions every seconds.
My question are :
Do miners recalculate the Merkle root 4 to 5 times per username_0 ?
What happens to transactions made exactly as the same time a block is released?

I have seen that miners can choose the transactions they want to accept, but if it was the case I would be a miner, then accept maybe 2 or 3 transactions, find the nonce and get the 25 bitcoins reward. Why is that not possible?

I thank you a lot for your answers and I hope you will be able to help me. Thank you.

**Tags:** mining-theory, merkle-tree, block-header, transaction-selection


---

## 2 answers

### Answer by username_1 on 2015-11-27. Score: 4

There are indeed many new transactions every username_0. The way miners deal with it is two-fold:

1. If an appropriate proof-of-work is found on any merkle root, simply publish that block and any transactions that did not make it into the block go into the next block (assuming sufficient fees)
2. Otherwise, calculate a new merkle root every so often (varies per miner, but let's say for the sake of argument that it's 5 seconds) and try to calculate the proof-of-work with the transactions included.

The reason why miners don't accept just 2 or 3 transactions is that it's just as much work to find the nonce for the proof-of-work whether there's 1 transaction or 1000 transactions. The probabilities remain the same. The nice thing about including more transactions as a miner is that you get more mining fees out of them.

> **Comments:**
> **username_2**: anything you change about the block changes the has,  i.e. if you use a new timestam, add a transaction, change the order of transactions... there is no guarantee to find a block for any nonce.  

---

### Answer by username_3 on 2015-11-30. Score: 1

Looking at the fields in the [block header](https://en.bitcoin.it/wiki/Block_hashing_algorithm), the nonce field is a 32 bit integer. This means that the nonce is an integer in the range from 0 to 4,294,967,295. As you point out, a miner with just an off-the-shelf GPU can easily calculate this number of hashes in less than a username_0.

In the early days of bitcoin, when the difficulty requirement was much lower than it is now, miners would scoop up a bunch of transactions, take the Merkle Root, use the current time as the timestamp, create the header, then iterate through the range of nonces - and they stood a decent chance of finding a nonce that (when combined with the rest of the info in the headers) produced a SHA256 hash that satisfied the difficulty requirement.

But nowadays, with the difficulty requirement much higher, miners stand a very small chance of finding a nonce that (when combined with the rest of the info in the headers) produces a SHA256 hash that satisfies the difficulty requirement after iterating through the range of nonce values. Therefore, they have to try again, by changing something else in the headers (e.g. the timestamp, or the transactions in the block), then iterate through the range of nonce values again in hopes of finding one that satisfies the difficulty requirement. This process repeats many times, until finally a miner finds the winning combination of header information and nonce that produces a hash that satisfies the difficulty requirement - which should happen approximately every 10 minutes by design.


---

