Bitcoin Forum
November 17, 2024, 07:06:21 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How are fees channelled to miners?  (Read 869 times)
jonanon (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
January 29, 2014, 08:06:17 PM
 #1

I haven't seen this question raised before.

How are tx fees actually distributed to miners?

 Huh
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
January 29, 2014, 08:06:56 PM
 #2

It's included in the block which is usually solved by a pool, and divided to each miner (depending on their share of the work done).

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
jonanon (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
January 29, 2014, 08:10:05 PM
 #3

It's included in the block which is usually solved by a pool, and divided to each miner (depending on their share of the work done).

How would this work for solo miners, would they ever get tx fee revenue?
Rannasha
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


View Profile
January 29, 2014, 08:13:53 PM
 #4

It's included in the block which is usually solved by a pool, and divided to each miner (depending on their share of the work done).

How would this work for solo miners, would they ever get tx fee revenue?

If they find a block, then yes.

What happens is that every transaction contains one or more inputs and one or more outputs. The difference between the total BTC value of the inputs and the total BTC value of the outputs makes up the transaction fee. These coins don't directly go anywhere, in a way they go into nothingness. But miners are allowed to add up all these differences and add them to their base block reward (the 25 BTC we're currently at) when creating their reward-transaction.
jonanon (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
January 29, 2014, 08:17:01 PM
 #5

It's included in the block which is usually solved by a pool, and divided to each miner (depending on their share of the work done).

How would this work for solo miners, would they ever get tx fee revenue?

If they find a block, then yes.

What happens is that every transaction contains one or more inputs and one or more outputs. The difference between the total BTC value of the inputs and the total BTC value of the outputs makes up the transaction fee. These coins don't directly go anywhere, in a way they go into nothingness. But miners are allowed to add up all these differences and add them to their base block reward (the 25 BTC we're currently at) when creating their reward-transaction.

OK so if they find a block, get rewarded 25 coins how do they add tx fees to this amount and actually see the coins?
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 29, 2014, 08:18:55 PM
 #6

Rannasha explained it.  It is actually a pretty clever solution and it only loosely couples the tx (and fee) to the miner.

Miners (solo miner is no different than a pool) are allowed to put a special tx in the block called the coinbase.  Now to prevent unlimited printing of coins, all nodes compute what the coinbase should be a block which pays miners "too much" is simply considered invalid by the rest of the network and deleted.

To be valid the value of the coinbase <= value of block subsidy + (value of all tx_inputs in the block - value of all tx_outputs in the block).

Note miners can (and have probably due to bugs) pay themselves less.  They could even pay themselves nothing and in essence unmint coins.  It likely was an oversight as I see no good reason for the validation requirement to not be coinbase = value of subsidy + fees.

Rannasha
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


View Profile
January 29, 2014, 08:19:36 PM
 #7

It's included in the block which is usually solved by a pool, and divided to each miner (depending on their share of the work done).

How would this work for solo miners, would they ever get tx fee revenue?

If they find a block, then yes.

What happens is that every transaction contains one or more inputs and one or more outputs. The difference between the total BTC value of the inputs and the total BTC value of the outputs makes up the transaction fee. These coins don't directly go anywhere, in a way they go into nothingness. But miners are allowed to add up all these differences and add them to their base block reward (the 25 BTC we're currently at) when creating their reward-transaction.

OK so if they find a block, get rewarded 25 coins how do they add tx fees to this amount and actually see the coins?

When you mine a block, you add a special transaction, called a coinbase transaction. This transaction has no inputs, and outputs to an address (or more) of your choice. The coinbase transaction has to have a value of at most the block reward (25 BTC) plus the total sum of transaction fees for the transactions that you included in the block. So if you include 100 transactions with a 0.0001 fee, the coinbase transaction will send 25.01 BTC to your address.
jonanon (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
January 29, 2014, 08:22:02 PM
 #8

OK thanks for the clarifications - I'm a little wiser than I was before!

 Wink
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 29, 2014, 08:23:21 PM
 #9

It's included in the block which is usually solved by a pool, and divided to each miner (depending on their share of the work done).

How would this work for solo miners, would they ever get tx fee revenue?

If they find a block, then yes.

What happens is that every transaction contains one or more inputs and one or more outputs. The difference between the total BTC value of the inputs and the total BTC value of the outputs makes up the transaction fee. These coins don't directly go anywhere, in a way they go into nothingness. But miners are allowed to add up all these differences and add them to their base block reward (the 25 BTC we're currently at) when creating their reward-transaction.

OK so if they find a block, get rewarded 25 coins how do they add tx fees to this amount and actually see the coins?

They aren't awarded 25 coins.  They are awarded the current subsidy (right now 25 BTC) PLUS the value of fees of all tx included in the block.  For most blocks right now that is slightly more than 25 BTC.

Example of a recent block.
https://blockchain.info/block-index/463885

Notice the first tx has no input only an output.  That is the coinbase tx.  It is how miners "get paid".  The protocol requires a block to have one and only one coinbase tx per block.  It is the first tx in any block.  Unlike any other tx it has no input only an output.  The miner is minting some coins from nothing (the subsidy) and collecting the tx fees for all tx in the block at the same time.

You will notice the value of the coinbase is not 25.0000000 BTC it is 25.09845377 BTC.   The value of all the fees paid on the 706 tx in the block combined is 0.09845377 BTC.

The miner paid itself 25 BTC (subsidy) + 0.09845377 (fees) = 25.09845377 BTC (total).

Miners can't cheat because all nodes on the network verify blocks.  All nodes know what the current subsidy is and they can verify the amount of fees paid on all the tx in the block.  If the coinbase is "too much" the block will be rejected.   As a weird exception the miner could actually pay himself less.  A coinbase of 25.09845376 BTC for this block would be valid as would a coinbase of 25 BTC or 0 BTC.  However a coinbase of 25.09845378 would be instantly recognized by every node on the network as invalid and deleted.

ZephramC
Sr. Member
****
Offline Offline

Activity: 475
Merit: 255



View Profile
January 29, 2014, 08:48:41 PM
 #10

Also the fees received by mining pool might or might not be distributed among miners (participating in particular pool). This is entirely up to the pool's policy and such division is unenforceable. However pools usually do this. Otherwise they would loose miners.
CoinHeavy
Full Member
***
Offline Offline

Activity: 221
Merit: 100


View Profile
January 29, 2014, 09:27:04 PM
 #11

Thanks for the clarity DeathAndTaxes.  Could you suggest any resources for digging into the low-level mechanics of mining operations?  These forums are obviously a fantastic reference but do you know of anything more formally organized for a proper course of study?  Cheers!
ZephramC
Sr. Member
****
Offline Offline

Activity: 475
Merit: 255



View Profile
January 29, 2014, 09:32:58 PM
 #12

Thanks for the clarity DeathAndTaxes.  Could you suggest any resources for digging into the low-level mechanics of mining operations?  These forums are obviously a fantastic reference but do you know of anything more formally organized for a proper course of study?  Cheers!

Well. Although I am not DeathAndTaxes...
https://en.bitcoin.it/wiki/Mining
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 29, 2014, 09:34:18 PM
 #13

Thanks for the clarity DeathAndTaxes.  Could you suggest any resources for digging into the low-level mechanics of mining operations?  These forums are obviously a fantastic reference but do you know of anything more formally organized for a proper course of study?  Cheers!

It likely isn't the answer you want to hear but ...

the source code

https://github.com/bitcoin/bitcoin

If you mean the low level mechanics of the actual mining software you would need to look at the source code of those projects (cgminer, etc).
Icon
Hero Member
*****
Offline Offline

Activity: 821
Merit: 503



View Profile
January 30, 2014, 12:18:50 AM
 #14

Also the fees received by mining pool might or might not be distributed among miners (participating in particular pool). This is entirely up to the pool's policy and such division is unenforceable. However pools usually do this. Otherwise they would loose miners.

No they don't i know that gash.io doesn't pay miners tx fees' nor for orphan blocks, Only one that i know that pays miners for tx fees and orpahn blocks is BTC Guild.



Icon

Sonny
Hero Member
*****
Offline Offline

Activity: 868
Merit: 1000


View Profile
January 30, 2014, 07:08:30 AM
 #15

Also the fees received by mining pool might or might not be distributed among miners (participating in particular pool). This is entirely up to the pool's policy and such division is unenforceable. However pools usually do this. Otherwise they would loose miners.

Only one that i know that pays miners for tx fees and orpahn blocks is BTC Guild.


For PPLNS, miners will be paid for tx fees.
For PPS, miners will be paid for orphan blocks, but with a higher fee.

So, it should be "or" instead of "and"  Wink

And if you are talking about pools that pay tx fees, then they are indeed pretty common. Smiley
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!