<p>That's valid (and <a href="https://blockexplorer.com/block/00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721" rel="noreferrer">has happened</a>) for coinbase transactions and transactions built off of coinbase transactions. Other than those strange cases, putting the same transaction in the chain twice isn't allowed.</p>

<p>Coinbase duplicates are only allowed due to an oversight. It will be corrected soon.</p>

CC BY-SA 3.0
2012-02-28T22:17:50.623Z
"Other than those strange cases ... isn't allowed" -> It is allowed, just incredibly hard to do (preimage attack on SHA256).
Pieter Wuille
CC BY-SA 3.0
2012-02-28T19:58:15.287Z
2012-02-28T21:31:03.180Z
2012-02-28T21:31:03.180Z
theymos
<p>Would a block containing a transaction with an identical hash as a previous transaction be considered valid? That is, if someone made a transaction for generating Bitcoins and solve two blocks with the same coinbase transaction, would the second block using that transaction valid?</p>

CC BY-SA 4.0
2018-08-01T06:48:55.310Z
Related: https://bitcoin.stackexchange.com/questions/26910/duplicated-hash-values-in-mining-reward
Nayuki
<transactions><hash><protocol><block-validity>
Two blocks, two transactions, same hash
ThePiachu
# Two blocks, two transactions, same hash

(Asked by: username_0 on 2012-02-28)

Would a block containing a transaction with an identical hash as a previous transaction be considered valid? That is, if someone made a transaction for generating Bitcoins and solve two blocks with the same coinbase transaction, would the second block using that transaction valid?

**Tags:** transactions, hash, protocol, block-validity

> **Comments:**
> **username_1**: Related: https://bitcoin.stackexchange.com/questions/26910/duplicated-hash-values-in-mining-reward  

---

## 1 answers

### Answer by username_2 on 2012-02-28. Score: 4

That's valid (and [has happened](https://blockexplorer.com/block/00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721)) for coinbase transactions and transactions built off of coinbase transactions. Other than those strange cases, putting the same transaction in the chain twice isn't allowed.

Coinbase duplicates are only allowed due to an oversight. It will be corrected soon.

> **Comments:**
> **username_3**: "Other than those strange cases ... isn't allowed" -> It is allowed, just incredibly hard to do (preimage attack on SHA256).  

---

