3

Isn't it enough to just have the Input Address, Output Address, Amount and Signature for each transaction?

1

We don't refer to previous transactions, but rather to specific outputs of previous transactions. When transactions sign over money to a recipient, they create a uniquely identifiable "Unspent Transaction Output" or UTXO. Transaction inputs in turn spend these "UTXO" to fuel transactions. Since addresses can be reused, addresses alone are insufficient to precisely identify the bitcoins that are being spent.

If you only had "Input Address, Output Address, Amount and Signature for each transaction". This would be trivially broken:
Let's say Alice keeps all her funds in address A1, and pays Bob 0.1BTC in rent to address B1. Bob pays Mallet to fix Alice's heater from B1, using the funds that he received from Alice. When Alice pays Bob next month again from address A1 to address B1, Mallet can replay Bob's transaction to himself in order to get paid again.

| improve this answer | |
  • 1
    I suppose the question then becomes, why do you need to precisely identify the bitcoins being spent? Why isn't it sufficient to ensure only that an address doesn't spend more than it has received? – B T Dec 23 '17 at 23:40
  • 1
    @BT: Because precisely identifying what money you spend makes it much simpler to prevent doublespending. – Murch Dec 23 '17 at 23:45
  • 1
    Could you explain that further? I don't quite see why that's the case. – B T Dec 24 '17 at 8:06
  • 1
    It is possible, e.g. Ethereum with its account-based design doesn't have UTXOs. However, then the order of transactions needs to be tracked and you need sequence ids. While the UTXO-based design is a bit harder to grok, it's much simpler to implement and more versatile for transaction creation. – Murch Dec 24 '17 at 23:14
  • 1
    @BT: Send a high priority transaction with a high fee while a low priority transaction is still unconfirmed. – Murch Dec 25 '17 at 15:47
0

Bitcoin doesn't track account balances like traditional accounting, it only keeps a record of where BTC came from and which address it is sent to. So, your receiving address doesn't technically have a recorded balance, only a calculated balance for all the transactions received on that address. Once you send Bitcoin, the unspent transaction output you reference when sending becomes spent and the calculated balance for that address you originally received on becomes zero.

You may find this video of assistance:
How Bitcoin Works Under the Hood

| improve this answer | |

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.