Author

Topic: How does a miner receives a transaction fee (Read 209 times)

legendary
Activity: 2352
Merit: 6089
bitcoindata.science
January 24, 2020, 06:14:08 PM
#4
You can take a look at a coin base transaction here:
https://www.blockchain.com/btc/tx/6b8da0669bc5c3a6cb24108c8e3d3dd5a965e4deb390d441444871c28c451fa8

The block reward is only 12.5, however the miner received more than 12.6, due to fees.
legendary
Activity: 3472
Merit: 4801
January 24, 2020, 01:07:44 PM
#3
Each block has a coingen transaction for the block subsidy - so far so good.
But how does the miner gets the fees of transactions in a block?

Exactly the same way.

The "coingen transaction" of the block doesn't only have the block subsidy. It has the block subsidy + the transaction fees.

Is there a "getTransactionFees()" transaction?

Nope.  Just the "coingen transaction"
sr. member
Activity: 279
Merit: 435
January 23, 2020, 03:31:16 PM
#2
Hi,

Each block has a coingen transaction for the block subsidy - so far so good.
But how does the miner gets the fees of transactions in a block? Is there a "getTransactionFees()" transaction?

Transaction fees are implicit in Bitcoin tranasctions. They are the difference between the sum of the inputs' value and the sum of the outputs' value.
All transactions need to have `sum(outputs) <= sum(inputs)` (and not just equal! Which would, by the way not be relayed by most of the nodes).
A block generator needs to create a coinbase transaction outputs which value is <= to `block_subsidy + fees` with `fees = sum(inputs_of_all_txs) - sum(outputs_of_all_txs)` for other network (full) nodes to accept it.
full member
Activity: 209
Merit: 102
January 23, 2020, 03:23:05 PM
#1
Each block has a coingen transaction for the block subsidy - so far so good.
But how does the miner gets the fees of transactions in a block? Is there a "getTransactionFees()" transaction?
Jump to: