38

I searched the bitcoin wiki and found references to coinbase, but no clear cut explanation of what exactly it is. I know that miners can tag their coinbases (that is how some sites tell who mined a block).

Murch
  • 75,206
  • 34
  • 186
  • 622
Andrew Burns
  • 681
  • 1
  • 7
  • 6

2 Answers2

32

The term "coinbase" is used to mean many different things. But the two you're probably asking about are:

  1. The "coinbase transaction" is the transaction inside a block that pays the miner his block reward.

  2. Inside the coinbase transaction is a field that is called the "coinbase". It's the generation transaction's equivalent of a scriptsig. Since it doesn't claim any existing outputs, it needs no normal scriptsig. It's basically just a random value that the miner can use as an additional nonce. BIP 34 changes this a bit.

David Schwartz
  • 51,554
  • 6
  • 106
  • 178
11

David has already given a good explanation of the term coinbase, but I'd like to give further details on the coinbase transaction.

The coinbase transaction is a special type of transaction.

  • Every block must have a coinbase transaction, other transactions are optional.
  • The coinbase transaction must be the first transaction of the block (it follows that there can only be one per block).
  • The coinbase's output is used to send the block reward, i.e. block subsidy plus transaction fees, to the miner's address.
  • The coinbase transaction can have an arbitrary input of 100 byte size. E.g. this was where the genesis block famously contained "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks". This is also the field that may be used for the extranonce.
Murch
  • 75,206
  • 34
  • 186
  • 622