<p>This is not true. <a href="https://github.com/bitcoin/bitcoin/blob/v0.1.5/main.cpp#L1167" rel="noreferrer">Code and code comments</a> in v0.1.5 (the oldest tagged version in git) enforce that there always is a coinbase transaction and that it must always be the first. There cannot be a coinbase transaction elsewhere in the block. Coinbase transactions are defined as transactions with one input whose previous transaction hash is all 0's and whose previous output index is -1 (because it is an unsigned int, this becomes 0xffffffff).</p>

<p>You can also find a copy of the original 0.1.0 source code and find the same code and comments in the same place in main.cpp.</p>

CC BY-SA 4.0
2019-11-14T15:59:44.400Z
2019-11-14T15:59:44.400Z
Ava Chow
<p>The user <a href="https://bitcoin.stackexchange.com/questions/72269/do-mined-coins-show-up-on-blockchain-explorers-and-can-the-balance-of-the-addres/91666?noredirect=1#comment104922_91666">tempo mentioned</a> on another topic:  </p>

<blockquote>
  <p>"At least in the early protocol versions it was possible to put the coinbase transaction not on the top of the outputs."</p>
</blockquote>

<p>I have never heard about this before. Was the placement of the Coinbase transaction more flexible in earlier days or was it always necessary to put it as the first transaction in the block?</p>

<consensus><coinbase-transaction><history>
Was it always required for the Coinbase transaction to be the first transaction in a block?
Murch
# Was it always required for the Coinbase transaction to be the first transaction in a block?

(Asked by: username_0 on 2019-11-14)

The user [tempo mentioned](https://bitcoin.stackexchange.com/questions/72269/do-mined-coins-show-up-on-blockchain-explorers-and-can-the-balance-of-the-addres/91666?noredirect=1#comment104922_91666) on another topic:

> "At least in the early protocol versions it was possible to put the coinbase transaction not on the top of the outputs."

I have never heard about this before. Was the placement of the Coinbase transaction more flexible in earlier days or was it always necessary to put it as the first transaction in the block?

**Tags:** consensus, coinbase-transaction, history


---

## 1 answers

### Answer by username_1 on 2019-11-14. Score: 7 | Accepted answer

This is not true. [Code and code comments](https://github.com/bitcoin/bitcoin/blob/v0.1.5/main.cpp#L1167) in v0.1.5 (the oldest tagged version in git) enforce that there always is a coinbase transaction and that it must always be the first. There cannot be a coinbase transaction elsewhere in the block. Coinbase transactions are defined as transactions with one input whose previous transaction hash is all 0's and whose previous output index is -1 (because it is an unsigned int, this becomes 0xffffffff).

You can also find a copy of the original 0.1.0 source code and find the same code and comments in the same place in main.cpp.


---

