Bitcoin Forum
June 18, 2021, 10:33:20 PM *
News: Latest Bitcoin Core release: 0.21.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do fees end up back with the miners?  (Read 1041 times)
crabel
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
January 13, 2014, 04:47:13 AM
 #1

I am data mining the block chain to develop network metrics and need to understand the fee protocol. Any help is greatly appreciated.

When I pay a fee, where does it go, is there a specific address or does that portion of the block chain cease to exist and be rediscovered?

What is the fingerprint in the block chain that uniquely identifies the fees paid to the miners for each particular block?

Thanks!
1624055600
Hero Member
*
Offline Offline

Posts: 1624055600

View Profile Personal Message (Offline)

Ignore
1624055600
Reply with quote  #2

1624055600
Report to moderator
1624055600
Hero Member
*
Offline Offline

Posts: 1624055600

View Profile Personal Message (Offline)

Ignore
1624055600
Reply with quote  #2

1624055600
Report to moderator
1624055600
Hero Member
*
Offline Offline

Posts: 1624055600

View Profile Personal Message (Offline)

Ignore
1624055600
Reply with quote  #2

1624055600
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
DannyHamilton
Legendary
*
Offline Offline

Activity: 2506
Merit: 2032



View Profile
January 13, 2014, 03:47:38 PM
 #2

I am data mining the block chain to develop network metrics and need to understand the fee protocol. Any help is greatly appreciated.

When I pay a fee, where does it go, is there a specific address or does that portion of the block chain cease to exist and be rediscovered?

What is the fingerprint in the block chain that uniquely identifies the fees paid to the miners for each particular block?

Thanks!

When you create a transaction, you list unspent outputs that you will be using as inputs.  The total value of all the listed unspent outputs is the total value that the transaction will be re-assigning to new unspent outputs.

Then you list the outputs that you intend to specify.  Typically this list includes a script for each of the addresses that you intend to send bitcoins to along with the value that you intend to associate with that script.  Then, you create a script for an address that you control and associate the "change" with that address.

If the total value of the specified outputs is greater than the total value of the specified inputs, then you have created an invalid transaction.  All peers will refuse to relay it, and miners will refuse to confirm it.

If the total value of the specified outputs is equal to the total value of the specified inputs, then you have created a valid transaction that does not pay any fee at all.  As long as your transaction passes the priority test and the minimum output size test, your peers will relay it and a miner will most likely confirm it eventually.

If the total value of the specified outputs is less than the total value of the specified inputs, then the difference between the total outputs and the total inputs is a "transaction fee".  The protocol allows the miners (or mining pools) to assign this additional value to any address(es) they want in the coinbase transaction (the same transaction that they use to assign the block subsidy).

So, when a miner (or mining pool) creates a block that they will attempt to solve, they create a special transaction (called the coinbase transaction).  The protocol allows this transaction to have 0 inputs, and to have outputs that have a total value that is less than or equal to the total of the current block subsidy and all the transaction fees (unaccounted for value from the transactions) of all the transactions that the miner includes in the block when they build it.
crabel
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
January 13, 2014, 04:43:43 PM
 #3

Danny,

Thank you.  I found the coinbase, the 0 position tx_id in the blockchain. So as I understand your explanation is there is an unassigned tx quantity that has an originating address, and no destination address. This sum is then claimed by the miners and divided per the rules of the pool.

What I am still not clear about is that is it possible to go back and access the information in the chain to see the path of the fees in the block chain, or does the inclusion of the fee in the coinbase wipe its history?
DannyHamilton
Legendary
*
Offline Offline

Activity: 2506
Merit: 2032



View Profile
January 14, 2014, 04:33:04 AM
 #4

Danny,

Thank you.  I found the coinbase, the 0 position tx_id in the blockchain. So as I understand your explanation is there is an unassigned tx quantity that has an originating address, and no destination address. This sum is then claimed by the miners and divided per the rules of the pool.

There are no "originating addresses" in bitcoin, only originating outputs (more specifically, unspent outputs) that are used as inputs into a transaction.

What I am still not clear about is that is it possible to go back and access the information in the chain to see the path of the fees in the block chain, or does the inclusion of the fee in the coinbase wipe its history?

Depends on what you mean by "history".  You can subtract the block subsidy from the coinbase transaction, and the remaining value is the total of the transaction fees.  This value "comes from" the total of the fees of all the transactions in that block.  You can therefore calculate what percentage of the total fees for the block came from each transaction.

It would seem that this is not different than a transaction that has multiple inputs and multiple outputs.  If I create a transaction that spends 4 unspent outputs:

  • unspent output A: 1 BTC
  • unspent output B: 1.5 BTC
  • unspent output C: 0.25 BTC
  • unspent output D: 2 BTC

And creates 3 new unspent outputs:

  • unspent output E: 1.5 BTC
  • unspent output F: 1.5 BTC
  • unspent output G: 1.5 BTC

Clearly there is a 0.25 BTC transaction fee, but can you tell me the "path" of the output D?  how about the "path" of the output A?
e4xit
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250



View Profile
January 14, 2014, 11:49:20 AM
 #5

--snip--
So, when a miner (or mining pool) creates a block that they will attempt to solve, they create a special transaction (called the coinbase transaction).  The protocol allows this transaction to have 0 inputs, and to have outputs that have a total value that is less than or equal to the total of the current block subsidy and all the transaction fees (unaccounted for value from the transactions) of all the transactions that the miner includes in the block when they build it.
--snip--

Danny, the way you have phrased this has raised a question in my head; what if the miners do not accept the fee as allocated to them by the transaction? Where do the unspent outputs get output to in this (unlikely?) situation? Perhaps this would simply be an "invalid block", although I am not too familiar with the innard of BTC to this level...

Not your keys, not your coins.
CoinJoin, always.
OnkelPaul
Legendary
*
Offline Offline

Activity: 1042
Merit: 1002



View Profile
January 14, 2014, 11:54:17 AM
 #6

what if the miners do not accept the fee as allocated to them by the transaction?

Blocks that destroy bitcoins are valid. In such a case, the fee would be gone forever.

Onkel Paul

justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1006



View Profile
January 14, 2014, 11:57:12 AM
 #7

what if the miners do not accept the fee as allocated to them by the transaction?

Blocks that destroy bitcoins are valid. In such a case, the fee would be gone forever.

Onkel Paul
That's happened before.
DannyHamilton
Legendary
*
Offline Offline

Activity: 2506
Merit: 2032



View Profile
January 14, 2014, 03:06:00 PM
 #8

Blocks that destroy bitcoins are valid. In such a case, the fee would be gone forever.

Onkel Paul

+1

That's happened before.

+1

As has been stated.  If a miner chooses not to claim the full reward that they are due, then the unclaimed portion of the reward simply ceases to exist.  This has happened before.

If the claimed portion of the reward is greater than or equal to the block subsidy, then you might think of it as "destroying" bitcoins that used to exist (some or all of the transaction fees).  They are removed from circulation forever (assuming no significant change to the bitcoin protocol).

If the claimed portion of the reward is less than the block subsidy, then you might think of is as "failing to mint" some coins in the first place.  They simply never come into existence and are never put into circulation.  This reduces the total bitcoins that will ever be created (assuming no significant change to the bitcoin protocol).

How you choose to think of it is really a matter of semantics.  Technically the system doesn't differentiate between the portion of the reward that is "subsidy" and the portion that is "fees".
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!