1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-27 00:48:09 +00:00

Edited ch10.asciidoc with Atlas code editor

This commit is contained in:
judymcconville@roadrunner.com 2017-05-03 10:02:10 -07:00
parent 768fc473ba
commit b3b1a8174a

View File

@ -189,7 +189,7 @@ $ bitcoin-cli getblock 0000000000000001b6b9a13b095e96db41c4a928b97ef2d9\
==== The Coinbase Transaction
((("coinbase transactions", id="coinbtrans10")))((("transactions", "coinbase transactions", id="Tcoinb10")))((("mining and consensus", "aggregating transactions into blocks", "coinbase transactions")))The first transaction in any block is a special transaction, called a _coinbase transaction_. This transaction is constructed by Jing's node and contains his _reward_ for the mining effort.
((("coinbase transactions", id="coinbtrans10")))((("transactions", "coinbase transactions", id="Tcoinb10")))The first transaction in any block is a special transaction, called a _coinbase transaction_. This transaction is constructed by Jing's node and contains his _reward_ for the mining effort.
[NOTE]
====
@ -242,7 +242,7 @@ Unlike regular transactions, the coinbase transaction does not consume (spend) U
==== Coinbase Reward and Fees
((("mining and consensus", "aggregating transactions into blocks", "coinbase reward and fees")))((("transaction fees")))((("mining and consensus", "rewards and fees")))To construct the coinbase transaction, Jing's node first calculates the total amount of transaction fees by adding all the inputs and outputs of the 418 transactions that were added to the block. The fees are calculated as:
((("coinbase transactions", "rewards and fees")))((("transaction fees")))((("mining and consensus", "rewards and fees")))To construct the coinbase transaction, Jing's node first calculates the total amount of transaction fees by adding all the inputs and outputs of the 418 transactions that were added to the block. The fees are calculated as:
----
Total Fees = Sum(Inputs) - Sum(Outputs)
@ -291,7 +291,7 @@ If Jing's mining node writes the coinbase transaction, what stops Jing from "rew
==== Structure of the Coinbase Transaction
((("mining and consensus", "aggregating transactions into blocks", "coinbase transaction structure")))With these calculations, Jing's node then constructs the coinbase transaction to pay himself 25.09094928 bitcoin.
((("coinbase transactions", "structure of")))With these calculations, Jing's node then constructs the coinbase transaction to pay himself 25.09094928 bitcoin.
As you can see in <<generation_tx_example>>, the coinbase transaction has a special format. Instead of a transaction input specifying a previous UTXO to spend, it has a "coinbase" input. We examined transaction inputs in <<tx_in_structure>>. Let's compare a regular transaction input with a coinbase transaction input. <<table_8-1>> shows the structure of a regular transaction, while <<table_8-2>> shows the structure of the coinbase transaction's input.
@ -324,7 +324,7 @@ In a coinbase transaction, the first two fields are set to values that do not re
==== Coinbase Data
((("mining and consensus", "aggregating transactions into blocks", "coinbase data")))Coinbase transactions do not have an unlocking script (a.k.a., +scriptSig+) field. Instead, this field is replaced by coinbase data, which must be between 2 and 100 bytes. Except for the first few bytes, the rest of the coinbase data can be used by miners in any way they want; it is arbitrary data.
((("coinbase transactions", "coinbase data")))Coinbase transactions do not have an unlocking script (a.k.a., +scriptSig+) field. Instead, this field is replaced by coinbase data, which must be between 2 and 100 bytes. Except for the first few bytes, the rest of the coinbase data can be used by miners in any way they want; it is arbitrary data.
((("nonce values")))((("blocks", "genesis block")))((("blockchain technology", "genesis block")))((("genesis block")))In the genesis block, for example, Satoshi Nakamoto added the text "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" in the coinbase data, using it as a proof of the date and to convey a message. Currently, miners use the coinbase data to include extra nonce values and strings identifying the mining pool.