A coinbase transaction is the first transaction in a block. It is a unique type of bitcoin transaction that can be created by a miner. The miners use it to collect the block reward for their work and any other transaction fees collected by the miner are also sent in this transaction.
Each transaction executed on the bitcoin network are combined together to form a block. When a block is formed, immediately, it will be included in the blockchain. Now, these blocks are immutable and tamper-proof for all transaction that is made on the bitcoin network. Each block must contain one or more transaction, and the first transaction in the block is called the coinbase transaction.
The miners are always responsible for creating a block. When a block is successfully created, the miner will be rewarded from bitcoin for their work. The Bitcoin block reward is always dependent on the number of blocks from the genesis block and the number of fees included in the transactions of the block. The total amount of reward that a miner will collect is the sum of the block reward and the transaction fees taken from all the transactions that have been included in the block.
In the start of the bitcoin, the block reward is 50 bitcoin per block. The block reward is reduced by half after every 210, 000 blocks, i.e. approximately in every four years. The current reward for successfully creating a block is 12.5 bitcoin. It will be going to reduced 6.25 bitcoin per block in the year 2020.
There is one important feature of a coinbase transaction is that bitcoins involved in the transaction cannot be spent until they have received at least 100 block confirmations in the blockchain.