I just started to study blockchain and bitcoin yesterday and came up with some questions.

  1. If miners can select transactions when creating a block, how is it ensured that all the transactions over every 10 minutes are recorded? For example, if a miner selected only a half of all the transactions over 10 minutes and found a valid hash, how can the other half of the transactions be recorded?

  2. The answer to the first question might render this question unnecessary, but if miners can select transactions when creating a block, how is it ensured that the first one didn't include any invalid transactions over the 10 minutes?

  3. Also, why is only the first one to find a valid hash rewarded while the first one might have left out some transactions during selection (although an answer to Q1 might render this worry unnecessary)? Is there any security reason behind choosing the first one? For example, is the first one considered to be the most trustworthy because it takes time to make invalid modifications on previous/current transactions?

  4. The fourth question came out while I was watching 19:43~ of the following video: https://www.youtube.com/watch?v=bBC-nXj3Ng4. It is understandable that Alice will fail to cheat because Alice can't create invalid blocks faster than the rest of the miners. However, what if Alice broadcasted the first invalid block to every other miner? In that case, wouldn't all the other miners find next blocks based on the assumption that Alice's first invalid block is valid so that Alice wouldn't have to exceed all the other miners every time?

Thank you.

  • Why would anyone assume an invalid block is valid? Feb 2, 2022 at 8:57

1 Answer 1

  1. It is not ensured. Miners can run any software they want to determine which transactions to include in a block. The game theory makes censorship hard however: it only takes one miner to include a transaction in a block for it to become valid. If a given transaction is not "selected" for a block, it remains in the mempool, a collection of unconfirmed (not in a block) transactions.

  2. This verification is exactly what nodes do. Whenever nodes receive a new block, they verify the signatures and validity of every single transaction in that block, including whether or not the coins each transaction attempts to spend are spendable. The linear nature of the blockchain ensures that there all transactions are objectively valid or invalid at certain block heights/times.

  3. No one chooses the "first" one to find a valid hash. The valid blockchain is the chain which includes the most work. For simplicity's sake, this is almost always the chain with the greatest number of blocks in it. When a miner finds a valid hash, they publish their block and all other miners accept it (assuming its valid) and mine on top of that block. Only one miner gets the reward for that block, but other miners hope to get rewards by finding subsequent blocks.

  4. See #3. Blocks are not valid/invalid based on the time they were mined. The longest chain is always valid, even if a shorter chain has blocks that were mined before the blocks in the longer chain. Read more here: What Is Proof-of-Work?

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.