Post
Topic
Board Development & Technical Discussion
Topic OP
Why do we reverse the byte order transaction hashes and block hashes?
by
tobasco
on 13/11/2019, 14:44:59 UTC
Why do we reverse the byte order hashes when searching for transactions and blocks from bitcoin-cli and blockchain explorers?

When you hash transaction data or a block header, you get a hash digest. This hash digest is used internally in bitcoin for referring to previous TXIDs in serialized transaction data, and for previous block hashes in block headers.

However, when we come to search for a specific transaction or block from the command line, the byte order is reversed. Why is this? Wouldn't it be much easier to use the same byte order as the one that comes out of the hash function and is used internally in bitcoin?