<blockquote>
<p>How do miners choose the transaction(s)?</p>
</blockquote>
<p>However they want. Usually by picking the ones with the highest fees, but also sometimes picking ones that have been unconfirmed for the longest, sometimes prioritizing their own transactions, etc.</p>
<blockquote>
<p>Does the difficulty vary depending on the number of chosen transactions?</p>
</blockquote>
<p>No.</p>
<blockquote>
<p>If not, wouldn't it be advisable to include as many transactions as possible when trying to find a new &quot;candidate&quot; block (maybe depending on the reward - just currency units or also (or only) transaction fees for the transactions included in the block)?</p>
</blockquote>
<p>Yes, this is the general idea.</p>
<blockquote>
<p>If the difficulty varies based on the number of selected transactions, however, wouldn't it be best to just choose one transaction and then &quot;quickly&quot; (i.e. as the first) come up with a valid candidate block to be added to the blockchain?</p>
</blockquote>
<p>The difficulty doesn't vary based on the number of selected transactions.</p>
<blockquote>
<p>If it makes sense to choose &quot;all open/unconfirmed&quot; transactions and then try to solve the hash puzzle (by, as I've read starting with a Nonce value of 0 and then sequentially increasing it),</p>
</blockquote>
<p>You can't include &quot;all unconfirmed transactions&quot; -- there's a size limit to the block. It's in the miner's best interest to include as many will fit in the block though, since the transactions come with transaction fees that are paid to the miner.</p>
<blockquote>
<p>wouldn't it simply boil down to the result that the miner with the largest processing power would always win?</p>
</blockquote>
<p>I don't understand what you mean by win, but miners who have the most processing power will mine the most blocks.</p>

CC BY-SA 4.0
2021-01-28T06:28:58.213Z
Thank you for the clarification. My last question was under the assumption that all miners would include the same transactions in when trying to solve the hash puzzle. This, also assuming everyone would start with the same Nonce value (0) would mean that the first solution found would be the same for everyone, just at different times (the more processing power, the quicker). But as it really is, even a miner with small processing power could be the first to find a new block - statistically, they more powerful miners would still find more blocks though.
Gorgsenegger
CC BY-SA 4.0
2021-01-28T06:33:23.757Z
All miners include different transactions. The first transaction is the one that pays the miner, and every miner probably wants their payout to go to their own address :) so everyone's working on their own unique version of the block. But yes, everyone, including smaller miners, technically can create the next block, it's just extremely statistically unlikely the smaller miners will be the one to do so.
ieatpizza
CC BY-SA 4.0
2021-01-26T11:30:20.817Z
2021-01-26T11:30:20.817Z
ieatpizza
<p>From my understanding, the <code>memory pool</code> (or <code>transaction pool</code>) contains &quot;open&quot; or &quot;unconfirmed&quot; transactions that have to be validated and can be chosen (arbitrarily?) to be part of a &quot;candidate block&quot;. For this block, the hash puzzle in a <code>proof of work</code> blockchain has to be solved before it can be added as a valid block to the blockchain.</p>
<ul>
<li><p>How do miners choose the transaction(s)?</p>
</li>
<li><p>Does the difficulty vary depending on the number of chosen transactions? If not, wouldn't it be advisable to include as many transactions as possible when trying to find a new &quot;candidate&quot; block (maybe depending on the reward - just currency units or also (or only) transaction fees for the transactions included in the block)?</p>
</li>
<li><p>If the difficulty varies based on the number of selected transactions, however, wouldn't it be best to just choose one transaction and then &quot;quickly&quot; (i.e. as the first) come up with a valid candidate block to be added to the blockchain?</p>
</li>
<li><p>If it makes sense to choose &quot;all open/unconfirmed&quot; transactions and then try to solve the hash puzzle (by, as I've read starting with a <code>Nonce</code> value of <code>0</code> and then sequentially increasing it), wouldn't it simply boil down to the result that the miner with the largest processing power would always win?</p>
</li>
</ul>

CC BY-SA 4.0
2024-12-11T16:06:21.327Z
similar: [How do miners select which transactions to include in a block?](https://bitcoin.stackexchange.com/questions/7311/how-do-miners-select-which-transactions-to-include-in-a-block). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
Pat Myron
<transactions><unconfirmed-transactions><mining-reward><mempool><transaction-selection>
How to choose the transactions for a block?
Gorgsenegger
# How to choose the transactions for a block?

(Asked by: username_0 on 2021-01-26)

From my understanding, the `memory pool` (or `transaction pool`) contains "open" or "unconfirmed" transactions that have to be validated and can be chosen (arbitrarily?) to be part of a "candidate block". For this block, the hash puzzle in a `proof of work` blockchain has to be solved before it can be added as a valid block to the blockchain.

* How do miners choose the transaction(s)?
* Does the difficulty vary depending on the number of chosen transactions? If not, wouldn't it be advisable to include as many transactions as possible when trying to find a new "candidate" block (maybe depending on the reward - just currency units or also (or only) transaction fees for the transactions included in the block)?
* If the difficulty varies based on the number of selected transactions, however, wouldn't it be best to just choose one transaction and then "quickly" (i.e. as the first) come up with a valid candidate block to be added to the blockchain?
* If it makes sense to choose "all open/unconfirmed" transactions and then try to solve the hash puzzle (by, as I've read starting with a `Nonce` value of `0` and then sequentially increasing it), wouldn't it simply boil down to the result that the miner with the largest processing power would always win?

**Tags:** transactions, unconfirmed-transactions, mining-reward, mempool, transaction-selection

> **Comments:**
> **username_1**: similar: [How do miners select which transactions to include in a block?](https://bitcoin.stackexchange.com/questions/7311/how-do-miners-select-which-transactions-to-include-in-a-block). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.  

---

## 1 answers

### Answer by username_2 on 2021-01-26. Score: 3 | Accepted answer

> How do miners choose the transaction(s)?

However they want. Usually by picking the ones with the highest fees, but also sometimes picking ones that have been unconfirmed for the longest, sometimes prioritizing their own transactions, etc.

> Does the difficulty vary depending on the number of chosen transactions?

No.

> If not, wouldn't it be advisable to include as many transactions as possible when trying to find a new "candidate" block (maybe depending on the reward - just currency units or also (or only) transaction fees for the transactions included in the block)?

Yes, this is the general idea.

> If the difficulty varies based on the number of selected transactions, however, wouldn't it be best to just choose one transaction and then "quickly" (i.e. as the first) come up with a valid candidate block to be added to the blockchain?

The difficulty doesn't vary based on the number of selected transactions.

> If it makes sense to choose "all open/unconfirmed" transactions and then try to solve the hash puzzle (by, as I've read starting with a Nonce value of 0 and then sequentially increasing it),

You can't include "all unconfirmed transactions" -- there's a size limit to the block. It's in the miner's best interest to include as many will fit in the block though, since the transactions come with transaction fees that are paid to the miner.

> wouldn't it simply boil down to the result that the miner with the largest processing power would always win?

I don't understand what you mean by win, but miners who have the most processing power will mine the most blocks.

> **Comments:**
> **username_0**: Thank you for the clarification. My last question was under the assumption that all miners would include the same transactions in when trying to solve the hash puzzle. This, also assuming everyone would start with the same Nonce value (0) would mean that the first solution found would be the same for everyone, just at different times (the more processing power, the quicker). But as it really is, even a miner with small processing power could be the first to find a new block - statistically, they more powerful miners would still find more blocks though.  
> **username_2**: All miners include different transactions. The first transaction is the one that pays the miner, and every miner probably wants their payout to go to their own address :) so everyone's working on their own unique version of the block. But yes, everyone, including smaller miners, technically can create the next block, it's just extremely statistically unlikely the smaller miners will be the one to do so.  

---

