"they are simply building a transaction that has no inputs and which creates the appropriate outputs for the UTXO"
It means they are "creating" bitcoin
out of thin airNormally, in any transaction that's not a Coinbase transaction, the transaction MUST have inputs it references.
If A sends bitcoins to B, and B wants to send it to C, to spend the bitcoin, B must reference the output of the previous transaction (the one that A sent), and also if C wants to spend it, he must reference the output of the transaction he got from B, that would be the input of the new transaction, and so on.
(It should go without saying that a person can't spend more than the UTXO he uses as inputs contain)
In a Coinbase transaction, however, there are no
inputs to reference so it's like the bitcoins that are paid as mining rewards are created from thin air.
1 - Bitcoin Core node mine a winning hash
2 - Block is assembled from transactions in the mempool
3- Block reward transactions is created
4 - Block is written to the chain
5 - CoinBase is populated with new UTXO
It doesn't have to be a bitcoin Core node, just any node that follows the protocol rules.
Also, 2 comes before 1.
The transactions in the mempool of the miner are aggregated before he tries to compute the proof-of-work.
Also, the Coinbase transaction (the one paying the miner the block reward and the fees of the transaction) is the FIRST transaction in the block always.
Questions
1 - How is the verification of the winning hash done?
The winning hash is the one whose hash of block header + nonce is less than a given Target.
The target is known by all the nodes in the network and can be independently calculated and verified.
Finding the block header + nonce hash which is less than a given Target is the actual proof-of-work being done by the miner.
3 - How is the actual mining reward transaction created and verified
1.) Miner aggregates all the transaction in the mempool that can fit in a block. (the transactions are hecjed for validity, adding an invalid transaction invalidates the whole block)
2) The Coinbase transaction (that pays him the block reward and fees for the transactions aggregated) is included first in this candidate block (not a real block yet because it hasn't computed the proof-of-work and found a "winning hash")
NB: the miner just can't pay himself any arbitrary amount GREATER than the block subsidy as the block reward because the subsidy is fixed and halves after a set number of blocks that corresponds to 4 years. The current is 12.5
BTC , if a miner pays himself a larger amount than that, even if he finds the winning hash, his work will be in vain because ALL the nodes in the blockchain will REJECT his block as invalid, because it does not obey the consensus rules, and thus it wouldn't even propagate far. The only way he can do this correctly and succeed is if he somehow convinces the WHOLE network -- or most -- to run his custom software that uses a different set of rules.
3)Add previous block hash as a reference.
Summarise all the transactions in the block (including the Coinbase transaction) as a Merkle tree, add a timestamp, and the Target. Then the nonce
5)4 above forms the block header, the miner then hashes this value while changing the nonce after each hash until the hash is less than the target.
If he finds one that is less than the target i.e the winning hash, he then "publishes" the block, which other miners and nodes verify. If it is valid according to the protocol rules, then other miners will mine on top of it, and the transactions in the block have 1 confirmation.
Then the race starts all over again.
However, this Coinbase transaction that pays the miner his rewards cannot be spent until after 101 confirmations (100 blocks). This is because, in case of a temporary fork where 2 miners find the winning hash at the same time, one will be invalidated and dropped by the network (the one with less proof of work). If this happens all the transactions in the orphaned block (that aren't in the validated block) that were heretofore confirmed will be sent back to the mempool. The Coinbase transaction can't be sent to the mempool since it isn't a valid transaction because it references no inputs, so it will disappear completely.
If the Coinbase maturation didn't exist, orphaned blocks would cause a problem for the network because coins that once existed would no longer exist.
I'm studying currency inflation mechanisms, any incite would be greatly appreciated. -Thanks
In that case you should read Andreas Antonopolous' book
Mastering Bitcoin