Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
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?
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.
- That input must have prevout hash exactly equal to
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.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments