<p>You should send some money back to yourself as change. Normally wallets do this automatically for you. Wallets normally generate a new change address for each transaction.</p>
<p>So if A has a UTXO of 1 BTC and wants to send 0.1 BTC to B with a fee of 0.001BTC the transaction would be</p>
<ul>
<li>Inputs
<ul>
<li>1 BTC (from A)</li>
</ul>
</li>
<li>Outputs
<ul>
<li>0.1 BTC to B</li>
<li>0.899 BTC to A</li>
</ul>
</li>
</ul>
<p>This leaves 0.001 BTC unaccounted for which is the transaction fee to be claimed by a miner.</p>

CC BY-SA 4.0
2022-03-30T16:30:35.620Z
wow so simple and so smart at the same time I was not even thinking about sending the rest to myself back, would you recommend sending it back to the same address or generate a new one? Thanks @RedGrittyBrick
Vladimir
CC BY-SA 4.0
2022-03-30T17:57:53.833Z
I would generate a new address. It improves privacy.
RedGrittyBrick
CC BY-SA 4.0
2022-03-30T16:15:47.833Z
2022-03-30T16:15:47.833Z
RedGrittyBrick
<p>Today I created my very first transaction of bitcoin on the testnet programmatically. I created a wallet A, first generated my private key and I generated a deposit address. I deposited 0.00074 btc into it and waited till 6 confirmations so I can send bitcoin to somebody else. I decided to send 0.0000646 BTC to different address B and the transaction was successful however I noticed the transaction fee was 0.0006754 BTC so literally the rest of the balance from wallet A was used as a fee. I found this in the documentation of the api I am using <a href="https://docs.tatum.io/rest/blockchain/b3A6NDE2NTc3NTg-send-bitcoin-to-blockchain-addresses" rel="nofollow noreferrer">apidocs</a>
&quot;When the amount of funds that the recipient should receive is lower than the amount of funds from the UTXOs, the difference is used as a transaction fee.&quot;<br />
Does that mean that for example if I deposit 1BTC to a specific address, if I want to send a certain amount of btc thats significantly smaller lets say 0.1 btc, 0.9btc will be used as a fee?? Then what If I want to send only a certain amount of money and dont want to pay such a massive fee do I have to create a completely new deposit address each time I want to send bitcoin and top it up only with the amount I want to send + fee? There must be a way to send small amounts I sent a small amounts from exchanges but did not see what logic is behind, could somebody please explain and give me some example?</p>

CC BY-SA 4.0
2022-03-31T20:20:47.817Z
Possible duplicate of https://bitcoin.stackexchange.com/q/736/5406
Murch
<transactions><change>
Sending certain amount of bitcoin from an address
Vladimir
# Sending certain amount of bitcoin from an address

(Asked by: username_0 on 2022-03-30)

Today I created my very first transaction of bitcoin on the testnet programmatically. I created a wallet A, first generated my private key and I generated a deposit address. I deposited 0.00074 btc into it and waited till 6 confirmations so I can send bitcoin to somebody else. I decided to send 0.0000646 BTC to different address B and the transaction was successful however I noticed the transaction fee was 0.0006754 BTC so literally the rest of the balance from wallet A was used as a fee. I found this in the documentation of the api I am using [apidocs](https://docs.tatum.io/rest/blockchain/b3A6NDE2NTc3NTg-send-bitcoin-to-blockchain-addresses)
"When the amount of funds that the recipient should receive is lower than the amount of funds from the UTXOs, the difference is used as a transaction fee."  
Does that mean that for example if I deposit 1BTC to a specific address, if I want to send a certain amount of btc thats significantly smaller lets say 0.1 btc, 0.9btc will be used as a fee?? Then what If I want to send only a certain amount of money and dont want to pay such a massive fee do I have to create a completely new deposit address each time I want to send bitcoin and top it up only with the amount I want to send + fee? There must be a way to send small amounts I sent a small amounts from exchanges but did not see what logic is behind, could somebody please explain and give me some example?

**Tags:** transactions, change

> **Comments:**
> **username_1**: Possible duplicate of https://bitcoin.stackexchange.com/q/736/5406  

---

## 1 answers

### Answer by username_2 on 2022-03-30. Score: 1 | Accepted answer

You should send some money back to yourself as change. Normally wallets do this automatically for you. Wallets normally generate a new change address for each transaction.

So if A has a UTXO of 1 BTC and wants to send 0.1 BTC to B with a fee of 0.001BTC the transaction would be

* Inputs
  + 1 BTC (from A)
* Outputs
  + 0.1 BTC to B
  + 0.899 BTC to A

This leaves 0.001 BTC unaccounted for which is the transaction fee to be claimed by a miner.

> **Comments:**
> **username_0**: wow so simple and so smart at the same time I was not even thinking about sending the rest to myself back, would you recommend sending it back to the same address or generate a new one? Thanks @username_2  
> **username_2**: I would generate a new address. It improves privacy.  

---

