<p>They do not overlap. A transaction is always unique. a cryptographic hash algorithm is designed in such a way that they do not collide. This is one main requirement  of a hash function. </p>

<p>The inputs to create the transaction ID is partially based on the inputs which are being used to create the actual spend request in the chain, thus you will never have a collision between Bitcoin and Litecoin.</p>

CC BY-SA 3.0
2013-09-17T05:52:45.857Z
One issue however is that a single transaction can have multiple outputs so you might want to make your primary key a concatenation of the transaction id and output address. That way if you have someone build a single transaction that pays more than one of your addresses, it'll still work.
weex
CC BY-SA 3.0
2013-09-18T20:52:58.693Z
it sounds like you are saying that it is impossible for a collision to happen? is this the case, or is it merely extremely unlikely? thanks!
mulllhausen
CC BY-SA 3.0
2013-10-04T05:40:33.543Z
Collisions are extremely unlikely since the hashes for both are sha256. (10^77 possibilities)
weex
CC BY-SA 3.0
2013-09-16T14:41:47.767Z
2013-09-17T08:58:19.023Z
2013-09-17T08:58:19.023Z
MaxSan
<p>i will be storing litecoin and bitcoin transaction ids in the same table in my database, and i want to make the transaction id into a primary key. if litecoin and bitcoin transaction ids overlap then i can work around this by appending a BTC or LTC to each transaction id. can someone tell me if they do overlap?</p>

<transactions><litecoin>
difference between litecoin and bitcoin transaction id format
mulllhausen
# difference between litecoin and bitcoin transaction id format

(Asked by: username_0 on 2013-09-16)

i will be storing litecoin and bitcoin transaction ids in the same table in my database, and i want to make the transaction id into a primary key. if litecoin and bitcoin transaction ids overlap then i can work around this by appending a BTC or LTC to each transaction id. can someone tell me if they do overlap?

**Tags:** transactions, litecoin


---

## 1 answers

### Answer by username_1 on 2013-09-16. Score: 2

They do not overlap. A transaction is always unique. a cryptographic hash algorithm is designed in such a way that they do not collide. This is one main requirement of a hash function.

The inputs to create the transaction ID is partially based on the inputs which are being used to create the actual spend request in the chain, thus you will never have a collision between Bitcoin and Litecoin.

> **Comments:**
> **username_2**: One issue however is that a single transaction can have multiple outputs so you might want to make your primary key a concatenation of the transaction id and output address. That way if you have someone build a single transaction that pays more than one of your addresses, it'll still work.  
> **username_0**: it sounds like you are saying that it is impossible for a collision to happen? is this the case, or is it merely extremely unlikely? thanks!  
> **username_2**: Collisions are extremely unlikely since the hashes for both are sha256. (10^77 possibilities)  

---

