2

this sounds like an old topic but i have not found a satisfying answer yet; in history there lived two blocks with identical coinbase transactions:

but if you check the receiver address (1, 2)you would find they both get rewarded only once not twice; even though the same transaction was being used repeatedly, the two blocks have different nonces, which proved two shares of work in mining; then, which rule regards this as invalid and why is it designed like that?

Cyker
  • 247
  • 1
  • 7
  • Related: https://bitcoin.stackexchange.com/q/5903/5406, https://bitcoin.stackexchange.com/q/11999/5406, https://bitcoin.stackexchange.com/q/26910/5406, https://bitcoin.stackexchange.com/q/30764/5406, https://bitcoin.stackexchange.com/q/57435/5406 – Murch Nov 03 '18 at 06:02

1 Answers1

4

Duplicate txids were made invalid with BIP30 in 2012. The code was updated here: https://github.com/bitcoin/bitcoin/commit/ab91bf39b7c11e9c86bb2043c24f0f377f1cf514 to apply the new rule "to all blocks except the two historic blocks at heights 91842 and 91880 on the main chain that had to be grandfathered in." (These are the blocks you linked above).

The reason why they received the reward only once is because a given txid can only be spent once (no double spending is allowed). If one of the utxo is spent, then both get marked as spent since they have the same txid and vout index, so only one is listed as received. It also depends on the block explorer and how it handles the duplicate txids.

JBaczuk
  • 7,388
  • 1
  • 13
  • 34
  • Theoretically speaking, prior to BIP30 could two blocks have the same coinbase TXid as an empty block within the same median timestamp and solve with the exact same nonce/PoW hash? (Assuming no difficulty change) – Mason Ticehurst Nov 03 '18 at 20:56
  • The chances are zero, but see https://bitcoin.stackexchange.com/a/38385/60443. – JBaczuk Nov 03 '18 at 21:08
  • If someone wants to spend transaction d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599, how much bitcoin can they spend? 100 or 50? – Arsen Zahray Jul 01 '20 at 13:09