<p>Your question is based on a misconception. The Bitcoin protocol does not operate on addresses, or balances.</p>
<p>Transactions have outputs and inputs. Each outputs creates a &quot;coin&quot;, of a certain value, and with a certain condition under which it can be spent. Every input spends a coin - in its entirety - by referencing that coin explicitly, and proving it is allowed to spend it.</p>
<p>Those spending conditions are often represented for human consumption as addresses, but &quot;address balance&quot; is simply the sum of the values of all coins with a spending condition matching that address, which have not yet been spent.</p>
<p>So how do wallets, and the protocol, determine whether a transaction is valid? Not by looking at its balance, but by checking that the coin referenced in the input hasn't been spent yet, that the transaction contains valid signature(s) for it, and that the sum of the values of the inputs is at least as much as the value of the outputs being created.</p>
<p>What block explorer websites show you is deceiving. They try to represent transactions as reducing the balance of some addresses, and incrementing the balance of others. This isn't what's actually happens. In reality, transactions just melt down and reforge coins.</p>

CC BY-SA 4.0
2021-09-19T02:05:09.557Z
2021-09-19T02:12:15.340Z
2021-09-19T02:12:15.340Z
Pieter Wuille
<p>I was just looking through some of the blocks and I saw a transaction which had 408.1011 BTC split into 3 output address. 18.5468, 230.6512 and 158.9030731.</p>
<p>I then saw the 230.6512 use the transaction id and send it to 2 address. I know it was the 230.6512 only because the output was 9.2293 &amp; 221.420555.</p>
<p>My question is, how can I find out that the address associated with 230.6512 is spent but the other 2 are not?</p>
<p>The reason I'm asking is because if you don't know which private key signed this transaction, then how can you find out how much balance a private key has left to spend?</p>
<p>Edit: Just found <code>vout</code> Looks like this is what I was looking for. Seems that it points to the index of the output used.</p>

<transactions>
How to determine which private key signed a transaction
Trevor
# How to determine which private key signed a transaction

(Asked by: username_0 on 2021-09-19)

I was just looking through some of the blocks and I saw a transaction which had 408.1011 BTC split into 3 output address. 18.5468, 230.6512 and 158.9030731.

I then saw the 230.6512 use the transaction id and send it to 2 address. I know it was the 230.6512 only because the output was 9.2293 & 221.420555.

My question is, how can I find out that the address associated with 230.6512 is spent but the other 2 are not?

The reason I'm asking is because if you don't know which private key signed this transaction, then how can you find out how much balance a private key has left to spend?

Edit: Just found `vout` Looks like this is what I was looking for. Seems that it points to the index of the output used.

**Tags:** transactions


---

## 1 answers

### Answer by username_1 on 2021-09-19. Score: 3 | Accepted answer

Your question is based on a misconception. The Bitcoin protocol does not operate on addresses, or balances.

Transactions have outputs and inputs. Each outputs creates a "coin", of a certain value, and with a certain condition under which it can be spent. Every input spends a coin - in its entirety - by referencing that coin explicitly, and proving it is allowed to spend it.

Those spending conditions are often represented for human consumption as addresses, but "address balance" is simply the sum of the values of all coins with a spending condition matching that address, which have not yet been spent.

So how do wallets, and the protocol, determine whether a transaction is valid? Not by looking at its balance, but by checking that the coin referenced in the input hasn't been spent yet, that the transaction contains valid signature(s) for it, and that the sum of the values of the inputs is at least as much as the value of the outputs being created.

What block explorer websites show you is deceiving. They try to represent transactions as reducing the balance of some addresses, and incrementing the balance of others. This isn't what's actually happens. In reality, transactions just melt down and reforge coins.


---

