<blockquote>
<p>according to my understanding bitcoin network solve this issue by adding all the transactions that happened at the same time into one block of the block-chain.</p>
</blockquote>
<p>This is not true.</p>
<h2>Same time</h2>
<p>You should remember that the Bitcoin network doesn't really try to keep accurate time. Blocks are not always in sequence by timestamp in the block. So long as they do not seem to be more than about 2 hours wrong, it will be accepted. So the notion of &quot;happened at the same time&quot; is ill-defined.</p>
<p>There is a limit to the size of a block, so it would often not be possible anyway.</p>
<h2>Choosing transactions</h2>
<p>Miners choose transactions for incorporation into a block. They choose transactions from a pool of unconfirmed transactions they have received. This pool is called the mempool.</p>
<p>Which transactions miners choose is entirely up to them. They could choose on the basis of highest fees that the transactions will pay to the miner. They might choose on any other basis that their operator feels makes sense for them.</p>
<p>What might be causing some confusion is that if an unconfirmed transaction B spends the output of another unconfirmed transaction A, I believe miners will find it necessary to include A in any block that contains B.</p>
<h2>Double spending</h2>
<p>A miner cannot include in one block two transactions that spend the same input. Such a block would be rejected by everyone else.</p>
<p>If a miner includes in a block a transaction that spends an output already spent by a transaction in an earlier block, the later block will be rejected by other nodes. So miners don't do this if they can avoid it.</p>

CC BY-SA 4.0
2020-11-29T18:00:58.140Z
2020-11-29T18:13:25.353Z
2020-11-29T18:13:25.353Z
RedGrittyBrick
<p>According to my research, I understand if person A sends 2 <strong>BTC</strong> to person B and at the same time person A sends the same <strong>input</strong> to himself before the input is considered as spent. So, now there will be a different route for each transaction while <strong>broadcasting</strong> (where nodes will check <strong>transaction chain</strong> to verify the <strong>history of ownership</strong> by the <strong>previous transactions</strong>) in the bitcoin network and might be the wrong one got confirmed first. Obviously, the second one will be rejected and the network will give contradiction while <strong>consensus</strong>. So, according to my understanding bitcoin network solve this issue by adding all the transactions that happened at the same time into one <strong>block of the block-chain</strong>. Please let me know if I am wrong. I will appreciate your guidance. Thanks</p>
<p>So, <strong>My question</strong> is: How the <strong>bitcoin network</strong> solves this issue by adding all the transactions that happened at the same time into one block?</p>

<blockchain><doublespend><confirmations>
How the bitcoin network solves the double-spending problem by adding all the transactions that happened at the same time into one block
Haider Yaqoob
# How the bitcoin network solves the double-spending problem by adding all the transactions that happened at the same time into one block

(Asked by: username_0 on 2020-11-29)

According to my research, I understand if person A sends 2 **BTC** to person B and at the same time person A sends the same **input** to himself before the input is considered as spent. So, now there will be a different route for each transaction while **broadcasting** (where nodes will check **transaction chain** to verify the **history of ownership** by the **previous transactions**) in the bitcoin network and might be the wrong one got confirmed first. Obviously, the second one will be rejected and the network will give contradiction while **consensus**. So, according to my understanding bitcoin network solve this issue by adding all the transactions that happened at the same time into one **block of the block-chain**. Please let me know if I am wrong. I will appreciate your guidance. Thanks

So, **My question** is: How the **bitcoin network** solves this issue by adding all the transactions that happened at the same time into one block?

**Tags:** blockchain, doublespend, confirmations


---

## 1 answers

### Answer by username_1 on 2020-11-29. Score: 2 | Accepted answer

> according to my understanding bitcoin network solve this issue by adding all the transactions that happened at the same time into one block of the block-chain.

This is not true.

## Same time

You should remember that the Bitcoin network doesn't really try to keep accurate time. Blocks are not always in sequence by timestamp in the block. So long as they do not seem to be more than about 2 hours wrong, it will be accepted. So the notion of "happened at the same time" is ill-defined.

There is a limit to the size of a block, so it would often not be possible anyway.

## Choosing transactions

Miners choose transactions for incorporation into a block. They choose transactions from a pool of unconfirmed transactions they have received. This pool is called the mempool.

Which transactions miners choose is entirely up to them. They could choose on the basis of highest fees that the transactions will pay to the miner. They might choose on any other basis that their operator feels makes sense for them.

What might be causing some confusion is that if an unconfirmed transaction B spends the output of another unconfirmed transaction A, I believe miners will find it necessary to include A in any block that contains B.

## Double spending

A miner cannot include in one block two transactions that spend the same input. Such a block would be rejected by everyone else.

If a miner includes in a block a transaction that spends an output already spent by a transaction in an earlier block, the later block will be rejected by other nodes. So miners don't do this if they can avoid it.


---

