Bitcoin Forum
April 25, 2024, 08:18:40 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to miners decide which transactions to include in a block?  (Read 1455 times)
RangerK (OP)
Member
**
Offline Offline

Activity: 93
Merit: 10



View Profile WWW
July 26, 2013, 04:07:56 PM
 #1

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?

Cool ---> Who will mine the next 777 Block??? Place your bets at block777.com!!!
1714033120
Hero Member
*
Offline Offline

Posts: 1714033120

View Profile Personal Message (Offline)

Ignore
1714033120
Reply with quote  #2

1714033120
Report to moderator
1714033120
Hero Member
*
Offline Offline

Posts: 1714033120

View Profile Personal Message (Offline)

Ignore
1714033120
Reply with quote  #2

1714033120
Report to moderator
1714033120
Hero Member
*
Offline Offline

Posts: 1714033120

View Profile Personal Message (Offline)

Ignore
1714033120
Reply with quote  #2

1714033120
Report to moderator
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714033120
Hero Member
*
Offline Offline

Posts: 1714033120

View Profile Personal Message (Offline)

Ignore
1714033120
Reply with quote  #2

1714033120
Report to moderator
1714033120
Hero Member
*
Offline Offline

Posts: 1714033120

View Profile Personal Message (Offline)

Ignore
1714033120
Reply with quote  #2

1714033120
Report to moderator
1714033120
Hero Member
*
Offline Offline

Posts: 1714033120

View Profile Personal Message (Offline)

Ignore
1714033120
Reply with quote  #2

1714033120
Report to moderator
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
July 26, 2013, 04:10:26 PM
 #2

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.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
July 26, 2013, 04:21:09 PM
 #3

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.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
steeev
Full Member
***
Offline Offline

Activity: 128
Merit: 103



View Profile
July 27, 2013, 04:35:03 AM
 #4

...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...?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
July 27, 2013, 03:23:22 PM
 #5

...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.
Trongersoll
Hero Member
*****
Offline Offline

Activity: 490
Merit: 501



View Profile
July 27, 2013, 05:03:02 PM
Last edit: July 27, 2013, 06:41:38 PM by Trongersoll
 #6

so, for a solo miner using bitcoin-qt, that decides what goes into a block? is it configurable? Huh
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
July 27, 2013, 06:28:31 PM
 #7

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.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
July 27, 2013, 08:03:09 PM
 #8

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.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
July 29, 2013, 12:16:49 AM
 #9

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=<n>      Set minimum block size in bytes (default: 0)
 -blockmaxsize=<n>      Set maximum block size in bytes (default: 250000)
 -blockprioritysize=<n> 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".

How often do you get the chance to work on a potentially world-changing project?
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!