However the merkle root should be completely different to every miner/node resulting from transaction order and the era transaction,
Right.
so how do different nodes come to consensus if their transactions are completely different.
They do not. Each miner is absolutely answerable for the selection of their very own transactions. There isn’t a want for various miners to agree on the transaction choice. The successful miner decides the contents of the successful block, and others associate with it, accepting their transaction choice (until the included transactions are objectively invalid, which makes the block invalid – to miners and different nodes).
I think about they might use the nonce supplied by the block creator to hash their very own copy of the block and see if it in inside the goal.
There are various block validity guidelines which might be carried out by all nodes, together with the verification of proof-of-work, such as you say. Different guidelines embody verifying that each one transactions are legitimate, that no theft occurred, that no double spending occurred, that no cash is printed by the block (past the permitted subsidy), …
Wouldnt the tree must be hashed once more
Sure.
There are a variety of layers concerned to updating a miner’s candidate block. Every is way sooner than the earlier one, however accomplished way more usually:
-
Sometimes the mining software program will often (say, each few seconds) construct a brand new block template to work on, which incorporates transaction choice.
-
An intermediate layer adjustments the coinbase transaction (which incorporates payout deal with, in addition to an “additional nonce”) occasionally. Each time this occurs the Merkle root adjustments. Nonetheless, by caching the interior nodes of the Merkle tree which might be excellent of the leftmost department within the tree, that is simply O(log(n)) work within the variety of transactions (e.g. a block with 2048 transactions solely wants 11 hashing steps to recompute the Merkle root).
-
The bottom-level {hardware} layer cycles via the 232 nonces within the block header, all with the identical Merkle root. That is extraordinarily environment friendly.
and the PoW must begin from the start.
Sure, however that is irrelevant. PoW does not have “progress”. You do not lose something by beginning over, so long as you are still attempting hashes on a regular basis. Each candidate block you attempt (mixture of tx choice, coinbase tx, nonce) has an impartial probability of assembly the PoW goal (an opportunity equal to 2256 / goal). If that probability is 1/c, and also you carry out h hashes per day, you can find h/c blocks per day – no matter which transactions these makes an attempt are for.