<blockquote>
  <p>I was wondering why the order in which the transactions occur matters when we reconstruct ownership information. Can't we just aggregate all the input and output for each account to calculate how much it owns?</p>
</blockquote>

<p>There are no accounts on Bitcoin, but even if there were accounts, how would you deal with the case where the sum of the transactions exceeds the funds necessary for all of them to be valid?  Transaction order is necessary to deal with that case.  Here's an example:</p>

<ol>
<li>Mallory receives 1 BTC to her account</li>
<li>Transaction A spends 0.5 BTC to Alice from Mallory's account</li>
<li>Transaction B spends 0.5 BTC to Bob from Mallory's account</li>
<li>Transaction C spends 0.5 BTC to Charlie from Mallory's account</li>
</ol>

<p>Assuming negative balances are forbidden, the order of these transactions determines who gets paid.</p>

<p>Because transaction order matters, and for other reasons, Bitcoin doesn't have accounts.  Each time you receive funds, it's paid to an output that's uniquely identifiable.  That is, it may have the same spending condition (e.g. address) as other outputs you've received, but each output can be uniquely identified by the transaction it appears in (txid) and its sequence in the series of outputs in that transaction (output index number, or output vector (vout)).</p>

<p>When you spend funds, you create an input that uses that unique identifier (called an outpoint) to references the output you're spending.  Bitcoin only allows you to spend an output once within a block chain (an ordered list of transactions), so you have to spend all of the value of that output or you lose the value you don't spend.</p>

CC BY-SA 4.0
2018-05-28T11:16:28.757Z
2018-05-28T11:16:28.757Z
David A. Harding
<p>I was wondering why the order in which the transactions occur matters when we reconstruct ownership information. Can't we just aggregate all the input and output for each account to calculate how much it owns?</p>

<transactions><utxo>
Why does the order in which the transactions occur matter when we reconstruct ownership information?
sflow
# Why does the order in which the transactions occur matter when we reconstruct ownership information?

(Asked by: username_0 on 2018-05-28)

I was wondering why the order in which the transactions occur matters when we reconstruct ownership information. Can't we just aggregate all the input and output for each account to calculate how much it owns?

**Tags:** transactions, utxo


---

## 1 answers

### Answer by username_1 on 2018-05-28. Score: 4

> I was wondering why the order in which the transactions occur matters when we reconstruct ownership information. Can't we just aggregate all the input and output for each account to calculate how much it owns?

There are no accounts on Bitcoin, but even if there were accounts, how would you deal with the case where the sum of the transactions exceeds the funds necessary for all of them to be valid? Transaction order is necessary to deal with that case. Here's an example:

1. Mallory receives 1 BTC to her account
2. Transaction A spends 0.5 BTC to Alice from Mallory's account
3. Transaction B spends 0.5 BTC to Bob from Mallory's account
4. Transaction C spends 0.5 BTC to Charlie from Mallory's account

Assuming negative balances are forbidden, the order of these transactions determines who gets paid.

Because transaction order matters, and for other reasons, Bitcoin doesn't have accounts. Each time you receive funds, it's paid to an output that's uniquely identifiable. That is, it may have the same spending condition (e.g. address) as other outputs you've received, but each output can be uniquely identified by the transaction it appears in (txid) and its sequence in the series of outputs in that transaction (output index number, or output vector (vout)).

When you spend funds, you create an input that uses that unique identifier (called an outpoint) to references the output you're spending. Bitcoin only allows you to spend an output once within a block chain (an ordered list of transactions), so you have to spend all of the value of that output or you lose the value you don't spend.


---

