Author

Topic: How to miners decide which transactions to include in a block? (Read 1475 times)

legendary
Activity: 1652
Merit: 2301
Chief Scientist
so, for a solo miner using bitcoin-qt, that decide what goes into a block? is it configurable? Huh
It's not. You need to modify the client from the source.

That's incorrect. The following command-line or bitcoin.conf configuration parameters let miners set their transaction acceptance policy:

Quote
-blockminsize=      Set minimum block size in bytes (default: 0)
 -blockmaxsize=      Set maximum block size in bytes (default: 250000)
 -blockprioritysize= Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)
 

The -mintxfee / -minrelaytxfee options currently control how large a fee-per-kilobyte is needed for a transaction to be considered "fee paying" versus "free".
legendary
Activity: 1232
Merit: 1094
so, for a solo miner using bitcoin-qt, that decides what goes into a block? is it configurable? Huh

It is slightly difficult to do, so miners generally don't bother.

When transaction fees are a larger portion of the block rewards, then miners might implement more profit orientated changes to the source.
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
so, for a solo miner using bitcoin-qt, that decide what goes into a block? is it configurable? Huh
It's not. You need to modify the client from the source.
hero member
Activity: 490
Merit: 501
so, for a solo miner using bitcoin-qt, that decides what goes into a block? is it configurable? Huh
legendary
Activity: 3472
Merit: 4801
...is there a way for me to know how old my coins are ?

The previous information about priority failed to mention that priority also takes into account the size of the transaction.  Priority is actually calculated as:
priority = sum(input_value_in_base_units * input_age)/transaction_size_in_bytes

For the purposes of calculating priority, input_age is determined by the number of confirmations received since the bitcoins were received in a transaction. input_value_in_base_unite is determined as the number of "satoshi".

So, If you received 2.3 BTC in a transaction that now has 72 confirmations, then those bitcoins would contribute the following to the sum in the numerator of the calculation:

230,000,000 satoshi * 72 confirmations = 16,560,000,000

If that was the only input in the transaction and the transaction was a total of 276 bytes in size, then the transaction priority would be:

16,560,000,000 / 276 = 60,000,000

If a transaction has a priority less than 57,600,000, then most miners will refuse to add it to a block unless it also includes a transaction fee of at least 0.0001 BTC per kilobyte.

and will older coins be more desired over time ? like rare or collectible coins...?

No way to predict what others might choose to value in the future, but I generally find it unlikely since the act of sending them the bitcoin would immediately reduce its age back to 0.

I suppose you could give them the private key associated with the address that the old coins are associated with, but that seems VERY insecure. Since you also know the private key, you could steal the bitcoins as soon as you parted ways.
full member
Activity: 128
Merit: 103
...is there a way for me to know how old my coins are ?

and will older coins be more desired over time ? like rare or collectible coins...?
legendary
Activity: 1232
Merit: 1094
Here's my guess based on what I've already learned:

Whenever a bloc emerges which the miner agrees is valid, it simply accepts it, and adds to it all the currently-recorded transactions which have happened since then.

Is this accurate?  Is there more to it?

Miners can put whatever transactions they want into the block.  The only mandatory transaction is the one that pays themselves their fee (and there is no reason to leave that one out anyway).

If any of the transactions are invalid, then the block would be rejected.

Since they can only put a certain number of transactions in a block, they should pick the ones that pay the most fees.

However, mostly they don't care about fees, since the mint reward is much higher.

The standard miner software won't add your transactions into blocks unless they fit into one of these sections.  Normal clients won't forward them unless they would mine them.

High Priority

A transaction counts as high priority if it spends mostly old coins and/or spends a lot of coins value.

Basically, each input coin has a priority = (age * value) and they all get added up.

If the transaction is above a certain priority, then it gets into this section.

There are no fees for this section.  This is the only way to get free transactions confirmed.

Fee paying

About half the block is used for fee paying transactions.  There is a minimum fee you must pay to get into this section.

Unused

The default client mostly leaves the other half of the block unused.
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
I am not greatly familiar with the source, but there is transactions priority related to coin age, tx size and fee size. But generally, the higher the fee, the higher the incentive to include a transaction in a block.
member
Activity: 93
Merit: 10
Forgive me if this is a beginner question.  I'm still relatively new.  The answer to this question wasn't apparent to me from reading Stoshi's famous whitepaper (http://bitcoin.org/bitcoin.pdf).

Here's my guess based on what I've already learned:

Whenever a bloc emerges which the miner agrees is valid, it simply accepts it, and adds to it all the currently-recorded transactions which have happened since then.

Is this accurate?  Is there more to it?
Jump to: