<p>Yes, it is possible for block 1,983,702 to duplicate the coinbase of block 164,384 with the current consensus rules.</p>
<p>Starting with block 1,983,702 the explicit BIP30 check will be re-enabled (see <a href="https://bitcoin.stackexchange.com/a/120839/101498">this answer</a> for details). However all outputs from <code>3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462</code> were spent. There is not any UTxO with txid <code>3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462</code> in the UTxO set anymore. Therefore a block at height 1,983,702 with the very same coinbase as block 164,384 would be valid.</p>
<blockquote>
<p>If so, would this be a supply inflation bug?</p>
</blockquote>
<p>No. If someone wanted to create a duplicate UTxO by duplicating one of the spenders of <code>3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462</code> (if at all possible, i haven't checked), this would still be prevented by BIP30.</p>

CC BY-SA 4.0
2023-12-19T20:14:54.917Z
Has anyone done the analysis on whether any of the descendants of 3aa037 can be duplicated? Would buy us a few more decades :-)
Sjors Provoost
CC BY-SA 4.0
2023-12-08T12:46:33.127Z
2023-12-08T12:46:33.127Z
Antoine Poinsot
<p>If the block contains at least one segWit transaction, the coinbase transaction must have a witness commitment as one of its outputs. Therefore, a miner that wants to reuse the coinbase transaction would need to exclude all segwit transactions from their block. Since the vast majority of transactions use segwit today, this would severely limit the block’s mining reward potential.</p>
<p>So, even if the input of two coinbase transactions is the same, the outputs (due to witness commitment) cannot match.</p>
<p>Therefore, the supply deflation bug will not occur because it will be two completely different transactions with two completely different IDs.</p>

CC BY-SA 4.0
2023-12-08T16:33:54.003Z
You could for example edit your answer to say: "If the block contains at least one segWit transaction, the coinbase transaction must have a witness commitment as one of its outputs. Therefore, a miner that wants to reuse the coinbase transaction would need to exclude all segwit transactions from their block. Since the vast majority of transactions use segwit today, this would severely limit the block’s mining reward potential."
Murch
CC BY-SA 4.0
2023-12-08T11:17:16.070Z
2023-12-08T17:26:57.650Z
2023-12-08T17:26:57.650Z
LeaBit
<p>It would be possible for block 1,983,702 to repeat the coinbase transaction of block 164,384 under these three conditions:</p>
<ul>
<li>The block does not collect any segwit transactions, otherwise a witness commitment would need to be present on the coinbase transaction¹</li>
<li>The block collects at least 169.9153'4375 ₿ in fees, to pay 170.01300000 ₿ to outputs while the block subsidy is only 0.0976'5625 ₿ (but the miner could just include a transaction that pays that fee)</li>
<li>The miner is a complete dunce and is willing to hand a fortune to the recipients of block 164,384’s coinbase outputs, for the sake of repeating a coinbase transaction</li>
</ul>
<p>Either way, there never was a <em>supply inflation</em> issue: when an unspent output gets overwritten, it is created twice but can only be spent once. Therefore, the supply is <em>reduced</em> not <em>increased</em>.² Since all seven outputs from the block 164,384’s coinbase already have been spent repeating the coinbase transaction would not lead to supply deflation or any other issues. If they were not spent yet, BIP30 would prevent repeating the coinbase transaction and cause the block to be invalid.²</p>
<p>Overall, I am pretty confident that this is a nothingburger.</p>
<hr />
<p><sup>¹  H/T @LeaBit, who made that point <a href="https://bitcoin.stackexchange.com/a/120838/5406">first</a></sup><br />
<sup>² H/T @PieterWuille, who suggested that I mention this in comments</sup></p>

CC BY-SA 4.0
2023-12-09T07:53:41.507Z
thanks, that makes sense now. i mistakenly thought the previous block subsidy could be replayed, but obviously the subsidy depends solely on the block height.
delta1
CC BY-SA 4.0
2023-12-08T14:42:36.293Z
2023-12-08T16:09:36.337Z
2023-12-08T16:09:36.337Z
Murch
<p><a href="https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki" rel="nofollow noreferrer">BIP34</a> requires coinbase transactions to begin with a data push of the block's height.</p>
<p>The coinbase transaction in block <code>164384</code> (<a href="https://mempool.space/tx/3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462" rel="nofollow noreferrer"><code>3aa03753fc</code></a>) happens to start with <code>OP_PUSHBYTES_3 d6441e</code> which is the value <code>1983702</code>.</p>
<p><strong>Is it possible for the miner of block <code>1983702</code> to use the exact same coinbase transaction from block <code>164384</code>?</strong></p>
<p>If so, would this be a supply inflation bug?</p>
<p>Or is this mitigated by <a href="https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki" rel="nofollow noreferrer">BIP30</a>?</p>
<blockquote>
<p>Blocks are not allowed to contain a transaction whose identifier matches that of an earlier, not-fully-spent transaction in the same chain.</p>
</blockquote>
<p>Currently that transaction is not yet fully spent, but that could change before block <code>1983702</code>.</p>
<p>If this is still a possible issue, how could it be resolved before then?</p>

<coinbase-transaction><bip-34><bip-30>
Is it possible for the coinbase transaction in block 164384 to be duplicated in block 1983702?
delta1
# Is it possible for the coinbase transaction in block 164384 to be duplicated in block 1983702?

(Asked by: username_0 on 2023-12-08)

[BIP34](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki) requires coinbase transactions to begin with a data push of the block's height.

The coinbase transaction in block `164384` ([`3aa03753fc`](https://mempool.space/tx/3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462)) happens to start with `OP_PUSHBYTES_3 d6441e` which is the value `1983702`.

**Is it possible for the miner of block `1983702` to use the exact same coinbase transaction from block `164384`?**

If so, would this be a supply inflation bug?

Or is this mitigated by [BIP30](https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki)?

> Blocks are not allowed to contain a transaction whose identifier matches that of an earlier, not-fully-spent transaction in the same chain.

Currently that transaction is not yet fully spent, but that could change before block `1983702`.

If this is still a possible issue, how could it be resolved before then?

**Tags:** coinbase-transaction, bip-34, bip-30


---

## 3 answers

### Answer by username_4 on 2023-12-08. Score: 7 | Accepted answer

It would be possible for block 1,983,702 to repeat the coinbase transaction of block 164,384 under these three conditions:

* The block does not collect any segwit transactions, otherwise a witness commitment would need to be present on the coinbase transaction¹
* The block collects at least 169.9153'4375 ₿ in fees, to pay 170.01300000 ₿ to outputs while the block subsidy is only 0.0976'5625 ₿ (but the miner could just include a transaction that pays that fee)
* The miner is a complete dunce and is willing to hand a fortune to the recipients of block 164,384’s coinbase outputs, for the sake of repeating a coinbase transaction

Either way, there never was a *supply inflation* issue: when an unspent output gets overwritten, it is created twice but can only be spent once. Therefore, the supply is *reduced* not *increased*.² Since all seven outputs from the block 164,384’s coinbase already have been spent repeating the coinbase transaction would not lead to supply deflation or any other issues. If they were not spent yet, BIP30 would prevent repeating the coinbase transaction and cause the block to be invalid.²

Overall, I am pretty confident that this is a nothingburger.

---

¹ H/T @username_3, who made that point [first](https://bitcoin.stackexchange.com/a/120838/5406)  
² H/T @PieterWuille, who suggested that I mention this in comments

> **Comments:**
> **username_0**: thanks, that makes sense now. i mistakenly thought the previous block subsidy could be replayed, but obviously the subsidy depends solely on the block height.  

---

### Answer by username_1 on 2023-12-08. Score: 5

Yes, it is possible for block 1,983,702 to duplicate the coinbase of block 164,384 with the current consensus rules.

Starting with block 1,983,702 the explicit BIP30 check will be re-enabled (see [this answer](https://bitcoin.stackexchange.com/a/120839/101498) for details). However all outputs from `3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462` were spent. There is not any UTxO with txid `3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462` in the UTxO set anymore. Therefore a block at height 1,983,702 with the very same coinbase as block 164,384 would be valid.

> If so, would this be a supply inflation bug?

No. If someone wanted to create a duplicate UTxO by duplicating one of the spenders of `3aa03753fc238b38f4db9e5889362f3a6f0900d602baa8c9a7e789cb13ca1462` (if at all possible, i haven't checked), this would still be prevented by BIP30.

> **Comments:**
> **username_2**: Has anyone done the analysis on whether any of the descendants of 3aa037 can be duplicated? Would buy us a few more decades :-)  

---

### Answer by username_3 on 2023-12-08. Score: 2

If the block contains at least one segWit transaction, the coinbase transaction must have a witness commitment as one of its outputs. Therefore, a miner that wants to reuse the coinbase transaction would need to exclude all segwit transactions from their block. Since the vast majority of transactions use segwit today, this would severely limit the block’s mining reward potential.

So, even if the input of two coinbase transactions is the same, the outputs (due to witness commitment) cannot match.

Therefore, the supply deflation bug will not occur because it will be two completely different transactions with two completely different IDs.

> **Comments:**
> **username_4**: You could for example edit your answer to say: "If the block contains at least one segWit transaction, the coinbase transaction must have a witness commitment as one of its outputs. Therefore, a miner that wants to reuse the coinbase transaction would need to exclude all segwit transactions from their block. Since the vast majority of transactions use segwit today, this would severely limit the block’s mining reward potential."  

---

