I understand that when you double-sha256 some transaction data, it will give you the TXID for that transaction. This can then be used in future transaction data when you want to reference an existing transaction.

However, if you want to search for a TXID using bitcoin-cli or a blockexplorer, you have to convert this TXID to little-endian.

TXID (original):  B0570984EA35E417A20327D72414CDA0EB8200418772FA3E1A28D76EF4977CF2
TXID (searching): F27C97F46ED7281A3EFA7287410082EBA0CD1424D72703A217E435EA840957B0

What's the reason for this?

1 Answer 1


Because Bitcoin in general uses little-endian while most hashing libraries use big-endian.

For more details and links see here.

  • 1
    If bitcoin uses little-endian, why not use little-endian TXIDs in the transaction data? I don't understand the purpose of converting to little-endian for the user's side of things only.
    – inersha
    Apr 19, 2016 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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