<p>Adding my own answer after doing some research: An address and an output are different things. A transaction may have many inputs and many outputs. Here is a good visualization from bitcoin.org:</p>

<p><a href="https://i.sstatic.net/icpeS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/icpeS.png" alt="enter image description here"></a></p>

<p>A double spend occurs when the same BTC is used to pay two different people. This will never happen on the blockchain because the Bitcoin network guarantees a consistent ledger. But, what about the unconfirmed transactions that live in the miners' mempools? </p>

<p>Some inconsistencies in the mempool may not manifest until they are added or not-added to the blockchain, others we can flag as invalid right away e.g. amount exceeds available funds etc; If unconfirmed transactions were not checked for validity, an attacker could flood the mempool with bogus transactions and cripple the network.</p>

<p>A submitted transaction that has the exact same inputs and outputs as another unconfirmed transaction in the mempool is rejected by the Bitcoin network (even if it was a valid financial transaction). For example, I could send 1 BTC from A to B, and while the transaction is unconfirmed, send another 2 BTC from A to B. As long as A has 3 BTC to cover the transfers, these transactions are consistent, but conservatively rejected by miners. </p>

<p>You can see this yourself with the Electrum wallet using the "Send From" option. Normally, Electrum picks valid inputs for you, but you can override this. Create a transaction specifying the from and to addresses. Then, create another transaction with same from and to (but the amount can differ). If the first transaction is still pending, you'll get the following error:</p>

<p><a href="https://i.sstatic.net/WdtFh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WdtFh.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-03-03T05:32:42.090Z
2016-03-03T05:32:42.090Z
Rick Seeger
<p>Since the amounts are different ($23.75, $23.89, and $24.03), they can't possibly be the same output.</p>

CC BY-SA 3.0
2015-09-11T19:09:12.043Z
2015-09-11T19:09:12.043Z
David Schwartz
<p>Here is an example of multiple transactions in the same block, all spending from the same output. I created these using the Electrum wallet, telling Electrum to spend a little bit of the BTC from the same 1AD9xV6aeQMPMzfv5Nzk8yNDgtyV3LaUkB address each time  </p>

<p>See: <a href="https://blockchain.info/address/1AD9xV6aeQMPMzfv5Nzk8yNDgtyV3LaUkB" rel="nofollow noreferrer">https://blockchain.info/address/1AD9xV6aeQMPMzfv5Nzk8yNDgtyV3LaUkB</a></p>

<p><img src="https://i.sstatic.net/VU1WL.png" alt="Kinda looks like a double spend"></p>

<p>When I try doing a similar thing myself with Python and the Pycoin library, the second transaction gets flagged as a "double spend" when I submit it to blockchain.info/pushtx. The response I get is:</p>

<blockquote>
  <p>An outpoint is already spent in [DBBitcoinTx [txIndex=101360418, getEstimatedBTCSent()=0, isGeneratedBlockReward()=false, getTotalBTCSent()=0, getHash()=1766bb1b732db7b3eef1bea27a572651ee343d79ca6c5b9e866e2f97e8df85aa, getVersion()=1, getSize()=258, toString()=BitcoinTx{hash=1766bb1b732db7b3eef1bea27a572651ee343d79ca6c5b9e866e2f97e8df85aa, version=1, lockTime=0, in=[], out=[]}, getClass()=class piuk.blockchain_db.DBBitcoinTx]] [(101355273, 1)]</p>
</blockquote>

<p>Like in the first example, the total spent by all the transactions never exceeds the total available at that address, so I'm curious why this is considered a "double spend".</p>

<p>How should you structure a series of transactions spending from the same address so that a double spend is not triggered?</p>

CC BY-SA 3.0
2015-09-09T09:20:10.953Z
The three transactions you show spend different outputs.
Nick ODell
CC BY-SA 3.0
2015-09-09T09:21:54.097Z
Blockchain.info is an authority on nothing, their rules are not Bitcoins rules.
Claris
CC BY-SA 3.0
2015-09-09T09:43:34.083Z
*same address* doesn't mean *same output*. It's only a doublespend if it spends the same outputs. Addresses can have more than one output.
Murch
<transactions><blockchain.info><electrum><doublespend><python>
When are multiple transactions spending the same output in the same block considered a double spend?
Rick Seeger
# When are multiple transactions spending the same output in the same block considered a double spend?

(Asked by: username_0 on 2015-09-09)

Here is an example of multiple transactions in the same block, all spending from the same output. I created these using the Electrum wallet, telling Electrum to spend a little bit of the BTC from the same 1AD9xV6aeQMPMzfv5Nzk8yNDgtyV3LaUkB address each time

See: <https://blockchain.info/address/1AD9xV6aeQMPMzfv5Nzk8yNDgtyV3LaUkB>

![Kinda looks like a double spend](https://i.sstatic.net/VU1WL.png)

When I try doing a similar thing myself with Python and the Pycoin library, the second transaction gets flagged as a "double spend" when I submit it to blockchain.info/pushtx. The response I get is:

> An outpoint is already spent in [DBBitcoinTx [txIndex=101360418, getEstimatedBTCSent()=0, isGeneratedBlockReward()=false, getTotalBTCSent()=0, getHash()=1766bb1b732db7b3eef1bea27a572651ee343d79ca6c5b9e866e2f97e8df85aa, getVersion()=1, getSize()=258, toString()=BitcoinTx{hash=1766bb1b732db7b3eef1bea27a572651ee343d79ca6c5b9e866e2f97e8df85aa, version=1, lockTime=0, in=[], out=[]}, getClass()=class piuk.blockchain\_db.DBBitcoinTx]] [(101355273, 1)]

Like in the first example, the total spent by all the transactions never exceeds the total available at that address, so I'm curious why this is considered a "double spend".

How should you structure a series of transactions spending from the same address so that a double spend is not triggered?

**Tags:** transactions, blockchain.info, electrum, doublespend, python

> **Comments:**
> **username_1**: The three transactions you show spend different outputs.  
> **username_2**: Blockchain.info is an authority on nothing, their rules are not Bitcoins rules.  
> **username_3**: *same address* doesn't mean *same output*. It's only a doublespend if it spends the same outputs. Addresses can have more than one output.  

---

## 2 answers

### Answer by username_0 on 2016-03-03. Score: 2

Adding my own answer after doing some research: An address and an output are different things. A transaction may have many inputs and many outputs. Here is a good visualization from bitcoin.org:

[![enter image description here](https://i.sstatic.net/icpeS.png)](https://i.sstatic.net/icpeS.png)

A double spend occurs when the same BTC is used to pay two different people. This will never happen on the blockchain because the Bitcoin network guarantees a consistent ledger. But, what about the unconfirmed transactions that live in the miners' mempools?

Some inconsistencies in the mempool may not manifest until they are added or not-added to the blockchain, others we can flag as invalid right away e.g. amount exceeds available funds etc; If unconfirmed transactions were not checked for validity, an attacker could flood the mempool with bogus transactions and cripple the network.

A submitted transaction that has the exact same inputs and outputs as another unconfirmed transaction in the mempool is rejected by the Bitcoin network (even if it was a valid financial transaction). For example, I could send 1 BTC from A to B, and while the transaction is unconfirmed, send another 2 BTC from A to B. As long as A has 3 BTC to cover the transfers, these transactions are consistent, but conservatively rejected by miners.

You can see this yourself with the Electrum wallet using the "Send From" option. Normally, Electrum picks valid inputs for you, but you can override this. Create a transaction specifying the from and to addresses. Then, create another transaction with same from and to (but the amount can differ). If the first transaction is still pending, you'll get the following error:

[![enter image description here](https://i.sstatic.net/WdtFh.png)](https://i.sstatic.net/WdtFh.png)


---

### Answer by username_4 on 2015-09-11. Score: 1

Since the amounts are different ($23.75, $23.89, and $24.03), they can't possibly be the same output.


---

