<blockquote>
<p>The previous output field comes immediately after the input count field. Normally there should be a 4-byte VOUT field in between. But because there is no previous output, does that mean there is simply no VOUT field?</p>
</blockquote>
<p>There is; it's the <code>ffffffff</code> in the hex dump you cited. The rules for coinbase transactions are:</p>
<ul>
<li>It must have exactly one transaction input
<ul>
<li>That input must have prevout hash exactly equal to <code>0000000000000000000000000000000000000000000000000000000000000000</code></li>
<li>That input must have prevout index exactly equal to <code>ffffffff</code> (=2<sup>32</sup>-1, =4294967295).</li>
<li>That input must have a scriptSig between 2 and 100 bytes in length.</li>
<li>Since BIP34 activation (March 2013), that scriptSig must start with a push of the block height.</li>
</ul>
</li>
</ul>

CC BY-SA 4.0
2022-04-21T15:40:54.443Z
Oh I see. Thanks. I thought the ffffffff was a part of the prevout hash.
apchrkey
CC BY-SA 4.0
2022-04-21T15:37:39.193Z
2022-04-21T15:37:39.193Z
Pieter Wuille
<p><strong>When a miner creates a candidate block, the very first space for a transaction is reserved for the coinbase transaction</strong>. An input is constitued of this structure :</p>
<ul>
<li>Transaction Id (32 bytes)</li>
<li>Vout (4 bytes)</li>
<li>Script Sig Size (varInt)</li>
<li>Script Sig (Script Sig Size)</li>
<li>Sequence (4 bytes)</li>
</ul>
<p>Regarding the transaction <strong>0x04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6</strong>, it's a coinbase transaction. <strong>Every transaction has a VOUT</strong>. In your case, this tx has a VOUT equals to <strong>0xffffffff</strong>. This is specific to the coinbase transaction with obviously an empty previous transaction id (txId).</p>
<p>For others transactions, the txId is replaced by the previous user's transaction hash and the vout by the output number of this transaction hash in which there's the user's address. These data are stored in UTXO database.</p>
<p>Best regards.</p>

CC BY-SA 4.0
2022-04-21T15:49:18.873Z
2022-04-21T16:10:39.503Z
2022-04-21T16:10:39.503Z
Loopite
<p>In a coinbase transaction, the previous output field is <code>0000000000000000000000000000000000000000000000000000000000000000ffffffff</code> because there is no previous output, the coins are generated.</p>
<p>If you look at this coinbase transactions raw data:
<a href="https://blockchain.info/rawtx/04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6?format=hex" rel="nofollow noreferrer">https://blockchain.info/rawtx/04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6?format=hex</a></p>
<p>The previous output field comes immediately after the input count field. Normally there should be a 4-byte VOUT field in between. But because there is no previous output, does that mean there is simply no VOUT field?</p>
<p>Is this also the same for transactions which only have 1 previous output?</p>

<coinbase-transaction>
Does a coinbase transaction's input field have a VOUT field?
apchrkey
# Does a coinbase transaction's input field have a VOUT field?

(Asked by: username_0 on 2022-04-21)

In a coinbase transaction, the previous output field is `0000000000000000000000000000000000000000000000000000000000000000ffffffff` because there is no previous output, the coins are generated.

If you look at this coinbase transactions raw data:
<https://blockchain.info/rawtx/04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6?format=hex>

The previous output field comes immediately after the input count field. Normally there should be a 4-byte VOUT field in between. But because there is no previous output, does that mean there is simply no VOUT field?

Is this also the same for transactions which only have 1 previous output?

**Tags:** coinbase-transaction


---

## 2 answers

### Answer by username_1 on 2022-04-21. Score: 3 | Accepted answer

> The previous output field comes immediately after the input count field. Normally there should be a 4-byte VOUT field in between. But because there is no previous output, does that mean there is simply no VOUT field?

There is; it's the `ffffffff` in the hex dump you cited. The rules for coinbase transactions are:

* It must have exactly one transaction input
  + That input must have prevout hash exactly equal to `0000000000000000000000000000000000000000000000000000000000000000`
  + That input must have prevout index exactly equal to `ffffffff` (=232-1, =4294967295).
  + That input must have a scriptSig between 2 and 100 bytes in length.
  + Since BIP34 activation (March 2013), that scriptSig must start with a push of the block height.

> **Comments:**
> **username_0**: Oh I see. Thanks. I thought the ffffffff was a part of the prevout hash.  

---

### Answer by username_2 on 2022-04-21. Score: 2

**When a miner creates a candidate block, the very first space for a transaction is reserved for the coinbase transaction**. An input is constitued of this structure :

* Transaction Id (32 bytes)
* Vout (4 bytes)
* Script Sig Size (varInt)
* Script Sig (Script Sig Size)
* Sequence (4 bytes)

Regarding the transaction **0x04183fe0d461697c043abd156276f14e810c2d250970170ce66debf687223ff6**, it's a coinbase transaction. **Every transaction has a VOUT**. In your case, this tx has a VOUT equals to **0xffffffff**. This is specific to the coinbase transaction with obviously an empty previous transaction id (txId).

For others transactions, the txId is replaced by the previous user's transaction hash and the vout by the output number of this transaction hash in which there's the user's address. These data are stored in UTXO database.

Best regards.


---

