bitcoin core – How Are The TXIDs Determined from the raw hex data of a block? Also, what is the coinbase transaction?

Transaction ID (TXID) are determined by a double SHA256 hash of the transaction data, but represented in little-endian.

For example, the transaction data of the coinbase transaction is:


Hash it twice with SHA256.

SHA256(SHA256(tx_data)) = 82501c1178fa0b222c1f3d474ec726b832013f0a532b44bb620cce8624a5feb1

Reverse the bytes to little-endian:


Same goes for every transaction that’s included in the block.

Source link

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button