2

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

Murch
  • 75,206
  • 34
  • 186
  • 622
Benichon
  • 23
  • 4

1 Answers1

2

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.

Murch
  • 75,206
  • 34
  • 186
  • 622
meshcollider
  • 11,815
  • 4
  • 25
  • 53
  • 1
    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 Jul 04 '17 at 16:46
  • @Benichon: https://bitcoin.stackexchange.com/q/736/5406 – Murch Jul 09 '17 at 02:08