Any need for coinbase field in coinbase transaction?

2

1

My understanding is that every block in the bitcoin blockchain has a coinbase transaction which contains a coinbase field. It is essentially an orphan field (placeholder) for use in claiming existing outputs. Since the coinbase transaction does not need to claim any existing outputs, it can be filled with any random data the miner chooses.

Would there be any adverse effects on Bitcoin (security or otherwise) if restrictions were placed on what the coinbase field can contain?

[Note: such a restriction may be desirable in order to prevent Bitcoin from being used as a parent coin in merged mining.]

Johannes Tynes

Posted 2014-01-27T14:03:51.710

Reputation: 117

Answers

2

The coinbase field can be used to distinguish coinbase transactions from one another on the level of hashes. If two coinbase transactions pay to the same address and use the same data in their coinbase fields, these transactions will have the same hash. This would introduce ambiguity into the blockchain, since the same transaction hash and offset would refer to two distinct transaction outputs.

benjaminwilson

Posted 2014-01-27T14:03:51.710

Reputation: 178

2

The coinbase field is crucial for pooled mining. All workers in a pool will be working to produce a block with the same list of transactions and the same block reward recipient address (that belongs to the pool owner/admin). The "nonce" field in the block header is only 32 bits long. The only way each worker can independently avoid wasting cycles on duplicate work is for the each worker to be assigned a different piece of coinbase data.

uminatsu

Posted 2014-01-27T14:03:51.710

Reputation: 1 061

1

The input for the coinbase transaction must now contain the block height as the first script data element. The remainder of the input script can be used however you want, although I believe the total script is limited to 100 bytes.

ScripterRon

Posted 2014-01-27T14:03:51.710

Reputation: 2 023