1

I am having a hard time understanding the details of how blocks are getting created by miners while many transactions are being received by various nodes at slightly different times and what information from these broadcasts get combined with a nonce to find the target to satisfy the proof of work.

Let's say that Alice sends Bob 1 BTC. This transaction gets broadcasted to the entire network of miners who will then verify that transaction is correct and proceed to try and find a nonce to create a block with all other transactions that they have received.

However, there are many transaction broadcasts happening simultaneously. Transactions can arrive at different nodes at different times due to latency. How does each individual node know how many and what transactions to include in the block? What happens to transactions that arrive to the node while the block is being "mined"? Or do new transactions get added to the block while it is being mined? What data from the transactions gets combined with a nonce and hashed to find the target?

1 Answer 1

2

The miner picks what transactions they want to include in the block, out of the ones they have received when they start working on that block, yes. Once they start mining a candidate block, it's usually inefficient for them to add more transactions, so transactions received during the mining process are more likely to be included a block later. Once the block is mined, the list of transactions included in it are broadcast through the network so all nodes can see which ones were included, request any they don't have, and verify its a valid block.

The block header is what is hashed, it contains a version number, merkle root of transactions (basically a cryptographic summary of them all to commit to which ones are included), timestamp, the difficulty target, and the hash of the previous block. See: https://en.bitcoin.it/wiki/Block_hashing_algorithm

2
  • Is it possible that the one or many transactions can be picked by different miners?
    – Uahmed
    Commented Jun 8, 2018 at 8:43
  • Yes, different miners can pick different transactions or order the transactions differently within a block Commented Jun 8, 2018 at 23:42

Your Answer

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

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