The Coinbase transaction, or Generation transaction, is a special transaction in the Bitcoin protocol that is different from a usual transaction because it creates coins from nothing.
It is the pay for the miners due to their successfully mining a block.
Firstly, all the transactions to be included are gathered and then all their charges are summed.
This is then calculated to the block reward – which halves every 210,000 blocks or roughly every four years – in 2015 the reward will be 25 Bitcoins and will reduce by 50% to 12.5 Bitcoins per block in 2017. The maximum number of halving allowed in the bitcoin protocol is 64 – this limit where the only transaction will make up the block reward is expected to be reached in the year 2139.
The miner then creates the coinbase transaction to award himself the reward. This takes on a special format as shown below:
The transaction hash is special alongside the output index where all the bits are set to 0 and 1 respectively. The coinbase data size is the size of the next field or the coinbase data field.
The coinbase data field could contain information such as the extra nonce, merged mining data and a list of the addresses of the mining pool where the funds are to be sent. The sequence number – all bits are set to 1.
Once a block has been mined and either sent to one address or the miners who participated in the pool the block reward has to be confirmed by 100 blocks – or about 6 hours.