0

In the book "Mastering the Blockchain" by Imran Bashir, it says that a transaction's life cycle is the following:

  1. A user/sender sends a transaction using wallet software or some other interface.
  2. The wallet software signs the transaction using the sender's private key.
  3. The transaction is broadcasted to the Bitcoin network using a flooding algorithm.
  4. Mining nodes include this transaction in the next block to be mined.
  5. 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.
  6. The nodes verify the block and propagate the block further, and confirmation starts to generate.
  7. 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.

My question:

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)?

0

You can't know it's on ALL nodes because it maybe isn't. Txns are gossiped on a best effort basis and it usually works out.

Miners are incentivised to include as many transactions as they can, in order from highest to lowest fee paid. So they connect to a large number of nodes to make sure they have the most complete information they can reasonably get in order to fo this.

  • 1
    Thanks for the answer. So the more transactions they include, the higher the reward they get? – Sam Markus Oct 31 '17 at 21:17
  • Yes. But because there is a size limit in each block, they can only include so many, so they order them from highest to lowest fees when they can't fit them all in 1 block. – Luke Mlsna Oct 31 '17 at 21:20
  • 1
    Also that means for the scenario where they get a transaction later than someone else, they have to always check whether this transaction was already in a previous block before adding it? – Sam Markus Oct 31 '17 at 21:23
  • That is correct. – Luke Mlsna Oct 31 '17 at 21:27
0

How do ensure that all miners are solving the same PoW problem

It is impossible. And it is not needed.

Now all nodes have competing miners to create a block by receiving all transactions by all nodes

And this is not needed too. You can start mining the block without receiving transactions from the network.

  • 1
    Thanks for the answer. But then I can keep creating blocks and get money for free, right? – Sam Markus Oct 31 '17 at 20:40
  • 1
    (a) coins are not money (b) PoW means that you are "working", working = spending energy, energy is not free. – amaclin Oct 31 '17 at 20:48
  • What's the incentive for anyone to mine blocks that really have transactions in them? Btw, please don't fixate on the difference between coins and money, because they're exchangeable in exchanges. – Sam Markus Oct 31 '17 at 21:15
  • so, apples and oranges are also "money" because they are exchangeble on markets? ok. got it. regarding your question: there are at least two reasons: (a) miner gets additional fees from included txs (b) there is a myth that including txs helps the network and raises coin exchange rate to fiat money – amaclin Oct 31 '17 at 21:26
  • @SamMarkus People put transactions in the blocks they mine for two reasons: 1) The miner gets to keep the transaction fees the transactions they mine pay. 2) Miners have to invest in ASICs to mine bitcoin and their miners would quickly turn into very expensive space heaters if the network wasn't usable for transactions. – David Schwartz May 16 at 23:36
0

Regarding your question at the bottom:

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)?

Inside the block header, there is the field Timestamp (the approximate creation time of this block - seconds from Unix Epoch). Thus, all the solutions must be valid for that particular block. Part of the solution the miners will find, it is to find the transactions and the Nonce that solve the problem. Not all transactions listed before the block be created will be processed. Thus, if a possible solution is published but it not valid for the current block it will not be accepted. Thus, all the miners are working in the PoW.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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