After reading that Mining involves Taking a root hash of a transaction and combining that hash with a nonce it is required to find a number that is equal or below the given target, i was wondering if you have to try different orders of hashing the transactions or you just hash them all at once. For example does it make a difference if i hash a transaction A first and then transaction B or B first and then A.


Yes, the order matters. Changing the order of bytes of data being hashed will result in a different hash. Thus changing the order of transactions for the merkle root will also result in a different merkle root. There is no requirement that miners try different orders of transactions. But they may choose to do that instead of re-selecting transactions for the block. Note that transaction order does matter (coinbase must come first, parents must come before children, etc.) so a miner cannot try all possible permutations of transactions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.