Author

Topic: How do miners choose which transactions to include in their blocks (Read 262 times)

legendary
Activity: 2268
Merit: 18748
Are there any pool which use Stratum V2 today and implement "Job Negotiation Protocol" which is optional?
There is certainly ASIC firmware which implements it: https://braiins.com/os/plus
And SlushPool supports miners using Stratum V2, and provide set up guides: https://help.slushpool.com/en/support/solutions/articles/77000423566-stratum-v2-mining-urls-and-guide

I have no idea how many miners are using it, but the fact remains that we can't say that pools are definitely choosing what is in their blocks anymore. The precursor to Stratum V2 - BetterHash - also allowed miners to choose transactions for their candidate blocks, and was implemented by Blockstream pool at the time.

I suspect as time goes on such a feature will become more commonplace.
legendary
Activity: 2898
Merit: 1823

If the miners ever can decide which transaction to include or not then its not decentralized anymore. Whichever that comes in the mempool will be updated and eventually all shall be included in a block. If its designed to stop a transaction to go through, an imposed regulation will make it hard for users if the coins are tagged.


That's why it's the incentive structure that keeps everything stick together and actually work. If there was a miner who decides that only the transactions that he/she only likes should be included in the next block regardless of profit/incentive, then there's another miner who would be more willing to include those transactions as an opportunity to earn more. Given enough time, the miner who excludes transactions would earn less and less, and its competitors earn more and more, and grow bigger in hashing power, making the miner who excludes less and less competitive until it's unprofitable to mine.
hero member
Activity: 3038
Merit: 617

If the miners ever can decide which transaction to include or not then its not decentralized anymore. Whichever that comes in the mempool will be updated and eventually all shall be included in a block. If its designed to stop a transaction to go through, an imposed regulation will make it hard for users if the coins are tagged.
legendary
Activity: 2898
Merit: 1823
The "nonce" is the random number stored in the coinbase transaction to change the block hash. If you mean the block hash (the thing that's targeted to be below a certain number) then that'll change: when a new transaction is added; when a transaction is removed; or when transactions are moved inside the block.

The mining software takes transactions from the mempool of the node running and organises them (they normally prioritise higher fees but could also prioritise their own transactions too ahead of that). Transactions are immediately minable once they're sent to the node and some mining software may shuffle round transactions anyway for finding the solution for the next block.


OP, newbies, fellow plebs. The bolded statement in that post is a very important point. It's the incentive structure that makes the whole Bitcoin network/system stick together. I don't know if it was the same to many of you, but it took me some months after buying Bitcoin that I truly understood that for "decentralization" to "work", it's all about having incentives to keep everyone "honest".
legendary
Activity: 4410
Merit: 4788
And about your title, all miners who mine BTC on any pool miners can't able to decide which transaction they can able to include on the block they mine.

Only Pool Operators have the ability to choose a transaction they want to include in the Block.
Not necessarily. That is certainly the case with older mining protocols, but the newer Stratum V2 allows individual miners to have some say over which transactions they include in their candidate blocks, among a number of other benefits.

You can read more about it here: https://braiins.com/stratum-v2

we are not in the days of solo mining..

POOLS collate the transactions.. ASICS(miners) just get handed the block header of a block candidate(template) which the asics hash into a new hash that has to meet certain standards

asics do not have hard drives or ram to store unconfirms in a mempool to collate transactions

stratum is 'pool' software.. your link literally says it in the first line:
"The next generation protocol for pooled mining"

most asics these days do not connect to their owners PC and then to a pool. instead the asic just connects straight to a pool thus the human owner of an asic does not control its asics block template, the pool software does
legendary
Activity: 2268
Merit: 18748
And about your title, all miners who mine BTC on any pool miners can't able to decide which transaction they can able to include on the block they mine.

Only Pool Operators have the ability to choose a transaction they want to include in the Block.
Not necessarily. That is certainly the case with older mining protocols, but the newer Stratum V2 allows individual miners to have some say over which transactions they include in their candidate blocks, among a number of other benefits.

You can read more about it here: https://braiins.com/stratum-v2
legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
And about your title, all miners who mine BTC on any pool miners can't able to decide which transaction they can able to include on the block they mine.

Only Pool Operators have the ability to choose a transaction they want to include in the Block.

That's why they are some pools that offer services like speed up the transaction because they can include the stuck transaction under their block(ViaBTC as sample).

newbie
Activity: 7
Merit: 12
1. While a miner hashes, will the nonce be reset on every new transaction added to the block?
The block the miner is attempting to solve is known as the candidate block. If the miner adds new transactions or replaces some transaction in their candidate block, then the Merkle root they calculate will be different and so their block header (the thing they are hashing) will be different. At that point, miners would reset the nonce field to zero.

Also note that the nonce field, being only 4 bytes, can be exhausted in under a second. The miner will then change something else about the block, usually incrementing the extraNonce field in the coinbase transaction, and reset the nonce. This happens constantly while the miner is trying to solve their block.

2. And if blocks are not full, are new transactions added instantly or is there some sort of "waiting time"?
It doesn't make sense for a miner to update their candidate block every single time they learn of a new transaction, as the pool would need to recompute their Merkle tree every time it does and then send the new block data to all their miners, which has an associated cost to it. How often a pool updates their candidate block is up to the pool, but I imagine most pools would be somewhere in the 5-30 second range.

The "nonce" is the random number stored in the coinbase transaction to change the block hash.
This is the extraNonce. The nonce is part of the block header.

Thanks a lot for the answer, exactly what I was looking for.
hero member
Activity: 1666
Merit: 709
Playbet.io - Crypto Casino and Sportsbook
I would advice you that mining is not what it use to be, it has gotten even more difficult than ever, right now there need to be more power for miners to complete a block the competition has gotten more stiffer than ever but if you have what it takes to be a miner I suggest you do your personal research on the particular topic to prevent lost knowledge. Mining has gotten more complicated but with adequate knowledge it can be navigated
legendary
Activity: 2268
Merit: 18748
1. While a miner hashes, will the nonce be reset on every new transaction added to the block?
The block the miner is attempting to solve is known as the candidate block. If the miner adds new transactions or replaces some transaction in their candidate block, then the Merkle root they calculate will be different and so their block header (the thing they are hashing) will be different. At that point, miners would reset the nonce field to zero.

Also note that the nonce field, being only 4 bytes, can be exhausted in under a second. The miner will then change something else about the block, usually incrementing the extraNonce field in the coinbase transaction, and reset the nonce. This happens constantly while the miner is trying to solve their block.

2. And if blocks are not full, are new transactions added instantly or is there some sort of "waiting time"?
It doesn't make sense for a miner to update their candidate block every single time they learn of a new transaction, as the pool would need to recompute their Merkle tree every time it does and then send the new block data to all their miners, which has an associated cost to it. How often a pool updates their candidate block is up to the pool, but I imagine most pools would be somewhere in the 5-30 second range.

The "nonce" is the random number stored in the coinbase transaction to change the block hash.
This is the extraNonce. The nonce is part of the block header.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
The "nonce" is the random number stored in the coinbase transaction to change the block hash. If you mean the block hash (the thing that's targeted to be below a certain number) then that'll change: when a new transaction is added; when a transaction is removed; or when transactions are moved inside the block.

The mining software takes transactions from the mempool of the node running and organises them (they normally prioritise higher fees but could also prioritise their own transactions too ahead of that). Transactions are immediately minable once they're sent to the node and some mining software may shuffle round transactions anyway for finding the solution for the next block.
newbie
Activity: 7
Merit: 12
Greetings,

I got a few questions regarding the way how miners choose transactions.

1. While a miner hashes, will the nonce be reset on every new transaction added to the block?
2. And if blocks are not full, are new transactions added instantly or is there some sort of "waiting time"?

Best regards
Jump to: