As I understand it, the building of a block goes something like this (please correct):
- Collect a bunch of new transactions.
- Hash all those transactions.
- Generate a coinbase transaction using the miner's (mining pool) public address.
- Generate the Merkle root for all the transactions using an arbitrary order.
- Fill in the block header.
- Dispatch to mining hardware which will try all 2^32 nonce combinations.
Now, when the mining hardware says that there is no solution after trying all nonce combinations, it appears that it has the following options for generating new options to check:
- Gather new transactions (or drop transactions), hash, and recalculate the Markle root.
- Update the script (extranonce) field in the coinbase transaction (or the target address), hash, recalculate the Merkle root.
- Update the timestamp in the header (what is the granularity on the timestamp).
- Update the difficulty in the header (is this possible)??
- Rearrange transaction order, and recalculate the Merkle root.
Are there any options I missed. What is the typical order that the mining pools do these things?