Author

Topic: On a technical level, what determines how big a block will be? (Read 793 times)

legendary
Activity: 3472
Merit: 4801

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.
newbie
Activity: 21
Merit: 2

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.
staff
Activity: 3458
Merit: 6793
Just writing some code
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.
newbie
Activity: 21
Merit: 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.

So does the amount of transactions in the block change with each hash attempt with a new nonce?
staff
Activity: 3458
Merit: 6793
Just writing some code
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.
newbie
Activity: 21
Merit: 2

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?
Jump to: