Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: BitcoinGirl325 on April 09, 2013, 08:32:18 PM



Title: Where does the change go?
Post by: BitcoinGirl325 on April 09, 2013, 08:32:18 PM
I'm slightly confused by this... perhaps someone can help me understand this?

I used my Bitcoin-QT software to transfer some BTC from one of my addresses (Address #1) to another one of my addresses (Address #2). Both of these addresses are part of the same wallet, and both of these addresses are listed in my Bitcoin-QT software.

The transaction confirmed just fine, and my Bitcoin-QT software shows that my wallet still has the same exact amount of Bitcoins as before (less the transaction fee), because both of these addresses are part of the same wallet.

So, from the Bitcoin-QT software end, everything looks fine.

However, when I look up this transaction on blockchain.info, it shows that a larger number of BTC was used for the transfer than what I specified, and that "change was given" to a 3rd Address that is not listed in my wallet. So my original Address #1, on the blockchain.info website, has LESS BTC in it than what my Bitcoin-QT software shows. And that 3rd Address is not showing up in my Bitcoin-QT software at all.

Can somebody please explain this to me? Do I have control over that 3rd Address?

Thank you!!


Title: Re: Where does the change go?
Post by: jackjack on April 09, 2013, 08:37:09 PM
The third address is in your wallet (in the "pool"), but hidden
Yes you control it, and before you ask, yes it's VERY misleading


Title: Re: Where does the change go?
Post by: NothinG on April 09, 2013, 08:39:05 PM
The third address is in your wallet (in the "pool"), but hidden
Yes you control it, and before you ask, yes it's VERY misleading
I guess I never noticed this, but is the other address follow-able?


Title: Re: Where does the change go?
Post by: DeathAndTaxes on April 09, 2013, 08:41:00 PM
The QT wallet doesn't show you how much each address has it shows you how much ALL of your addresses combined have.  So when the wallet says "100 BTC" it actually means "the sum of the unspent outputs sent to addresses that I know the private key for equal 100 BTC". 

Address #3 in your query above is another address inside your wallet.  It might be easier if you post the tx id but here is an example.


You have 100 BTC you want to send 50 BTC to Address A.

Your wallet will find a set of unspent outputs >= 50 BTC.  These may come from more than one address in your wallet.  You may see some transactions have dozens of inputs.   

The wallet will find the sum of the unspent outputs to use as an input in this new tx.  Lets say it is 53 BTC.
The wallet will create a tx sending 50 BTC to the address you specify but since the input set is 53 BTC (and you can't partially spend an unspent output) it will then take a BRAND NEW address from your wallet and direct the other 3 BTC there.

So:
Input:
(collection of unspent outputs to addresses in your wallet) - 53 BTC

Output
Address A - 50 BTC
Change Address (a never before used address from your wallet) - 3 BTC

Input = Output.  The old unspent outputs become spent and the tx creates two new unspent outputs which will be inputs for future txs.


Title: Re: Where does the change go?
Post by: BitcoinGirl325 on April 09, 2013, 08:50:49 PM
Very, very interesting!! Thank you for the excellent & detailed explanation!! :)

I think what might make it easier for people to understand what's going on behind the scenes is for the Bitcoin-QT software to SHOW THE BRAND NEW ADDRESS as soon as it is used for something, instead of keeping it "hidden" behind the scenes.

Even though I doubt that many people would be depending on blockchain.info's website to see how many BTCs are in their locally-stored wallet, I think the software could be updated to help people avoid confusion if they do what I did (i.e. try to lookup a transaction in the block chain).

Thanks again! I'm relieved with the answer, and I feel like I'm understanding this better at the same time! :)


Title: Re: Where does the change go?
Post by: NothinG on April 09, 2013, 08:52:12 PM
I think what might make it easier for people to understand what's going on behind the scenes is for the Bitcoin-QT software to SHOW THE BRAND NEW ADDRESS as soon as it is used for something, instead of keeping it "hidden" behind the scenes.
That would be awesome! Like a button to popup a list of "pool" addresses.


Title: Re: Where does the change go?
Post by: BitcoinGirl325 on April 09, 2013, 08:53:13 PM
I think what might make it easier for people to understand what's going on behind the scenes is for the Bitcoin-QT software to SHOW THE BRAND NEW ADDRESS as soon as it is used for something, instead of keeping it "hidden" behind the scenes.
That would be awesome! Like a button to popup a list of "pool" addresses.

Yes! Exactly!! Is there some way to submit this as a feature request to whomever is working on the Bitcoin-QT client software?


Title: Re: Where does the change go?
Post by: DeathAndTaxes on April 09, 2013, 08:56:22 PM
I think what might make it easier for people to understand what's going on behind the scenes is for the Bitcoin-QT software to SHOW THE BRAND NEW ADDRESS as soon as it is used for something, instead of keeping it "hidden" behind the scenes.

Ding ding we have a winner.

IIRC the "reason" given for hiding change addresses from users is to insulate the user from the internal workings and to prevent users from doing this which would compromise their anonymity.  There is no good reason to re-use addresses and certainly no reason to re-use a change address.  The QT client is like a hardcore paranoid crypto-nerd version.  IMHO all addresses should be visible, the entire wallet more transparent because confusion on this (and other related issues) is pretty common.

Then again QT client is becoming less and less useful for new casual users anyways.  The requirements of being a full node will push most users to light clients and eWallets but there still is no good reason to hide (some) of the addresses.  It just creates confusion.


Title: Re: Where does the change go?
Post by: jackjack on April 09, 2013, 09:03:09 PM
This was proposed many times
This was refused many times too


Title: Re: Where does the change go?
Post by: BitcoinGirl325 on April 09, 2013, 09:05:52 PM
This was proposed many times
This was refused many times too


Ugh. Do you know why it was refused?


Title: Re: Where does the change go?
Post by: BitcoinGirl325 on April 09, 2013, 09:21:02 PM
I suppose the next most important question would be:

If I switched to a different & more lightweight BitCoin client, such as Multibit or Electrum, can I move all of my existing addresses from BitCoin-QT over to my new BitCoin client software, including that "hidden change address"? (I don't want to lose that change!)

Or is that the completely wrong way to think about moving to a different piece of client software? Perhaps if I switch to a different piece of software, I would just make a one-time BitCoin transfer from my old wallet (Bitcoin-QT's wallet) to a brand new address in my new wallet (Multibit's or Electrum's wallet)?


Title: Re: Where does the change go?
Post by: jackjack on April 09, 2013, 09:29:33 PM
You can always get your private keys, even the pool ones
I'm not sure the satoshi client allows this, but at least pywallet can do that


Title: Re: Where does the change go?
Post by: Bitcoin_Goddess on April 09, 2013, 09:50:21 PM

How about a button that will show the list of change addresses, but those change addresses would automatically disable themselves for the purpose of receiving funds from outside wallets? Would this be able to work?

Or encrypting the view of the change addresses just so that they could not be re-used for receiving from any outside wallet?

It does seem a little sneaky of the qt to deliberately hide account addresses.



Title: Re: Where does the change go?
Post by: wumpus on April 09, 2013, 10:17:43 PM
Yes! Exactly!! Is there some way to submit this as a feature request to whomever is working on the Bitcoin-QT client software?
The site for feature requests and bug reports: https://github.com/bitcoin/bitcoin/issues

I suppose the next most important question would be:

If I switched to a different & more lightweight BitCoin client, such as Multibit or Electrum, can I move all of my existing addresses from BitCoin-QT over to my new BitCoin client software, including that "hidden change address"? (I don't want to lose that change!)
I think most of those have an option to import an existing Bitcoin-qt wallet. If not, it would be safest to send everything to the new wallet with a transaction. If you copy address by address by manually copy/pasting private keys (without some kind of script) you might miss one.

How about a button that will show the list of change addresses, but those change addresses would automatically disable themselves for the purpose of receiving funds from outside wallets? Would this be able to work?
The problem with adding the change addresses to "receiving addresses" is that people will wonder why the address was added without requesting it. Of course, it could be labeled as change, or showed only with a "show hidden" checkbox. This goes along with another much-requested feature to hide receiving addresses on request (as they can't be deleted).

Btw the "listaddressgroupings" RPC command (Help->Debug window->Console) lists all your addresses that have somehow been exposed to the outside world, including change.



Title: Re: Where does the change go?
Post by: deepceleron on April 09, 2013, 10:31:22 PM
This was proposed many times
This was refused many times too


Ugh. Do you know why it was refused?
It is a non-issue if you just use Bitcoin and don't look at third-party websites that show you more information (and less information) than you need. The inner workings of transactions and change (http://we.lovebitco.in/transactions/) are transparent to Bitcoin users, just enter amount and press send.

If this was an elevator forum, people would be posting questions about how the elevator remembers which buttons have been pressed, how it stops at exactly the right spot, what the tension strength of the cables is, be proposing better algorithms to manage elevator traffic, discuss what music is best in the elevator, and post theories about how the failsafe brakes couldn't possibly work. Every week.


Title: Re: Where does the change go?
Post by: Bitcoin_Goddess on April 10, 2013, 02:53:04 AM
Btw the "listaddressgroupings" RPC command (Help->Debug window->Console) lists all your addresses that have somehow been exposed to the outside world, including change.

Now that solves everything, what a useful command!  :)

Thank you



Title: Re: Where does the change go?
Post by: BitcoinGirl325 on April 10, 2013, 03:43:21 AM
Btw the "listaddressgroupings" RPC command (Help->Debug window->Console) lists all your addresses that have somehow been exposed to the outside world, including change.

A-ha!! That's brilliant! That's exactly what I needed to put my mind at ease! Thank you! :)