<blockquote>
  <p><strong>Can somebody take the transaction tx0 I signed and publish it in order to spend the new coins with the old transaction?</strong></p>
</blockquote>

<p>No.</p>

<p>Firstly, the transaction inputs are already known to have been used. Any node examining the block will know that the rerun transaction has invalid inputs.</p>

<p>Secondly I expect (but haven't checked) the inputs to the signature include both addresses. This prevents the signature being misused in the way you suggest. (See Murch's clarification in comment below)</p>

<p>It may help (if not you, some other readers) to remember that bitcoins don't exist outside or inside the blockchain. The only thing that exists are transaction inputs and outputs. You can't use a signed transaction with inputs A,B and C to use inputs D and E. The signature prevents you altering the signed contents without invalidating the signature.</p>

<blockquote>
  <p><strong>how is it that address reuse is not directly forbidden? if not, can you detail why?</strong></p>
</blockquote>

<p>Addresses can be reused. The most obvious problem is one of privacy. If you give someone an address so they can buy $0.01 of tent-pegs from you, they can then see on the blockchain that you also received $300,000,000 recently to that address and go buy a big hammer and come to visit you at 3 a.m.</p>

CC BY-SA 4.0
2018-07-17T22:29:58.280Z
Small note: privacy is not the *only* concern, though perhaps it is the most pertinent. Having multiple signatures from the same privkey could potentially weaken the security assumptions of asymmetric key cryptography— though no current attacks are currently known, it is not impossible that one will be discovered in the future. This is a small worry that could be fixed if needed, but worth mentioning.
chytrik
CC BY-SA 4.0
2018-08-02T11:09:56.737Z
Do note that there is a small edge case, where if a transaction is signed with `SIGHASH_SINGLE`, but the vin given is outside the bounds of the transaction, that signature is valid for any transaction output to that address, past, present, or future!
Raghav Sood
CC BY-SA 4.0
2018-08-02T17:21:30.343Z
It may help to clarify that the utxo is identified uniquely via the outpoint. Strictly speaking the signature doesn't commit to the address of the input, but only fulfills the corresponding output script the funds were locked to. In the case of P2PKH this happens to reference the address to identify the intended spender. ;)
Murch
CC BY-SA 4.0
2018-07-17T10:52:03.720Z
2018-08-02T21:07:49.160Z
2018-08-02T21:07:49.160Z
RedGrittyBrick
<p>For this you should take a look at a system called <a href="https://en.wikipedia.org/wiki/Unspent_transaction_output" rel="nofollow noreferrer">"unspend transaction outputs"</a> (utxo).
This system works as follows:</p>

<p>Every transaction consists of one or more inputs and one or more outputs. The input specifies, where the money came from by referencing a previous output. And the output describes who and/or how the money can be spend.</p>

<p>So when you sent the coins in tx0, you spent the output, in which you received the money in the first place. As this output is now spent, it cannot be referenced again. And following from that, your previously used tx0 which was signed by you cannot be used again. It would be invalid because it tries to spend an already spent output.
For the reasons why you shouldn't reuse addresses, see <a href="https://en.bitcoin.it/wiki/Address_reuse" rel="nofollow noreferrer">this</a></p>

CC BY-SA 4.0
2018-07-17T09:59:20.600Z
2018-07-17T09:59:20.600Z
noobWithAComputer
<p>I was wondering, if I used an address adr0 to spend some coins in a transaction tx0 that give the coins to a different address adr1, and eventually, after some time, I receive some (completely unrelated) coins to the same address adr0. Can somebody take the transaction tx0 I signed and publish it in order to spend the new coins with the old transaction? (after all, they belong to the same address, and I already signed and gave a transaction that spends coins from this address).</p>

<p>If so, how is it that address reuse is not directly forbidden?
if not, can you detail why?</p>

<utxo><transaction-input><address-reuse><replay-attack>
If I reuse the same address can a previously used transaction be reused?
ranchalp
# If I reuse the same address can a previously used transaction be reused?

(Asked by: username_0 on 2018-07-17)

I was wondering, if I used an address adr0 to spend some coins in a transaction tx0 that give the coins to a different address adr1, and eventually, after some time, I receive some (completely unrelated) coins to the same address adr0. Can somebody take the transaction tx0 I signed and publish it in order to spend the new coins with the old transaction? (after all, they belong to the same address, and I already signed and gave a transaction that spends coins from this address).

If so, how is it that address reuse is not directly forbidden?
if not, can you detail why?

**Tags:** utxo, transaction-input, address-reuse, replay-attack


---

## 2 answers

### Answer by username_1 on 2018-07-17. Score: 5

> **Can somebody take the transaction tx0 I signed and publish it in order to spend the new coins with the old transaction?**

No.

Firstly, the transaction inputs are already known to have been used. Any node examining the block will know that the rerun transaction has invalid inputs.

Secondly I expect (but haven't checked) the inputs to the signature include both addresses. This prevents the signature being misused in the way you suggest. (See username_4's clarification in comment below)

It may help (if not you, some other readers) to remember that bitcoins don't exist outside or inside the blockchain. The only thing that exists are transaction inputs and outputs. You can't use a signed transaction with inputs A,B and C to use inputs D and E. The signature prevents you altering the signed contents without invalidating the signature.

> **how is it that address reuse is not directly forbidden? if not, can you detail why?**

Addresses can be reused. The most obvious problem is one of privacy. If you give someone an address so they can buy $0.01 of tent-pegs from you, they can then see on the blockchain that you also received $300,000,000 recently to that address and go buy a big hammer and come to visit you at 3 a.m.

> **Comments:**
> **username_2**: Small note: privacy is not the *only* concern, though perhaps it is the most pertinent. Having multiple signatures from the same privkey could potentially weaken the security assumptions of asymmetric key cryptography— though no current attacks are currently known, it is not impossible that one will be discovered in the future. This is a small worry that could be fixed if needed, but worth mentioning.  
> **username_3**: Do note that there is a small edge case, where if a transaction is signed with `SIGHASH_SINGLE`, but the vin given is outside the bounds of the transaction, that signature is valid for any transaction output to that address, past, present, or future!  
> **username_4**: It may help to clarify that the utxo is identified uniquely via the outpoint. Strictly speaking the signature doesn't commit to the address of the input, but only fulfills the corresponding output script the funds were locked to. In the case of P2PKH this happens to reference the address to identify the intended spender. ;)  

---

### Answer by username_5 on 2018-07-17. Score: 0

For this you should take a look at a system called ["unspend transaction outputs"](https://en.wikipedia.org/wiki/Unspent_transaction_output) (utxo).
This system works as follows:

Every transaction consists of one or more inputs and one or more outputs. The input specifies, where the money came from by referencing a previous output. And the output describes who and/or how the money can be spend.

So when you sent the coins in tx0, you spent the output, in which you received the money in the first place. As this output is now spent, it cannot be referenced again. And following from that, your previously used tx0 which was signed by you cannot be used again. It would be invalid because it tries to spend an already spent output.
For the reasons why you shouldn't reuse addresses, see [this](https://en.bitcoin.it/wiki/Address_reuse)


---

