<p>The others already answer your question, but I'd just like to clarify one more point (since you said it was "most important"):</p>

<blockquote>
  <p>Also, and most importantly is how does a miner decides that enough transactions has been received and start finding the nonce as adding a new transaction to the attempting block <strong>will result in all the work done for this block as obsolete</strong>.</p>
</blockquote>

<p>The nonce-searching process is a memory-less process.</p>

<p>This means that if miners A and B have the same hashrate, and are working on the exact same block, and at time T A already tried 1000000000 nonces (with no success) and B already tried only 1 nonce (with no success), both have the same probability to find the next block. I.e., at time T, the fact A is "ahead" of B doesn't give B any advantage.</p>

<p>In this sense, every work a miner does which doesn't result with a block is already "obsolete".</p>

<p>With that in mind, if a miner wants to add txs to her block, she only needs to repeat once steps 1-3 from @ktorn's answer.  It might waste some searching time (thus decreasing the probability to be the first to find the block), but it also increases the potential reward (more fees).  This means there's a tradeoff, and a miner will do it only if she thinks it is profittable (e.g. there's a new tx with high enough fees).</p>

CC BY-SA 3.0
2016-10-02T05:42:57.397Z
2016-10-02T05:42:57.397Z
shx2
<p>Nothing prevents miners from not including transactions in their blocks. However, miners are trying to make money and 0.0005 * 54 = 0.027 BTC, which isn't a trivial amount in this market.</p>

<p>See <a href="https://en.bitcoin.it/wiki/Transaction_fees" rel="nofollow">https://en.bitcoin.it/wiki/Transaction_fees</a> for more info.</p>

CC BY-SA 3.0
2013-12-02T15:56:45.393Z
2013-12-02T15:56:45.393Z
Bitlab.co
<p>Nothing is stopping miners from not including transactions in their blocks, in fact it has <a href="https://bitcoin.stackexchange.com/questions/3332/what-can-be-done-about-the-no-transaction-block-relayer-currently-71-123-170-15">happened before</a>.</p>

<blockquote>
  <p>hashing smaller data will result in greater hashes/s (yes?)</p>
</blockquote>

<p>No, the hashes are always the same size, and adding transactions to the block does not make any difference to the difficulty in finding the nounce that validates the block (the speed of hashing remains the same, and the probablity of finding the bock also remains unchanged), hence it makes financial sense for miners to add as many as they can since they earn more transaction fees.</p>

<p>Edit: for more details on the mining process, this <a href="https://bitcointalk.org/index.php?topic=339505.msg3659809#msg3659809" rel="nofollow noreferrer">thread</a> provides a good summary:</p>

<blockquote>
  <p><strong>Simplified mining process</strong><br/> 1) Miners select tx from the memory
  pool for inclusion in a new block (the number, method, and criteria is
  up to the miner)<br/> 2) Miners construct a merkle tree from the tx in
  step #1<br/> 3) Miners create a block header with the merkle tree,
  prior block hash, version, timestamp, and nonce<br/> 4) Miner will
  hash the blockheader.  If it is a solution go to step 5.<br/> 4a)
  Miner will increment nonce and go to step 4.  If nonce range is
  exhausted go to step 4b<br/> 4b) Miner will modify another element in
  blockheader, reset nonce range back to 0 and go to step 4<br/> 5)
  Miner has found a block.  They broadcast it to peers.<br/> <br/> So
  once a miner finds a block they are done.  All the work for deciding
  tx comes BEFORE solving a block.</p>
</blockquote>

<p>So the number and size of transactions has no real impact on the <em>repetitive</em> step #4.</p>

<p>Having said that, it has been claimed that some miners do choose smaller blocks in order to minimise network propagation delays, and hence reduce the chance of their block becoming an orphan. </p>

CC BY-SA 3.0
2013-12-02T16:57:25.190Z
The probability of finding the hash remains unchanged but the speed? How is the time hashing 1kb = hashing 150kb. As of adding transactions wouldn't affect difficulty, could you elaborate why? is the nonce being tested picked randomly (or  pseudo-randomly) or is sequential?
mshohayeb
CC BY-SA 3.0
2013-12-03T02:16:21.613Z
@Moshohayeb I have edited my answer to better explain why the size of the block does not affect the hashing speed, as there is a preliminary step involved in creating a block header out of them. The hashing process only uses this header.
Having said that, block size will affect its network propagation speed.
ktorn
CC BY-SA 3.0
2013-12-03T06:55:27.860Z
Thank you very much, also found this in the wiki `The body of the block contains the transactions. These are hashed only indirectly through the Merkle root. Because transactions aren't hashed directly, hashing a block with 1 transaction takes exactly the same amount of effort as hashing a block with 10,000 transactions.`
mshohayeb
CC BY-SA 3.0
2016-02-22T23:05:24.480Z
@ktorn thank you for this, answered my question directly. Does this mean that miners/pools have some sort of personal policy as to how many transactions to include, to weigh the risk of delays in producing the merkle tree?
streetlight
CC BY-SA 3.0
2013-12-02T16:01:40.250Z
2016-07-12T12:55:24.640Z
2017-04-13T12:47:36.707Z
ktorn
<p>I am just starting to understand the internals of bitcoin. I am a CS graduate and familiar with most bitcoin terminologies. I've read Satoshi's paper and researched the question but I couldn't find the answer. </p>

<p>Now that it is much more profitable to mine blocks for the reward (25coins) than the transactions fees. my question is what prevents miners from only including 1 (or 0 if its allowed) transactions in their generated blocks as hashing smaller data will result in greater hashes/s (yes?)</p>

<p>Also, and most importantly is how does a miner decides that enough transactions has been received and start finding the nonce as adding a new transaction to the attempting block will result in all the work done for this block as obsolete.</p>

<p>I'll try to give my guess so correct me if I am wrong. While the miner tries to find the new block it buffers any received new transactions. If he/she finds the new block or a a new valid block is received they start working on the next block by putting all the buffered transactions into a new block and get to work. </p>

<p>Please excuse me if my questions seems primitive. I tried my best to research and any links are greatly appreciated. 
Thanks. </p>

CC BY-SA 3.0
2013-12-02T16:14:58.907Z
Also see this question: http://bitcoin.stackexchange.com/questions/16606/do-transactions-affect-the-discovery-of-a-block/16622#16622
Jannes
<transactions><blockchain><block>
Number of transactions per block
mshohayeb
# Number of transactions per block

(Asked by: username_0 on 2013-12-02)

I am just starting to understand the internals of bitcoin. I am a CS graduate and familiar with most bitcoin terminologies. I've read Satoshi's paper and researched the question but I couldn't find the answer.

Now that it is much more profitable to mine blocks for the reward (25coins) than the transactions fees. my question is what prevents miners from only including 1 (or 0 if its allowed) transactions in their generated blocks as hashing smaller data will result in greater hashes/s (yes?)

Also, and most importantly is how does a miner decides that enough transactions has been received and start finding the nonce as adding a new transaction to the attempting block will result in all the work done for this block as obsolete.

I'll try to give my guess so correct me if I am wrong. While the miner tries to find the new block it buffers any received new transactions. If he/she finds the new block or a a new valid block is received they start working on the next block by putting all the buffered transactions into a new block and get to work.

Please excuse me if my questions seems primitive. I tried my best to research and any links are greatly appreciated.
Thanks.

**Tags:** transactions, blockchain, block

> **Comments:**
> **username_1**: Also see this question: http://bitcoin.stackexchange.com/questions/16606/do-transactions-affect-the-discovery-of-a-block/16622#16622  

---

## 3 answers

### Answer by username_4 on 2013-12-02. Score: 8 | Accepted answer

Nothing is stopping miners from not including transactions in their blocks, in fact it has [happened before](https://bitcoin.stackexchange.com/questions/3332/what-can-be-done-about-the-no-transaction-block-relayer-currently-71-123-170-15).

> hashing smaller data will result in greater hashes/s (yes?)

No, the hashes are always the same size, and adding transactions to the block does not make any difference to the difficulty in finding the nounce that validates the block (the speed of hashing remains the same, and the probablity of finding the bock also remains unchanged), hence it makes financial sense for miners to add as many as they can since they earn more transaction fees.

Edit: for more details on the mining process, this [thread](https://bitcointalk.org/index.php?topic=339505.msg3659809#msg3659809) provides a good summary:

> **Simplified mining process**  
>  1) Miners select tx from the memory
> pool for inclusion in a new block (the number, method, and criteria is
> up to the miner)  
>  2) Miners construct a merkle tree from the tx in
> step #1  
>  3) Miners create a block header with the merkle tree,
> prior block hash, version, timestamp, and nonce  
>  4) Miner will
> hash the blockheader. If it is a solution go to step 5.  
>  4a)
> Miner will increment nonce and go to step 4. If nonce range is
> exhausted go to step 4b  
>  4b) Miner will modify another element in
> blockheader, reset nonce range back to 0 and go to step 4  
>  5)
> Miner has found a block. They broadcast it to peers.  
>    
>  So
> once a miner finds a block they are done. All the work for deciding
> tx comes BEFORE solving a block.

So the number and size of transactions has no real impact on the *repetitive* step #4.

Having said that, it has been claimed that some miners do choose smaller blocks in order to minimise network propagation delays, and hence reduce the chance of their block becoming an orphan.

> **Comments:**
> **username_0**: The probability of finding the hash remains unchanged but the speed? How is the time hashing 1kb = hashing 150kb. As of adding transactions wouldn't affect difficulty, could you elaborate why? is the nonce being tested picked randomly (or  pseudo-randomly) or is sequential?  
> **username_4**: @Moshohayeb I have edited my answer to better explain why the size of the block does not affect the hashing speed, as there is a preliminary step involved in creating a block header out of them. The hashing process only uses this header. Having said that, block size will affect its network propagation speed.  
> **username_0**: Thank you very much, also found this in the wiki `The body of the block contains the transactions. These are hashed only indirectly through the Merkle root. Because transactions aren't hashed directly, hashing a block with 1 transaction takes exactly the same amount of effort as hashing a block with 10,000 transactions.`  
> **username_5**: @username_4 thank you for this, answered my question directly. Does this mean that miners/pools have some sort of personal policy as to how many transactions to include, to weigh the risk of delays in producing the merkle tree?  

---

### Answer by username_2 on 2016-10-02. Score: 1

The others already answer your question, but I'd just like to clarify one more point (since you said it was "most important"):

> Also, and most importantly is how does a miner decides that enough transactions has been received and start finding the nonce as adding a new transaction to the attempting block **will result in all the work done for this block as obsolete**.

The nonce-searching process is a memory-less process.

This means that if miners A and B have the same hashrate, and are working on the exact same block, and at time T A already tried 1000000000 nonces (with no success) and B already tried only 1 nonce (with no success), both have the same probability to find the next block. I.e., at time T, the fact A is "ahead" of B doesn't give B any advantage.

In this sense, every work a miner does which doesn't result with a block is already "obsolete".

With that in mind, if a miner wants to add txs to her block, she only needs to repeat once steps 1-3 from @username_4's answer. It might waste some searching time (thus decreasing the probability to be the first to find the block), but it also increases the potential reward (more fees). This means there's a tradeoff, and a miner will do it only if she thinks it is profittable (e.g. there's a new tx with high enough fees).


---

### Answer by username_3 on 2013-12-02. Score: 0

Nothing prevents miners from not including transactions in their blocks. However, miners are trying to make money and 0.0005 \* 54 = 0.027 BTC, which isn't a trivial amount in this market.

See <https://en.bitcoin.it/wiki/Transaction_fees> for more info.


---

