How does transaction order affect blocks mined by different nodes?

6 replies 133 views
Posts: 12 · Reputation: 18
#1Nov 26, 2024, 09:37 AM
If I get transactions from four people at once, will those go to different nodes? Like, won't the order change? So would mining nodes then put them in different blocks? I'm curious if it's common for Bitcoin to have blocks with mixed transaction orders from various nodes. Seems like the proof of work is the only thing that counts, right?
3 Reply Quote Share
CalmMinerFull Member
Posts: 554 · Reputation: 784
#2Nov 26, 2024, 12:56 PM
When a transaction is sent out, it hits multiple nodes and they build candidate blocks. They add transactions in whatever order they want, no strict rules other than parents before children. And it usually comes down to fees too, but not as a protocol rule. If one miner gets the nonce first with those four transactions, his block wins.
4 Reply Quote Share
chrisomegaFull Member
Posts: 158 · Reputation: 631
#3Nov 26, 2024, 01:42 PM
Not all transactions go into separate mempools. Once broadcasted, they spread through the network, so if you got four, most nodes likely get all four too. Miners usually pick transactions based on fees, so those four could be in the same block if fees align.
1 Reply Quote Share
ben2019Newbie
Posts: 21 · Reputation: 37
#4Nov 26, 2024, 08:02 PM
But the order can definitely vary in block space. Once a miner is mining, the order of transactions in that block matters to some extent. What exactly are you trying to compare?
0 Reply Quote Share
CalmMinerFull Member
Posts: 554 · Reputation: 784
#5Nov 27, 2024, 03:54 AM
Order usually doesn’t matter unless it's the coinbase transaction first or the dependent ones like, the parent must come before child transactions. Mining pools look at fees, highest to lowest. But like you said, that’s not a strict rule.
6 Reply Quote Share
im_cobraFull Member
Posts: 107 · Reputation: 274
#6Nov 27, 2024, 04:36 AM
You can see how transactions are arranged in a block on various block explorers. Primarily, it’s about the fee rate, that's what drives the order.
4 Reply Quote Share
chrisomegaFull Member
Posts: 158 · Reputation: 631
#7Nov 27, 2024, 10:43 AM
Also, miners gotta keep in mind how they place transactions. If there's a parent-child relationship, the parent transaction has to come first in the block. Otherwise, it won’t verify as intended.
2 Reply Quote Share

Related topics