<p>Because Bitcoin in general uses little-endian while most hashing libraries use big-endian.</p>

<p>For more details and links see <a href="https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation">here</a>.</p>

CC BY-SA 3.0
2016-04-19T09:23:04.030Z
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
CC BY-SA 3.0
2016-04-16T09:20:18.770Z
2016-04-16T09:20:18.770Z
2017-04-13T12:47:34.187Z
karask
<p>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.</p>

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

<pre><code>TXID (original):  B0570984EA35E417A20327D72414CDA0EB8200418772FA3E1A28D76EF4977CF2
TXID (searching): F27C97F46ED7281A3EFA7287410082EBA0CD1424D72703A217E435EA840957B0
</code></pre>

<p>What's the reason for this?</p>

<transaction-id><bitcoin-cli>
Why do you have to search for TXIDs in little-endian?
inersha
# Why do you have to search for TXIDs in little-endian?

(Asked by: username_0 on 2016-04-15)

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?

**Tags:** transaction-id, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2016-04-16. Score: 1

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

For more details and links see [here](https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation).

> **Comments:**
> **username_0**: 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.  

---

