<p>Coinbase transactions have some special rules not shared by other transactions:</p>

<ul>
<li>only one per block</li>
<li>must be the first transaction in the block</li>
<li>must have OP_RETURN output with witness commitment if block includes segwit transactions</li>
<li>must have only one input</li>
<li>the input must have the "coinbase" field instead of a scriptSig</li>
</ul>

<p>The "coinbase" field is where miners put the <code>extranonce</code>, commit to a specific blockheight (see <a href="https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki" rel="noreferrer">BIP-34</a>), and mark blocks to be found by them. Although, miners often collect the block reward in a single output, beside the rules for the witness commitment, <strong>the Coinbase transaction has no special restrictions on other outputs</strong>. In fact, some mining pools used to pay out mining rewards directly from the Coinbase, see e.g. <a href="https://blockchair.com/bitcoin/transaction/f36222943ad100899acbd8300f943ee2c127babef879d8a3c0696c0d914e04ca" rel="noreferrer">the Coinbase of 133,471 mined by Eligius creating 919 outputs</a>. <strong>As such, the second <code>OP_RETURN</code> output could be anything the miner wants.</strong></p>

CC BY-SA 4.0
2019-09-02T04:39:10.207Z
2019-09-23T23:40:37.797Z
2019-09-23T23:40:37.797Z
Murch
<p>I've been looking at coinbase transactions for fun and I came across one with two op_return outputs..  </p>

<p>Does anyone know what the second one is?  </p>

<p>Also, I understand the first op_return is used to <a href="https://bitcoin.stackexchange.com/questions/74162/op-return-in-a-coinbase-transaction">embed the merkleroot</a> of the witness tree for segwit transactions in the block.</p>

<p>However, I've also seen coinbase transactions with multiple op_returns such as <a href="https://blockstream.info/block/0000000000000000000684b22621c3c472b7ada29eb21ea80c1473e093370017" rel="nofollow noreferrer">this one.</a>  Is there a specific purpose for that 2nd op_return or is the miner simply using it for their own purpose?</p>

<coinbase-transaction><op-return>
Why does this coinbase transaction have two op_return outputs?
Andrew
# Why does this coinbase transaction have two op_return outputs?

(Asked by: username_0 on 2019-08-31)

I've been looking at coinbase transactions for fun and I came across one with two op\_return outputs..

Does anyone know what the second one is?

Also, I understand the first op\_return is used to [embed the merkleroot](https://bitcoin.stackexchange.com/questions/74162/op-return-in-a-coinbase-transaction) of the witness tree for segwit transactions in the block.

However, I've also seen coinbase transactions with multiple op\_returns such as [this one.](https://blockstream.info/block/0000000000000000000684b22621c3c472b7ada29eb21ea80c1473e093370017) Is there a specific purpose for that 2nd op\_return or is the miner simply using it for their own purpose?

**Tags:** coinbase-transaction, op-return


---

## 1 answers

### Answer by username_1 on 2019-09-02. Score: 9

Coinbase transactions have some special rules not shared by other transactions:

* only one per block
* must be the first transaction in the block
* must have OP\_RETURN output with witness commitment if block includes segwit transactions
* must have only one input
* the input must have the "coinbase" field instead of a scriptSig

The "coinbase" field is where miners put the `extranonce`, commit to a specific blockheight (see [BIP-34](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki)), and mark blocks to be found by them. Although, miners often collect the block reward in a single output, beside the rules for the witness commitment, **the Coinbase transaction has no special restrictions on other outputs**. In fact, some mining pools used to pay out mining rewards directly from the Coinbase, see e.g. [the Coinbase of 133,471 mined by Eligius creating 919 outputs](https://blockchair.com/bitcoin/transaction/f36222943ad100899acbd8300f943ee2c127babef879d8a3c0696c0d914e04ca). **As such, the second `OP_RETURN` output could be anything the miner wants.**


---

