shuijian-xu / bitcoin

0 stars 0 forks source link

coinbase transaction #190

Open shuijian-xu opened 4 years ago

shuijian-xu commented 4 years ago

Coinbase is the required first transaction of every block and is the only transaction allowed to bring bitcoins into existence. The coinbase transaction’s outputs are kept by whomever the mining entity designates and usually include all the transaction fees of the other transactions in the block as well as something called the block reward.

shuijian-xu commented 4 years ago

The transaction structure is no different from that of other transactions on the Bitcoin network, with a few exceptions:

  1. Coinbase transactions must have exactly one input.

  2. The one input must have a previous transaction of 32 bytes of 00.

  3. The one input must have a previous index of ffffffff.

These three conditions determine whether a transaction is a coinbase transaction or not.