Duplicate tx ids

4

Is there a quick and dirty way to detect all transactions whose tx-id can be found in more than one transaction since the genesis block?

I would also like to see mutated transactions as well although I am not sure if the blockchain keeps a historical track of the mutated transactions.

Doug Peters

Posted 2014-12-26T18:21:07.763

Reputation: 1 326

Are you asking for duplicate transactions, that is 2 transactions with the same id? If so there aren't any.ike 2014-12-26T18:39:48.527

@ike how did you come up to this conclusion? Tx-ids are not supposed to be unique https://bitcointalk.org/index.php?topic=28387.0

Doug Peters 2014-12-26T18:47:50.437

They are sha-256 hashes, and it would take more computing power than exists in the world to create one deliberately. You want to look for an improbable scenario to make sure it didn't happen? I'm sure there are people who've searched and found none; if there was, we'd hear about it.ike 2014-12-26T18:49:54.040

In the same way that I didn't just generate your private key on my computer.ike 2014-12-26T18:50:15.737

@ike I understand that the propabilty for this to happen is close to zero but not zero and that the 55 million txs that took place since genesis in total is not even close to what it would normally take to brute-force the sha256 algo, all I am asking is if there is a handy way to query the bitcoin network for such scenarios.Doug Peters 2014-12-26T19:03:10.037

Ok, the way to do it would be to have a copy of the blockchain, list all txids, and scan for dups. I'll lookup the commands and put that as an answer.ike 2014-12-26T19:04:43.797

It looks complicated, I'd have to write a couple of scripts. This may help you if you know a little bash, though. https://bitcoin.stackexchange.com/questions/4601/how-can-i-read-information-from-the-blockchain

ike 2014-12-26T19:19:40.457

Answers

5

Is there a quick and dirty way to detect all transactions whose tx-id can be found in more than one transaction since the genesis block?

There are multiple ways to read your question.

Are there cases where the same transaction has been included into the blockchain multiple times?

Yes. There is one recorded instance of the same coinbase appearing twice. The problem this causes is that only one of these can be redeemed. It also makes it possible to reduce a fully-confirmed transaction to one confirmation, though I don't understand the details. BIP34 fixed this.

Are there cases where the same input hash appears in multiple transactions?

Yes. It happens all the time. For example, transaction 9fa3... has two outputs. Those two outputs were spent by two different transactions. Each transaction needed to include the same input hash (though the vout field was different.)

Are there are any known collisions in SHA256?

No.

I would also like to see mutated transactions as well although I am not sure if the blockchain keeps a historical track of the mutated transactions.

It doesn't.

Nick ODell

Posted 2014-12-26T18:21:07.763

Reputation: 26 536

Thanks, Nick. "There are multiple ways to read your question." What I need is a fast way to query the blockchain: SELECT TxId, COUNT(*) c FROM blockchain GROUP BY TxId HAVING c > 1;Doug Peters 2014-12-26T22:28:03.207

@DougPeters Is that different from the first interpretation of your question?Nick ODell 2014-12-26T22:31:23.680

Not really, I was just wondering if you are aware of a neat way to achieve this without having to look it up on blockchain.info or any other third-party service.Doug Peters 2014-12-26T23:52:20.830

0

The coinbase transactions e3bf3d07d4b0375638d5f1db5255fe07ba2c4cb067cd81b84ee974b6585fb468 and d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599 both exist in two blocks.

This problem was solved in BIP30 so this cannot happen again.

BIP30 also dictates that it is the newest version of these transactions that is spendable.

Thorkil Værge

Posted 2014-12-26T18:21:07.763

Reputation: 637