Difference between revisions of "Coinbase"

Line 1: Line 1:
'''Coinbase''' is the special name given to the first transaction in every block. These can also be called 'Generation Transactions'. The winning miner creates this special transaction as part of the block templating process. A part of the coinbase is also used as an 'extra nonce' during the block discovery process due to a single ASIC miner being able to test more combinations than allowed for in the 2^32 possible combinations that changing the nonce in the block header can create.
+
'''Coinbase''' is the special name given to the first transaction in every block. These can also be called 'Generation Transactions'. The winning miner creates this special transaction as part of the block templating process.  
  
The Coinbase transaction's outputs contain the block reward + the total of all transaction fees combined. The winning miner can pay this total amount out to up to 2^64 outputs.
+
A coinbase transaction follows the same format as a normal transaction, except:
 +
* It has exactly one txin
 +
* This txin's prevout hash is 0000...0000.
 +
* This txin's prevout index is 0xFFFFFFFF
 +
* The txin's prevout script is an arbitrary byte array which is used by miners to signal identity and pass messages from block winning nodes to the rest of the network
 +
* The sum of the txout's values cannot exceed the total of the current [[Miner subsidy]] plus the mining fees paid by all other transactions included in the block
  
While regular transactions refer to their parent transaction outputs to aggregate 'input' funds, a generation transaction has no parent.  
+
A part of the coinbase is also used as an 'extra nonce' during the block discovery process due to a single ASIC miner being able to test more combinations than allowed for in the 2^32 possible combinations that changing the nonce in the block header can create.
  
The Coinbase transaction can contain any arbitrary data. The [[genesis block]] famously contains the dated title of an FT article:
+
The winning miner can pay the coinbase value to multiple outputs as needed, and is also free to include zero value false return outputs in the transaction.
The Times 03/Jan/2009 Chancellor on brink of second bailout for banks
 

Revision as of 11:43, 12 December 2019

Coinbase is the special name given to the first transaction in every block. These can also be called 'Generation Transactions'. The winning miner creates this special transaction as part of the block templating process.

A coinbase transaction follows the same format as a normal transaction, except:

  • It has exactly one txin
  • This txin's prevout hash is 0000...0000.
  • This txin's prevout index is 0xFFFFFFFF
  • The txin's prevout script is an arbitrary byte array which is used by miners to signal identity and pass messages from block winning nodes to the rest of the network
  • The sum of the txout's values cannot exceed the total of the current Miner subsidy plus the mining fees paid by all other transactions included in the block

A part of the coinbase is also used as an 'extra nonce' during the block discovery process due to a single ASIC miner being able to test more combinations than allowed for in the 2^32 possible combinations that changing the nonce in the block header can create.

The winning miner can pay the coinbase value to multiple outputs as needed, and is also free to include zero value false return outputs in the transaction.