Bitcoin Forum
May 08, 2024, 08:06:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: On a technical level, what determines how big a block will be?  (Read 770 times)
Pietjebel (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
August 16, 2015, 12:02:24 PM
 #1


From the whitepaper:

1)
New transactions are broadcast to all nodes.
2)
Each node collects new transactions into a block. 
3)
Each node works on finding a difficult proof-of-work for its block.
4)
When a node finds a proof-of-work, it broadcasts the block to all nodes.

So how does the the miner software work? I reckon transactions are flowing in continuously.
The time needed for the pow and the rate of incoming transactions determines the size of the block?
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, but full nodes are more resource-heavy, and they must do a lengthy initial syncing process. As a result, lightweight clients with somewhat less security are commonly used.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
August 16, 2015, 12:13:45 PM
 #2

The transactions included are determined usually by their priority, which is also determined by the fee. Large transactions are typically high priority as well as transactions with a decent fee. I think the software will pull the transactions with a high enough priority first and include those in the block. Also, part of the block is a thing called the merkle root, which is a hash of all of the transactions included into the block. In order to change the hash in different ways besides the nonce, different transactions will also be included to change the merkle root. Generally, block sizes are determined by how quickly the miners exhaust nonces and how many transactions with decent fees can be stuffed in.

Pietjebel (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
August 16, 2015, 12:22:22 PM
 #3

The transactions included are determined usually by their priority, which is also determined by the fee. Large transactions are typically high priority as well as transactions with a decent fee. I think the software will pull the transactions with a high enough priority first and include those in the block. Also, part of the block is a thing called the merkle root, which is a hash of all of the transactions included into the block. In order to change the hash in different ways besides the nonce, different transactions will also be included to change the merkle root. Generally, block sizes are determined by how quickly the miners exhaust nonces and how many transactions with decent fees can be stuffed in.

So does the amount of transactions in the block change with each hash attempt with a new nonce?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
August 16, 2015, 12:44:39 PM
 #4

The transactions included are determined usually by their priority, which is also determined by the fee. Large transactions are typically high priority as well as transactions with a decent fee. I think the software will pull the transactions with a high enough priority first and include those in the block. Also, part of the block is a thing called the merkle root, which is a hash of all of the transactions included into the block. In order to change the hash in different ways besides the nonce, different transactions will also be included to change the merkle root. Generally, block sizes are determined by how quickly the miners exhaust nonces and how many transactions with decent fees can be stuffed in.

So does the amount of transactions in the block change with each hash attempt with a new nonce?
The amount probably changes a little when the range of nonces and extranonces is exhausted since transactions are different sizes. The transactions inside will probably change as something needs to be changed in order to get something different for the hash. I think lower priority transactions (low fee) will be removed in favor of higher priority (high fee) transactions.

Pietjebel (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile
August 16, 2015, 01:36:56 PM
 #5


Okay, thanks for replying.
I don't still get the full gist of this but I guess you will need to fiddle with the actual code to get a total understanding.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
August 16, 2015, 02:12:47 PM
 #6


Okay, thanks for replying.
I don't still get the full gist of this but I guess you will need to fiddle with the actual code to get a total understanding.

Solo miners (or mining pools) get to choose the size of their blocks as long as it is equal to or smaller than the consensus rule on maximum block size.  Currently the consensus rule is that blocks cannot be larger than 1 megabyte, but there are several discussions occurring about changing that maximum limit in the future.

The most profitable thing to do would be to fill the block right up to the limit with the transactions that pay the largest amount PER BYTE. If the solo miner (or mining pool) isn't aware of enough transactions to fill the block, then the most profitable thing to do is to include all transactions that pay any fee at all.  Including free transactions is up to the generosity of the solo miner (or pool) since it does not increase their revenue at all (and each byte added to the block very slightly increases the odds that the block may become orphaned).

As such, if there is a backlog of more than enough fee-paying transactions, then the blocksize will be any size less than or equal to the consensus limit that the solo miner (or mining pool) chooses it to be.  In most cases this is likely to either be very close to the consensus limit or very close to any limit the miner (or pool) has personally chosen.  It is likely to only change by a few hundred bytes or so as the miner (or pool) replaces transactions that pay a lower fee-per-byte with transactions that pay a higher fee-per-byte as the miner (or pool) hears about them).

If there is not a backlog of fee-paying transactions, then the solo miner (or mining pool) may choose to add new fee-paying transactions to their blocks as they hear about the transactions in order to increase the revenue that the block will generate for them.
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!