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.

4
  • 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
1

From a novice, what it means that if someone who isn't bitcoin savvy accepted bitcoin on the deprecated block and gave that person something of value, that person is out of luck, you just lost that item of value.

Previous answers eluded to it, but, simpletons like me look at "So what does this really mean". It means, when you get paid in BitCoins, you are not "PAID" until that transaction appears in at least 6 blocks to that chain, since that chain could be voted invalid anytime before that 6th block is reached (It can still be called invalid after that but highly unlikely).

This means, instantaneous transactions using BitCoin are "RISK". If I accept bitcoin at my restaurant, it is possible that the chain in which I got paid could be voted invalid, thus, I never received actual payment. I think the time is currently 10 minutes to "confirm" a transaction is on the valid chain "6 blocks deep".

A person could gamble and spend money twice, the money doesn't actually get spent twice, but a novice person could be taken advantage if they don't understand how things work. In short, don't give up anything of value until the chain gets at least 6 blocks deep, then your "payment" is most likely confirmed.

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.

5
  • 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 '19 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.

0

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?

Why should we care? He can include whatever transactions he wants, it's his block. If he ignores lucrative transactions, he'll lose money because he won't make as much in fees as he could. But other miners will soon get them.

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

That makes no sense for two reasons:

  1. Ignoring transactions won't save you any time or anything. You are always mining. Why would you wait for transactions that might or might not come in and, if you did, when would you stop waiting? In practice, you always try to include the most profitable transactions you know and never wait for anything because that's how you make the most money.

  2. Even if two miners have the same computational power, they are trying to solve different problems. So which finds a solution first is going to be effectively random. If they aren't coordinating, then miner A is trying to find a solution that pays miner A while miner B is trying to find a solution that pays miner B, so different problems. If they are coordinated, then they definitely won't repeat work -- that's the point of coordinating.

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

They definitely aren't. Again, if they aren't coordinating, then each one is trying to solve the problem of mining a block that pays them. And if they are coordinating, they're carefully assigning different work to the two so that effort isn't wasted.

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.