Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: dbbit on March 16, 2014, 05:25:32 AM



Title: Handling of a duplicate transaction across 2 blocks
Post by: dbbit on March 16, 2014, 05:25:32 AM
How does the following happen?
https://blockchain.info/tx/d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599

This same transaction occurs as the coinbase transaction for both block 91812 and 91842.


It hasn't been spent, but it's obviously not spendable from both blocks. So one of the mined blocks actually did not get any reward.


I can imagine 1 miner screwing that up but I would have thought additional confirming miners would have thrown out the duplicate transaction, no?


Is this a common occurrence that we need to take into account, or is it a weird anomaly?

Obviously blockchain.info coded around that, by allowing the same transaction to be displayed in 2 blocks.


Title: Re: Handling of a duplicate transaction across 2 blocks
Post by: amspir on March 16, 2014, 06:29:43 AM
It's not a duplicate transaction, the miner just assigned the outputs of the each of the mined blocks to the same address.  The reward from each block was 25 btc, the address now contains 50 btc.  It looks strange because blockchain doesn't indicate multiple mined blocks as the input.


Title: Re: Handling of a duplicate transaction across 2 blocks
Post by: theymos on March 16, 2014, 06:35:30 AM
It's not a duplicate transaction, the miner just assigned the outputs of the each of the mined blocks to the same address.

No, it really is a duplicate transaction.

Allowing this was a bug in the Bitcoin protocol. It's no longer possible for one transaction in the block chain to make another transaction in the same chain unspendable. However, a single transaction can still exist in more than one block if the older copy is completely spent before the newer transaction is added.


Title: Re: Handling of a duplicate transaction across 2 blocks
Post by: amspir on March 16, 2014, 06:43:11 AM
I stand corrected.


Title: Re: Handling of a duplicate transaction across 2 blocks
Post by: dbbit on March 16, 2014, 09:25:51 AM
It's not a duplicate transaction, the miner just assigned the outputs of the each of the mined blocks to the same address.

No, it really is a duplicate transaction.

Allowing this was a bug in the Bitcoin protocol. It's no longer possible for one transaction in the block chain to make another transaction in the same chain unspendable. However, a single transaction can still exist in more than one block if the older copy is completely spent before the newer transaction is added.

Thanks for the answer!

Is it legal for the second transaction to have different vins and vouts?

i.e. When you say "a single transaction can still exist in more...", is it basically legal for a new transaction to just re-use any old (spent) transaction ids, or must the second transaction be identical to the first?


Title: Re: Handling of a duplicate transaction across 2 blocks
Post by: theymos on March 16, 2014, 04:44:12 PM
Is it legal for the second transaction to have different vins and vouts?

i.e. When you say "a single transaction can still exist in more...", is it basically legal for a new transaction to just re-use any old (spent) transaction ids, or must the second transaction be identical to the first?

Now that I think about it more, I don't think that duplicate transactions are possible anymore. Non-coinbase transactions can't be duplicated because their inputs will be double-spends, and a rule was added a while ago that coinbase transactions must include the block height in their inputs, which prevents them from being duplicated.