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