Bitcoin Forum
November 02, 2024, 10:03:47 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do miners choose which transactions to include in their blocks  (Read 259 times)
T0asti (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 12


View Profile
May 29, 2022, 06:28:35 PM
Merited by o_e_l_e_o (4)
 #1

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
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
May 29, 2022, 06:38:37 PM
Merited by Wind_FURY (1)
 #2

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.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
May 29, 2022, 07:19:47 PM
Merited by NeuroticFish (4), pooya87 (2), ABCbits (1), jackg (1)
 #3

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.
BIT-BENDER
Hero Member
*****
Online Online

Activity: 1666
Merit: 706


Playbet.io - Crypto Casino and Sportsbook


View Profile
May 29, 2022, 08:12:51 PM
 #4

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

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
T0asti (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 12


View Profile
May 29, 2022, 09:00:25 PM
 #5

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.
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3161


Is the $100k BTC possible?


View Profile WWW
May 29, 2022, 10:58:54 PM
 #6

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).


█████████████████████████
████████▀▀████▀▀█▀▀██████
█████▀████▄▄▄▄████████
███▀███▄███████████████
██▀█████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██▄███████████████▀▀▄▄███
███▄███▀████████▀███▄████
█████▄████▀▀▀▀████▄██████
████████▄▄████▄▄█████████
█████████████████████████
 
 BitList 
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
REAL-TIME DATA TRACKING
CURATED BY THE COMMUNITY

.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
 
  List #kycfree Websites   
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
May 30, 2022, 08:49:08 AM
 #7

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
franky1
Legendary
*
Offline Offline

Activity: 4396
Merit: 4755



View Profile
May 30, 2022, 10:01:11 AM
 #8

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

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
Wind_FURY
Legendary
*
Offline Offline

Activity: 3094
Merit: 1929



View Profile
May 30, 2022, 10:32:55 AM
 #9

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".

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
bittraffic
Hero Member
*****
Offline Offline

Activity: 3066
Merit: 617


View Profile WWW
May 30, 2022, 10:41:35 AM
 #10


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.
Wind_FURY
Legendary
*
Offline Offline

Activity: 3094
Merit: 1929



View Profile
May 30, 2022, 11:31:01 AM
 #11


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.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
May 30, 2022, 01:06:18 PM
Merited by ABCbits (2)
 #12

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!