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. | + | '''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: | A coinbase transaction follows the same format as a normal transaction, except: | ||
Line 11: | Line 13: | ||
The winning miner can pay the coinbase value to multiple outputs as needed, and is also free to include zero value OP_FALSE OP_RETURN outputs in the transaction. | The winning miner can pay the coinbase value to multiple outputs as needed, and is also free to include zero value OP_FALSE OP_RETURN outputs in the transaction. | ||
+ | |||
+ | [[https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki BIP 0034]] mandated that the block height value be specified in the first item of the coinbase transaction. This value requires 4 bytes to store. | ||
+ | |||
+ | Note: The block height of the [[Genesis_block]] is zero. | ||
Upcoming innovations such as [[MinerID]] and the upcoming [[Merchant API]] will use the Coinbase transaction to present information to the network such as node identity, transaction pricing data and more. This data will use standard formats such that user wallets shall be able to read and parse the information, giving them up-to-date knowledge of which nodes are competitive on the network and more. | Upcoming innovations such as [[MinerID]] and the upcoming [[Merchant API]] will use the Coinbase transaction to present information to the network such as node identity, transaction pricing data and more. This data will use standard formats such that user wallets shall be able to read and parse the information, giving them up-to-date knowledge of which nodes are competitive on the network and more. |
Revision as of 14:46, 23 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 extra nonce field is incremented and the merkle root updated to generate a further 2^32 possible block hashes to try.
The winning miner can pay the coinbase value to multiple outputs as needed, and is also free to include zero value OP_FALSE OP_RETURN outputs in the transaction.
[BIP 0034] mandated that the block height value be specified in the first item of the coinbase transaction. This value requires 4 bytes to store.
Note: The block height of the Genesis_block is zero.
Upcoming innovations such as MinerID and the upcoming Merchant API will use the Coinbase transaction to present information to the network such as node identity, transaction pricing data and more. This data will use standard formats such that user wallets shall be able to read and parse the information, giving them up-to-date knowledge of which nodes are competitive on the network and more.