1

Follow scenario: The balance of my origin address is 1 BTC. I'm transfering 0.1 BTC to a shop where I'm buying some goods, my wallet returns the change to my origin address. Now my origin address has a balance of 0.9 BTC. I buy another 0.1 BTC on an exchange and transfer it to my origin address, which now has again a balance of 1 BTC (as much as it had at the beginning).

As far as I understood a transaction is a block of data containing the transaction's details and a signature generated with my private key. If I redo the first transaction to the shop the data block created will look binary identical (same amount, same origin, same receivers), and also the balance of the origin is high enough.

What hinders someone else to resend my transaction in the blockchain network, or a miner to duplicate my transaction, as soon as the balance has refreshed to a value high enough to fulfill the transaction. I'm still missing a hint what invalidates a transaction after it was confirmed.

If I never use a bitcoin address twice, I would be safe.

I am very grateful for any tip what I might have overlooked!

1

A transaction doesn't just identify a sending address as the source of its funds; it identifies a specific output of a specific previous transaction (by transaction ID and output number), called a txout for short. Once a txout has been used as an input for a new transaction, nodes mark that txout as "spent" and any future transactions that attempt to spend it will be considered invalid. (This means that the funds in the txout have to be completely consumed by the transaction; if that is a larger amount than you wanted to spend, you need a change output. This is the whole reason to have change.)

In particular, this rule will prevent a transaction from being included verbatim in the blockchain a second time. So any attempt to replay an existing transaction would not result in extra funds being sent.

  • Great, thanks. This makes things much clearer now - think I need to dig deeper in how transactions are handled in detail. – Andreas Winter Aug 24 '18 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.