<p>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.</p>

<p>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.</p>

CC BY-SA 3.0
2017-10-31T21:17:51.440Z
Thanks for the answer. So the more transactions they include, the higher the reward they get?
Sam Markus
CC BY-SA 3.0
2017-10-31T21:20:11.207Z
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
CC BY-SA 3.0
2017-10-31T21:23:12.710Z
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
CC BY-SA 3.0
2017-10-31T21:27:05.397Z
That is correct.
Luke Mlsna
CC BY-SA 3.0
2017-10-31T21:12:13.780Z
2017-10-31T21:12:13.780Z
Luke Mlsna
<p>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.</p>
<p>Previous answers eluded to it, but, simpletons like me look at &quot;So what does this really mean&quot;.  It means, when you get paid in BitCoins, you are not &quot;PAID&quot; 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).</p>
<p>This means, instantaneous transactions using BitCoin are &quot;RISK&quot;.  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 &quot;confirm&quot; a transaction is on the valid chain &quot;6 blocks deep&quot;.</p>
<p>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 &quot;payment&quot; is most likely confirmed.</p>

CC BY-SA 4.0
2021-02-19T23:22:31.617Z
2021-02-19T23:22:31.617Z
user115978
<blockquote>
<p>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?</p>
</blockquote>
<p>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.</p>
<blockquote>
<p>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).</p>
</blockquote>
<p>That makes no sense for two reasons:</p>
<ol>
<li><p>Ignoring transactions won't save you any time or anything. You are <em>always</em> 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.</p>
</li>
<li><p>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 <em>definitely</em> won't repeat work -- that's the point of coordinating.</p>
</li>
</ol>
<blockquote>
<p>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)?</p>
</blockquote>
<p>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 <em>them</em>. And if they are coordinating, they're carefully assigning different work to the two so that effort isn't wasted.</p>

CC BY-SA 4.0
2021-02-27T11:08:16.093Z
2021-02-27T11:08:16.093Z
David Schwartz
<p>Regarding your question at the bottom:</p>

<blockquote>
  <p>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)?</p>
</blockquote>

<p>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.</p>

CC BY-SA 3.0
2017-11-01T09:49:03.220Z
2017-11-01T09:49:03.220Z
JRbarros
<blockquote>
  <p>How do ensure that all miners are solving the same PoW problem</p>
</blockquote>

<p>It is impossible. And it is not needed.</p>

<blockquote>
  <p>Now all nodes have competing miners to create a block 
  by receiving all transactions by all nodes</p>
</blockquote>

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

CC BY-SA 3.0
2017-10-31T20:40:20.800Z
Thanks for the answer. But then I can keep creating blocks and get money for free, right?
Sam Markus
CC BY-SA 3.0
2017-10-31T20:48:45.530Z
(a) coins are not money (b) PoW means that you are "working", working = spending energy, energy is not free.
amaclin
CC BY-SA 3.0
2017-10-31T21:15:04.760Z
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
CC BY-SA 3.0
2017-10-31T21:26:21.917Z
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
CC BY-SA 4.0
2019-05-16T23:36:22.000Z
@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
CC BY-SA 3.0
2017-10-31T19:30:42.363Z
2017-10-31T19:30:42.363Z
amaclin
<p>In the book "Mastering the Blockchain" by Imran Bashir, it says that a transaction's life cycle is the following:</p>

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

<p>My question:</p>

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

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

<transactions><bitcoin-core><block><mining-theory><proof-of-work>
After sending/flooding transactions, how do we know that a specific transaction is on all nodes?
Sam Markus
# After sending/flooding transactions, how do we know that a specific transaction is on all nodes?

(Asked by: username_0 on 2017-10-31)

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

**Tags:** transactions, bitcoin-core, block, mining-theory, proof-of-work


---

## 5 answers

### Answer by username_1 on 2017-10-31. Score: 0 | Accepted answer

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.

> **Comments:**
> **username_0**: Thanks for the answer. So the more transactions they include, the higher the reward they get?  
> **username_1**: 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.  
> **username_0**: 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?  
> **username_1**: That is correct.  

---

### Answer by username_2 on 2021-02-19. Score: 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.


---

### Answer by username_3 on 2021-02-27. Score: 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.


---

### Answer by username_4 on 2017-11-01. Score: 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.


---

### Answer by username_5 on 2017-10-31. Score: 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.

> **Comments:**
> **username_0**: Thanks for the answer. But then I can keep creating blocks and get money for free, right?  
> **username_5**: (a) coins are not money (b) PoW means that you are "working", working = spending energy, energy is not free.  
> **username_0**: 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.  
> **username_5**: 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  
> **username_3**: @username_0 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.  

---

