1

There is one thing I do not understand about unspent outputs and change addresses. For example, let's say a person has 5BTC in a wallet, and they have 2 unspent outputs of 3BTC and 2BTC.

They one day need to pay 2.5BTC for something. I know about the coin selection algorithm but lets just say the Bitcoin wallet select 2.5BTC out of the 3btc unspent output. This would leave 0.5BTC to send to the change address.

Now here is my question. Let's say they make the change address to a new wallet. Will the new wallet have 0.5BTC and the old wallet have 2BTC or will the new wallet have 2.5BTC and the old wallet 0BTC

Basically the 2BTC unspent output that was never touched, does it go with the change address or does it stay in the old wallet?

1
  • 1
    If the change address goes to a different wallet, is it really a change address?
    – Nick ODell
    Aug 30, 2015 at 23:07

1 Answer 1

1

If you send 2.5 BTC to one address and 0.5 BTC to another wallet, that is a transaction with two recipients. Change addresses are new addresses in the same wallet.

If the 3BTC UTXO were selected, there would be no reason for the 2BTC UTXO to move. If you want to move all your money to the new wallet, send 2.5BTC to the recipient and the remaining money to your new wallet.

If you want to find out more about the Coinselection Algorithm check out What is the coin selection algorithm?.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.