Author

Topic: Transaction Fees (Read 437 times)

legendary
Activity: 3472
Merit: 4801
February 24, 2013, 03:27:02 AM
#6
As an example, here is a block with 6 transactions:

http://blockchain.info/block-index/128373/000000000000a6dade9423c6cebb7222fb3155e28e5600b35b6f54cd8a1228f5

You'll notice in this transaction from that block:

http://blockchain.info/tx/da5423baae6eeefa3535a8fb05304214b556b9ceed699316a9dd84b00f685326

That there is exactly 1 input valued at 30.12 BTC and exactly 2 outputs (30.06 BTC & 0.05 BTC) resulting in total outputs of 30.11 BTC.

The difference between the total inputs in the transaction, and the total outputs is 0.01 BTC.  This is how you pay transaction fees.  You just include more in your inputs than in your outputs.

The miner created this transaction, called a coinbase transaction, when they built that block:

http://blockchain.info/tx/c338a4bc83d859feec4f9fab9bea5d5cdfa6d80804d026649f9e08e28a1126f5

You'll see it has no inputs.  The protocol normally doesn't allow transactions where the total of the inputs is less than the total of the outputs.  However, it does allow each block to have exactly one such transaction (called a coinbase transaction) to be created by the miner with zero inputs.  The block subsidy as determined by the protocol at the time of this block was 50 BTC (now it is 25 BTC).  The protocol allows the total of the coinbase transaction to be no larger than the sum of the block subsidy and the transaction fees.  Since there is only that one transaction in this block that paid fees, the value of the outputs in this coinbase transaction is 50.01 BTC.
newbie
Activity: 48
Merit: 0
February 24, 2013, 03:22:27 AM
#5
Thanks, that makes a little bit more sense.
legendary
Activity: 3472
Merit: 4801
February 24, 2013, 03:15:48 AM
#4
Miners confirm transactions.

They collect up a bunch of transactions from the network that are not yet in a block.
Then hash those transactions resulting in a "Merkle root" (basically a SHA-256 Hash) which they include in the header of a new block.
Then they begin hashing that block header (SHA-256) over and over incrementing a field called a "nonce" each time until the resulting hash is less than a target value.

When the find a hash that is low enough they broadcast that block, hash, and nonce to the network for everyone to add to their blockchain.

For doing this work, the miner is allowed to create exactly one transaction that has no inputs.  The output of the transaction is allowed to be any value less than or equal to the sum of the current block subsidy and all the transaction fees of the transactions they chose to include in the block.

newbie
Activity: 48
Merit: 0
February 24, 2013, 03:07:11 AM
#3
what do you mean by transactions they include?

Are you able to put it in the form of a scenario?
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
February 24, 2013, 03:03:12 AM
#2
Miners get the transaction fees for transactions they include in the block they mined.
newbie
Activity: 48
Merit: 0
February 24, 2013, 03:01:52 AM
#1
So something I am still trying to get my head around. Where do transaction fees go? Who gets them?
Are they just stored back into the blockchain and then given to miners when a block in cracked?

:S?Huh?
Jump to: