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.