0

I need some help understanding the Bitcoin internal...

The basic idea is:

The miner assembles N transactions into a block (rather than creating a consensus for every single transaction). And hash those transactions for the consensus.

But, when exactly the miner code decides to "combine"? How long does the miner code wait until passing those transactions to a hash function?

Does it wait until the list of transactions hit the block size limit (1 MB)?

Or does it just wait X-minute?

Or does it combine immediately as soon as it receives the transaction fees?

The whitepaper says

Each node collects new transactions into a block.

Although it would be possible to handle coins individually, it would be unwieldy to make a separate transaction for every cent in a transfer. To allow value to be split and combined, transactions contain multiple inputs and outputs.

But does not explain how many it collects, or how long it waits for collection...

1 Answer 1

0

A miner chooses whatever transactions makes business sense to them. They don't have to include any transactions if they don't want to. They can make a block containing no transactions (other than the coinbase transaction that pays the miner the block reward).

Typically, as soon as a block has been published by someone else (or themselves), I'd expect a miner to obtain or build a block template that may or may not include a bunch of transactions waiting in its "memory pool" (mempool). Then the miner will run through trillions of different values for the nonce etc and for each value, compute the hash of the block to see if the resulting hash is less than the current target.

But miners can start mining any time they like. The only constraint is that they just waste their time if they try to publish block number N after someone else already published a different block with block number N.


The miner assembles N transactions into a block

That's basically true. Mostly.

(rather than creating a consensus for every single transaction).

Miners don't create consensus.

Miners could create a block for one transaction at a time if they wanted to.

when exactly the miner code decides to "combine"?

Whenever they want.

Does it wait until the list of transactions hit the block size limit (1 MB)?

No.

does it just wait X-minute?

No.

does it combine immediately as soon as it receives the transaction fees?

No.

Miners don't receive transaction fees. Certainly not in advance.

Miners claim transaction fees. They do this by creating a coinbase transaction that they include as the first transaction in a block. This transaction typically moves the transaction fee amounts into an address of the miner's wallet.

They can't spend that money unless everyone involved thinks their new block meets all the rules.

One rule is they can't spend that money until after another 100 blocks has been mined.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.