<p>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.</p>

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

CC BY-SA 3.0
2017-12-23T23:40:54.587Z
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
CC BY-SA 3.0
2017-12-23T23:45:18.710Z
@BT: Because precisely identifying what money you spend makes it much simpler to prevent doublespending.
Murch
CC BY-SA 3.0
2017-12-24T08:06:14.817Z
Could you explain that further? I don't quite see why that's the case.
B T
CC BY-SA 3.0
2017-12-24T17:18:48.353Z
@Murch So you are saying that it isn't possible to prevent double spending without having previous transaction outputs as a reference?
Keyvan Kambakhsh
CC BY-SA 3.0
2017-12-24T23:14:37.300Z
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
CC BY-SA 3.0
2017-12-25T10:37:30.910Z
@Murch Re versatility: what's an example of something you can do with a UTXO design that you can't do with an account-based design?
B T
CC BY-SA 3.0
2017-12-25T15:47:51.813Z
@BT: Send a high priority transaction with a high fee while a low priority transaction is still unconfirmed.
Murch
CC BY-SA 3.0
2017-12-23T21:43:17.853Z
2018-04-20T22:58:58.807Z
2018-04-20T22:58:58.807Z
Murch
<p>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.</p>

<p>You may find this video of assistance:<br>
<a href="https://youtu.be/Lx9zgZCMqXE" rel="nofollow noreferrer">How Bitcoin Works Under the Hood</a></p>

CC BY-SA 3.0
2018-01-23T12:40:51.257Z
2018-01-23T12:40:51.257Z
Willtech
<p>Isn't it enough to just have the Input Address, Output Address, Amount and Signature for each transaction?</p>

<utxo><transaction-input><replay-attack>
Why do we refer to previous transactions in each transaction?
Keyvan Kambakhsh
# Why do we refer to previous transactions in each transaction?

(Asked by: username_0 on 2017-12-23)

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

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


---

## 2 answers

### Answer by username_1 on 2017-12-23. Score: 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.

> **Comments:**
> **username_2**: 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?  
> **username_1**: @BT: Because precisely identifying what money you spend makes it much simpler to prevent doublespending.  
> **username_2**: Could you explain that further? I don't quite see why that's the case.  
> **username_0**: @username_1 So you are saying that it isn't possible to prevent double spending without having previous transaction outputs as a reference?  
> **username_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.  
> **username_2**: @username_1 Re versatility: what's an example of something you can do with a UTXO design that you can't do with an account-based design?  
> **username_1**: @BT: Send a high priority transaction with a high fee while a low priority transaction is still unconfirmed.  

---

### Answer by username_3 on 2018-01-23. Score: 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](https://youtu.be/Lx9zgZCMqXE)


---

