<p>When Alice creates a transaction of 1 BTC to Bob, she is giving him a <em>specific</em> bitcoin, by using an unspent transaction output that she has the key to. The blockchain tracks the flow of coins from transaction to transaction, it does not have 'balances'. So when Alice makes a new transaction, she provides an <em>input</em> to the transaction of at least 1 BTC, and puts Bob's address in an <em>output</em>. This transaction then is mined into a block, and Bob can spend the output he holds the key to, in another transaction, and so forth. But after Alice broadcasts that first transaction, she has spent the outputs she used in it, she can not use them again in another transaction (double spend). Thus if Bob tried to 'replay' that transaction, he would just be resending the same thing as before, nothing would change because the network would already have seen and accepted the transaction and Bob would already 'have' the Bitcoin Alice sent him. In fact, no other node would be interested in the transaction as they can see that it is already written to the blockchain.</p>

CC BY-SA 3.0
2017-07-04T16:46:18.067Z
Hello ! Thank you so much for your answer. The logical next question is : how do you split your existing "specific" bitcoin (ex : 1 BTC) to send only a part of it (ex : only 0.5 BTC). I found my answer here : https://www.cryptocoinsnews.com/bitcoin-transaction-really-works/ actually you spend everything and create a new output for yourself with the remaining balance.
Benichon
CC BY-SA 3.0
2017-07-09T02:08:00.743Z
@Benichon: https://bitcoin.stackexchange.com/q/736/5406
Murch
CC BY-SA 3.0
2017-07-04T11:39:25.447Z
2017-07-09T02:07:14.013Z
2017-07-09T02:07:14.013Z
meshcollider
<p>Let's say that Alice sends 1 BTC to Bob.
We have then a signature of (Alice sends 1 BTC to Bob) with Alice private key.
What prevents Bob from duplicating this exact same transaction and sending it to the network to get another BTC (or many more), given that he already has Alice's signature of (Alice sends 1 BTC to Bob) ?</p>

<p>Thanks a lot :)</p>

<transactions><security><signature><replay-attack>
How does the transaction signature prevent transaction duplication?
Benichon
# How does the transaction signature prevent transaction duplication?

(Asked by: username_0 on 2017-07-04)

Let's say that Alice sends 1 BTC to Bob.
We have then a signature of (Alice sends 1 BTC to Bob) with Alice private key.
What prevents Bob from duplicating this exact same transaction and sending it to the network to get another BTC (or many more), given that he already has Alice's signature of (Alice sends 1 BTC to Bob) ?

Thanks a lot :)

**Tags:** transactions, security, signature, replay-attack


---

## 1 answers

### Answer by username_1 on 2017-07-04. Score: 2 | Accepted answer

When Alice creates a transaction of 1 BTC to Bob, she is giving him a *specific* bitcoin, by using an unspent transaction output that she has the key to. The blockchain tracks the flow of coins from transaction to transaction, it does not have 'balances'. So when Alice makes a new transaction, she provides an *input* to the transaction of at least 1 BTC, and puts Bob's address in an *output*. This transaction then is mined into a block, and Bob can spend the output he holds the key to, in another transaction, and so forth. But after Alice broadcasts that first transaction, she has spent the outputs she used in it, she can not use them again in another transaction (double spend). Thus if Bob tried to 'replay' that transaction, he would just be resending the same thing as before, nothing would change because the network would already have seen and accepted the transaction and Bob would already 'have' the Bitcoin Alice sent him. In fact, no other node would be interested in the transaction as they can see that it is already written to the blockchain.

> **Comments:**
> **username_0**: Hello ! Thank you so much for your answer. The logical next question is : how do you split your existing "specific" bitcoin (ex : 1 BTC) to send only a part of it (ex : only 0.5 BTC). I found my answer here : https://www.cryptocoinsnews.com/bitcoin-transaction-really-works/ actually you spend everything and create a new output for yourself with the remaining balance.  
> **username_2**: @username_0: https://bitcoin.stackexchange.com/q/736/5406  

---

