<blockquote>
  <p>So (as I understand) when I want to buy something I send my address encrypted with private key to recipient, he decrypts it with public key &amp; then checks the blockchain to determine if I can afford the transaction</p>
</blockquote>

<p>Not quite the way it works. You just send the address, which is essentially the public key, to the person who is trying to do the paying. Given the address (more technically, references to times that address has been paid to on the blockchain before), anyone (not just the payee/payer) can verify that the transaction has the funds to spend. </p>

<p>And rather than sending the private key to show that you are the owner of the coins, you send a <a href="https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm" rel="nofollow">Digital Signature</a>, which you need the private key to generate.</p>

<p>Your wallet reports your balance by looking at the list of times that you have been paid to before, which you have also not spent. This will be across many addresses. The network doesn't know which payments on the blockchain are yours, you have to reference a few of them when you want to spend funds, and prove you own the key to them with a digital signature.</p>

CC BY-SA 3.0
2016-03-09T18:33:32.870Z
Check out the [original paper](https://bitcoin.org/bitcoin.pdf), it explains how the whole referencing-previous-payments-to-pay works.
morsecoder
CC BY-SA 3.0
2016-03-09T18:35:43.280Z
Indeed. To clarify further: there is no encryption involved anywhere, and it's the receiver that uses a new key for every requested transaction (not the sender, except for his own change).
Pieter Wuille
CC BY-SA 3.0
2016-03-09T18:38:54.400Z
@PieterWuille btw, thanks for spending time answering Qs on B.SE, I've learned a lot from you, as I'm sure many others have, it's nice to have a core dev so involved.
morsecoder
CC BY-SA 3.0
2016-03-09T19:44:19.673Z
@StephenM347 Reading your answer I was confused at first. I was asking about situation, when **I** am the **buyer**, but your answer assumes, that I'm the **seller**. But now it makes sense: as buyer I don't need to send address to anyone - instead I need to receive address to which I need to pay - right? And so the address needs change after receiving bitcoins, not after sending them (as PieterWuille said). Still, blockchain needs to be checked by receiver to verify my funds. Why do I have to reference few of my payments, instead of all of them? (Trying to read paper too but, its though...)
Sushi271
CC BY-SA 3.0
2016-03-09T20:07:12.733Z
@StephenM347 w8 I think I just got an epiphany. Is it that every receiving address has its own balance? As in: by analyzing blockchain information about payment made **to** that address and then all payments made **from** that address I can determine how much money this address _contains_? And when I buy something, if it's not enough, wallet software sends more addresses, so that in total they _contain_ enough money to cover the expense?
Sushi271
CC BY-SA 3.0
2016-03-09T20:22:03.560Z
@Sushi271, yeah, sorry that I mixed up buyer and seller vantage point, seems like you worked through it though. Address balances isn't exactly how it works under the hood, but that's a good mental model, and the mental model for how most people think about addresses. If you want to go a layer deeper, each time you pay to an address it creates whats called a UTXO (unspent transaction output). There might be many UTXOs per address, or if an address hasn't been used yet there won't be any. Blockchain clients actually keep track of UTXOs not addresses, and to send coins you references UTXOs.
morsecoder
CC BY-SA 3.0
2016-03-09T18:32:08.963Z
2016-03-09T18:32:08.963Z
morsecoder
<p>I know there are quite similar questions, but none have addressed my issue. Let's say I use Electrum wallet, that generates addresses &amp; keypairs from seed. So for every next transaction I use different private key, public key &amp; address. So (as I understand) when I want to buy something I send my address encrypted with private key to recipient, he decrypts it with public key &amp; then checks the blockchain to determine if I can afford the transaction. But since I use different address for every transaction, how is that possible? I don't see way to connect current transaction to all that came before.</p>

<transactions><blockchain><address><balance>
When I pay, how is my balance checked, if I use different address every time?
Sushi271
# When I pay, how is my balance checked, if I use different address every time?

(Asked by: username_0 on 2016-03-09)

I know there are quite similar questions, but none have addressed my issue. Let's say I use Electrum wallet, that generates addresses & keypairs from seed. So for every next transaction I use different private key, public key & address. So (as I understand) when I want to buy something I send my address encrypted with private key to recipient, he decrypts it with public key & then checks the blockchain to determine if I can afford the transaction. But since I use different address for every transaction, how is that possible? I don't see way to connect current transaction to all that came before.

**Tags:** transactions, blockchain, address, balance


---

## 1 answers

### Answer by username_1 on 2016-03-09. Score: 1 | Accepted answer

> So (as I understand) when I want to buy something I send my address encrypted with private key to recipient, he decrypts it with public key & then checks the blockchain to determine if I can afford the transaction

Not quite the way it works. You just send the address, which is essentially the public key, to the person who is trying to do the paying. Given the address (more technically, references to times that address has been paid to on the blockchain before), anyone (not just the payee/payer) can verify that the transaction has the funds to spend.

And rather than sending the private key to show that you are the owner of the coins, you send a [Digital Signature](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm), which you need the private key to generate.

Your wallet reports your balance by looking at the list of times that you have been paid to before, which you have also not spent. This will be across many addresses. The network doesn't know which payments on the blockchain are yours, you have to reference a few of them when you want to spend funds, and prove you own the key to them with a digital signature.

> **Comments:**
> **username_1**: Check out the [original paper](https://bitcoin.org/bitcoin.pdf), it explains how the whole referencing-previous-payments-to-pay works.  
> **username_2**: Indeed. To clarify further: there is no encryption involved anywhere, and it's the receiver that uses a new key for every requested transaction (not the sender, except for his own change).  
> **username_1**: @username_2 btw, thanks for spending time answering Qs on B.SE, I've learned a lot from you, as I'm sure many others have, it's nice to have a core dev so involved.  
> **username_0**: @StephenM347 Reading your answer I was confused at first. I was asking about situation, when **I** am the **buyer**, but your answer assumes, that I'm the **seller**. But now it makes sense: as buyer I don't need to send address to anyone - instead I need to receive address to which I need to pay - right? And so the address needs change after receiving bitcoins, not after sending them (as username_2 said). Still, blockchain needs to be checked by receiver to verify my funds. Why do I have to reference few of my payments, instead of all of them? (Trying to read paper too but, its though...)  
> **username_0**: @StephenM347 w8 I think I just got an epiphany. Is it that every receiving address has its own balance? As in: by analyzing blockchain information about payment made **to** that address and then all payments made **from** that address I can determine how much money this address _contains_? And when I buy something, if it's not enough, wallet software sends more addresses, so that in total they _contain_ enough money to cover the expense?  
> **username_1**: @username_0, yeah, sorry that I mixed up buyer and seller vantage point, seems like you worked through it though. Address balances isn't exactly how it works under the hood, but that's a good mental model, and the mental model for how most people think about addresses. If you want to go a layer deeper, each time you pay to an address it creates whats called a UTXO (unspent transaction output). There might be many UTXOs per address, or if an address hasn't been used yet there won't be any. Blockchain clients actually keep track of UTXOs not addresses, and to send coins you references UTXOs.  

---

