Bitcoin Forum
December 14, 2024, 09:53:06 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does a miner receives a transaction fee  (Read 207 times)
Euro1000 (OP)
Full Member
***
Offline Offline

Activity: 209
Merit: 102


View Profile
January 23, 2020, 08:23:05 PM
Merited by o_e_l_e_o (1)
 #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?
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
January 23, 2020, 08:31:16 PM
Merited by o_e_l_e_o (2), pooya87 (1), ABCbits (1), Pmalek (1), Heisenberg_Hunter (1)
 #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.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3514
Merit: 4894



View Profile
January 24, 2020, 06:07:44 PM
Merited by gmaxwell (2), ABCbits (1), JollyGood (1)
 #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"
bitmover
Legendary
*
Online Online

Activity: 2520
Merit: 6373


Wheel of Whales 🐳


View Profile WWW
January 24, 2020, 11: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.

███████████▄
████████▄▄██
█████████▀█
███████████▄███████▄
█████▄█▄██████████████
████▄█▀▄░█████▄████████
████▄███░████████████▀
████░█████░█████▀▄▄▄▄▄
█████░█
██░█████████▀▀
░▄█▀
███░░▀▀▀██████
▀███████▄█▀▀▀██████▀
░░████▄▀░▀▀▀▀████▀
 

█████████████████████████
████████████▀░░░▀▀▀▀█████
█████████▀▀▀█▄░░░░░░░████
████▀▀░░░░░░░█▄░▄░░░▐████
████▌░░░░▄░░░▐████░░▐███
█████░░░▄██▄░░██▀░░░█████
█████▌░░▀██▀░░▐▌░░░▐█████
██████░░░░▀░░░░█░░░▐█████
██████▌░░░░░░░░▐█▄▄██████
███████▄░░▄▄▄████████████
█████████████████████████

█████████████████████████
████████▀▀░░░░░▀▀████████
██████░░▄██▄░▄██▄░░██████
█████░░████▀░▀████░░█████
████░░░░▀▀░░░░░▀▀░░░░████
████░░▄██░░░░░░░██▄░░████
████░░████░░░░░████░░████
█████░░▀▀░▄███▄░▀▀░░████
██████░░░░▀███▀░░░░██████
████████▄▄░░░░░▄▄████████
█████████████████████████
.
...SOL.....USDT...
...FAST PAYOUTS...
...BTC...
...TON...
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!