<p>Bitcoin does not have the concept of account balance. It works on consuming the bitcoins that you have earnt in prior transactions. However, you cannot consume partial amounts. So according to your example, when you are creating a new transaction, in the inputs you will reference the transaction where you earnt the 1 BTC (it may be a single transaction where you got your 1 BTC, or you might reference multiple transactions whose values all add up to 1 BTC) and consume it entirely. Now in the outputs, you will send 0.1 BTC to address A and say 0.895 BTC to your change address. The difference of 0.005 BTC will go as mining fees. </p>

CC BY-SA 4.0
2019-04-17T19:39:52.003Z
so every time I'm sending a bitcoin, I'm sending my entire balance and receiving balance - payment - mining fee back to my change address? What if I don't have a whole bitcoin? What if I only have 0.001 BTC?
Carol Ward
CC BY-SA 4.0
2019-04-17T19:48:15.990Z
@CarolWard you have to reference multiple transactions in the inputs where you earned your BTCs and the values from those transaction should that add up to an amount that is more that want to intend to pay to a person. the difference (after removing mining fees) is what would go to your change address.
Ugam Kamat
CC BY-SA 4.0
2019-04-17T20:05:05.443Z
ok. I think I'm starting to understand. So when I send 0.001 BTC, the wallet references enough transactions together that equals 0.001 BTC or greater. If it's exactly 0.001 BTC, then no change needed. If it's 0.0017 BTC, then it pays 0.001 BTC to the recipient, pays mining fee (let's say 0.0003 BTC), and send the change of 0.0004 back to my change address. Is that right?
Carol Ward
CC BY-SA 4.0
2019-04-17T20:05:54.737Z
@CarolWard that is correct
chytrik
CC BY-SA 4.0
2019-04-17T19:27:37.847Z
2019-04-17T19:35:44.633Z
2019-04-17T19:35:44.633Z
Ugam Kamat
<p>I understand that an internal keychain is used to receive a change of payment when I pay someone.</p>

<p>For example, I pay $20, but it costs $17, so I get $3.</p>

<p>But what I don't understand is how can there be a change? When I send 1 BTC to someone, how does the receiving end determine that I overpaid by 0.9 BTC and send that back to me?</p>

<transactions><change>
How does Internal Keychain exactly work?
Carol Ward
# How does Internal Keychain exactly work?

(Asked by: username_0 on 2019-04-17)

I understand that an internal keychain is used to receive a change of payment when I pay someone.

For example, I pay $20, but it costs $17, so I get $3.

But what I don't understand is how can there be a change? When I send 1 BTC to someone, how does the receiving end determine that I overpaid by 0.9 BTC and send that back to me?

**Tags:** transactions, change


---

## 1 answers

### Answer by username_1 on 2019-04-17. Score: 1 | Accepted answer

Bitcoin does not have the concept of account balance. It works on consuming the bitcoins that you have earnt in prior transactions. However, you cannot consume partial amounts. So according to your example, when you are creating a new transaction, in the inputs you will reference the transaction where you earnt the 1 BTC (it may be a single transaction where you got your 1 BTC, or you might reference multiple transactions whose values all add up to 1 BTC) and consume it entirely. Now in the outputs, you will send 0.1 BTC to address A and say 0.895 BTC to your change address. The difference of 0.005 BTC will go as mining fees.

> **Comments:**
> **username_0**: so every time I'm sending a bitcoin, I'm sending my entire balance and receiving balance - payment - mining fee back to my change address? What if I don't have a whole bitcoin? What if I only have 0.001 BTC?  
> **username_1**: @username_0 you have to reference multiple transactions in the inputs where you earned your BTCs and the values from those transaction should that add up to an amount that is more that want to intend to pay to a person. the difference (after removing mining fees) is what would go to your change address.  
> **username_0**: ok. I think I'm starting to understand. So when I send 0.001 BTC, the wallet references enough transactions together that equals 0.001 BTC or greater. If it's exactly 0.001 BTC, then no change needed. If it's 0.0017 BTC, then it pays 0.001 BTC to the recipient, pays mining fee (let's say 0.0003 BTC), and send the change of 0.0004 back to my change address. Is that right?  
> **username_2**: @username_0 that is correct  

---

