After sending/flooding transactions, how do we know that a specific transaction is on all nodes?
In the book “Mastering the Blockchain” by Imran Bashir, it says that a transaction’s life cycle is the following:
- A user/sender sends a transaction using wallet software or some other interface.
- The wallet software signs the transaction using the sender’s private key.
- The transaction is broadcasted to the Bitcoin network using a flooding algorithm.
- Mining nodes include this transaction in the next block to be mined.
- Mining starts once a miner who solves the Proof of Work problem broadcasts the newly mined
block to the network. Proof of Work is explained in detail later in this chapter.
- The nodes verify the block and propagate the block further, and confirmation starts to generate.
- Finally, the confirmations start to appear in the receiver’s wallet and after approximately six
confirmations, the transaction is considered finalized and confirmed. However, six is just a
recommended number; the transaction can be considered final even after the first confirmation.
The key idea behind waiting for six confirmations is that the probability of double spending is
virtually eliminated after six confirmations.
Now all nodes have competing miners to create a block by receiving all transactions by all nodes/users that submit transactions and packing it, which is not coming from one place. If we call the winner, the miner that solves the PoW problem first, then how do we know that he received all the transactions he’s supposed to receive before announcing that he created a valid block? My miner software could ignore a few transactions and get to mining earlier than others, and hence beat everyone else (assuming we all have the same computational power).
My question also can be read in a different way: How do ensure that all miners are solving the same PoW problem, while big latency times can be involved in the Bitcoin network (because we’re mining from around the world)?