Bitcoin Forum

Other => Beginners & Help => Topic started by: plogank on January 12, 2012, 06:59:21 PM



Title: Can Someone Explain?
Post by: plogank on January 12, 2012, 06:59:21 PM

I made a 0.1 BTC transaction but when I view the transaction on http://blockchain.info/new-transactions I see it tied to another apparent transaction.  See below.

http://s739.photobucket.com/albums/xx35/plogank/?action=view&current=Transaction.jpg

Also, what are the addresses to the left.

Sorry if I posted this in the wrong place, I didn't know where to post it.

Thanks.


Title: Re: Can Someone Explain?
Post by: FreeMoney on January 12, 2012, 07:22:20 PM
That is a typical transaction. It used two of your received transactions which totaled more than the intended amount. Since it has to use them completely it sent what you didn't want to pay back to yourself at a new address your client made for you, we call it change.


Title: Re: Can Someone Explain?
Post by: plogank on January 12, 2012, 07:33:48 PM
That is a typical transaction. It used two of your received transactions which totaled more than the intended amount. Since it has to use them completely it sent what you didn't want to pay back to yourself at a new address your client made for you, we call it change.

I'm confused.  None of the Bitcoin addresses shown in that transaction are addresses in my wallet.


Title: Re: Can Someone Explain?
Post by: DeathAndTaxes on January 12, 2012, 07:36:22 PM
You know that for a fact.  Have you exported all your addresses.

Any time you send funds the extra funds go into a "Change" address.  Those addresses you didn't recognize are likely change addresses from prior transactions.


Title: Re: Can Someone Explain?
Post by: plogank on January 12, 2012, 08:01:10 PM
You know that for a fact.  Have you exported all your addresses.

Any time you send funds the extra funds go into a "Change" address.  Those addresses you didn't recognize are likely change addresses from prior transactions.

Ok, I'm not sure I understand this change thing but I can accept it.  Can you explain what the addresses on the left are?


Title: Re: Can Someone Explain?
Post by: westkybitcoins on January 12, 2012, 08:03:11 PM
That is a typical transaction. It used two of your received transactions which totaled more than the intended amount. Since it has to use them completely it sent what you didn't want to pay back to yourself at a new address your client made for you, we call it change.

I'm confused.  None of the Bitcoin addresses shown in that transaction are addresses in my wallet.

None that you have seen yet, anyway. ;)

When you first startup Bitcoin, it generates 100 addresses for your wallet for a variety of reasons (like change.) You only see the first one, until you receive funds with it and then address #2 is displayed. Once you use address #100, more "behind-the-scenes" addresses are generated (not sure how many.)

Whenever you send funds from your wallet using the standard client, unless you spend all your funds, you get what's called change. If you received 100 BTC, then spend 25 BTC to someone else, you have change of 75 BTC sitting in your wallet in an address you've probably never seen. When you spend 10 of that 75 BTC, the client sends it from this hidden address, and stores the 65 BTC change in yet ANOTHER address. If you've been receiving funds at multiple addresses, there are probably many hidden addresses in your wallet that actually hold your funds.

If you're still not feeling comfortable, you can always trace the funds "up the chain." Look at the addresses associated with your transaction, and pick one you haven't seen. Check and see what transactions placed money into that address, and as needed, check to see what transactions placed money into THAT address. Eventually, you'll see a transaction with an input from an address you've seen, outputting to that address, and on down the chain. That proves that the funds started in your wallet; it's just the standard client shuffling things behind the curtain.


Title: Re: Can Someone Explain?
Post by: DeathAndTaxes on January 12, 2012, 09:07:32 PM
Ok, I'm not sure I understand this change thing but I can accept it.  Can you explain what the addresses on the left are?

Well they are related to change.

Lets pretend your wallet has only 1 address with value.  Address A.  Since it is the only address you have used (via generate new address button) it is the only one you see.  You have 10 BTC.

So you may think your wallet looks like this:
-----------------------------------
Address A - value 10 BTC.
nothing else


However the wallet pre-generates 100 addresses and puts them in a "key pool"

So your wallet actually looks something like this:
-----------------------------------
Address A - value 10 BTC (visible)
Address B .... Z - value 0 BTC (hidden)


With me so far?

Now say you send/transfer/spend some coins.  You send me 4 BTC.  You might think it works like this:
Address A - 10 - 4 = 6 BTC
and now your wallet still has only 1 address (address A) and it has 6 BTC.

but it doesn't.  Anytime you perform a transaction Bitcoin empties that address (there are uber geek reasons for why).

So it actually works like this:
Bitcoin makes a transaction

FROM Address A (value 10 BTC)
TO Address Me (value 4 BTC)
TO Address B (value 6 BTC)

10 BTC in & 10 BTC out

So after the transaction your wallet looks like this:
-----------------------------------
Address A - 0 BTC (visible)
Address B - 6 BTC (hidden)
Address C to Z - 0 BTC (hidden)

Now imagine you send me another 2 BTC.  You might think it is going to come from Address A right?  I mean it is the only address in your wallet you see. However A has no value.

Instead it will be transaction like this:
FROM Address B (value 6 BTC)
TO Address Me (value 2 BTC)
TO Address C (value 4 BTC)

6 BTC In & 6 BTC Out

So after the transaction your wallet looks like this:
-----------------------------------
Address A - 0 BTC (visible)
Address B - 0 BTC (hidden)
Address C - 4 BTC (hidden)
Address D to Z - 0 BTC (hidden)

Now I left a lot out like how keypool constantly "refiils" so you always have 100 "unused" addresses at all times and how Bitcoin tracks not just aggregate value but the prior output but hopefully that makes more sense then getting into the weeds.

TL/DR version:
Your wallet contains more addresses than you think it does because anytime you send coins the "Change" is sent to a new unused address.
There are tools to export your entire wallet and you will see all those "hidden" addresses and what value they have.  If you exported your wallet you would find those "unknown" inputs in the transaction above.  Also you would find the "unknown" output (it is your newest "change" address).


Title: Re: Can Someone Explain?
Post by: beckspace on January 12, 2012, 09:28:58 PM

Anytime you perform a transaction Bitcoin empties that address (there are uber geek reasons for why).


Is it because of anonymity?

How some online wallets or alternative clients let you send the change back at the same address?

Enlighten me.



Title: Re: Can Someone Explain?
Post by: cypherdoc on January 12, 2012, 09:30:38 PM
Ok, I'm not sure I understand this change thing but I can accept it.  Can you explain what the addresses on the left are?

Well they are related to change.

Lets pretend your wallet has only 1 address with value.  Address A.  Since it is the only address you have used (via generate new address) button it is the only one you see.  You have 10 BTC.

So
Address A - value 10 BTC.

Now you may think you only have 1 address but actually you have another 100 addresses "hidden" inside the wallet in a keypool.

So it actually is:
Address A - value 10 BTC (visible)
Address B .... Z - value 0 BTC (hidden)

With me so far?

Now say you send/transfer/spend some coins.  You send me 4 BTC.  You might think it works like this
Address A - 10 - 4 = 6 BTC
so your wallet has 1 address (address A) and it has 6 BTC.

but it doesn't.  Anytime you perform a transaction Bitcoin empties that address (there are uber geek reasons for why).

So it actually works like this:
Bitcoin makes a transaction FROM Address A transfering 10 BTC.  4 BTC go to me, the other 6 BTC go to another address you control (from the keypool).

So after the transaction your wallet looks like this
Address A - 0 BTC (visible)
Address B - 6 BTC (hidden)
Address C to Z - 0 BTC (hidden)

Now imagine you send me another 2 BTC.  You might think it is going to come from Address A right?  I mean it is the only address in your wallet you see. However A has no value.  Instead it will be transaction like this.

Transaction FROM Address B - 6 BTC.  2 BTC to me, the other 4 go to a DIFFERENT address you control.

So after the transaction your wallet looks like this
Address A - 0 BTC (visible)
Address B - 0 BTC (hidden)
Address C - 4 BTC (hidden)
Address D to Z - 0 BTC (hidden)

Now I left a lot out like how keypool constantly "refiils" so you always have 100 "unused" addresses at all times but hopefully that makes more sense.

TL/DR version:
Your wallet contains more addresses than you think it does because anytime you send coins the "Change" is sent to a new unused address.

There are tools to export your entire wallet and you will see all those "hidden" addresses and what value they have.




nice explanation.


Title: Re: Can Someone Explain?
Post by: westkybitcoins on January 12, 2012, 09:38:52 PM

Anytime you perform a transaction Bitcoin empties that address (there are uber geek reasons for why).


Is it because of anonymity?

How some online wallets or alternative clients let you send the change back at the same address?

Enlighten me.

Well, the reason change is sent to a different address is, from what I can tell, mostly for privacy. If all change always went back to the receiving address, and you know Alice has that address, you can be certain that all those spends are her spends. With change going to an unused address, you don't know for sure that anything after the first spend is hers. Some people don't mind, but for those that do, having to create and specify a new address for change is a bit user-unfriendly; the standard client just defaults to doing it automatically.

But the reason that change exists is just due to the way bitcoin is setup. I believe it has to do with creating an unbroken chain of transactions, with digital signing for verification along each step of the way. But I'm sure someone with a greater understanding of it can provide a better explanation....


Title: Re: Can Someone Explain?
Post by: kjj on January 12, 2012, 09:51:01 PM
Ok, I'm not sure I understand this change thing but I can accept it.  Can you explain what the addresses on the left are?

Well they are related to change.

<snip>

Excellent post.  Should be required reading for all newbies.

But, addresses don't have balances, and spends don't empty addresses.  Addresses have keys, and keys have transactions, and transactions have balances.  And when you spend, the client selects a subset of transactions to redeem that meet or exceed the spend amount, not a subset of addresses.  If you've received multiple transactions to the same address, a spend won't necessarily empty all of them at once.


Title: Re: Can Someone Explain?
Post by: DeathAndTaxes on January 12, 2012, 09:54:40 PM
Anytime you perform a transaction Bitcoin empties that address (there are uber geek reasons for why).
Is it because of anonymity?

Yes.  Not just for you but also for the person you are sending funds to.

Quote
How some online wallets or alternative clients let you send the change back at the same address?
Enlighten me.

First I think it is "rude" because it compromises the receivers anonymity also but the address is still emptied they simply use the same address as the output.

So instead of
INPUT - Address A - 10 BTC
OUTPUT - Address Store - 4 BTC
OUTPUT - Address B - 6 BTC

Input 10 BTC - Output 10 BTC
(where A & B are addresses in your wallet)

they just do this:
INPUT - Address A - 10 BTC
OUTPUT - Address Store - 4 BTC
OUTPUT - Address A - 6 BTC

Input 10 BTC - Output 10 BTC

Note: As kjj indicates above the inputs aren't values they are actually the prior transaction output.  Bitcoin doesn't track values it tracks every transaction back to the coinbase.  However conceptually it may be easier to just think of it as values just understand that isn't exactly right.




Title: Re: Can Someone Explain?
Post by: DeathAndTaxes on January 12, 2012, 09:56:29 PM
Ok, I'm not sure I understand this change thing but I can accept it.  Can you explain what the addresses on the left are?

Well they are related to change.

<snip>

Excellent post.  Should be required reading for all newbies.

But, addresses don't have balances, and spends don't empty addresses.  Addresses have keys, and keys have transactions, and transactions have balances.  And when you spend, the client selects a subset of transactions to redeem that meet or exceed the spend amount, not a subset of addresses.  If you've received multiple transactions to the same address, a spend won't necessarily empty all of them at once.

Yeah I did abstract it some.  I debated on getting down to the detail of transaction outputs being the inputs for the next transaction but I figured that might be "too much" for someone who is thinking wallet is just a value and addresses they can see.

Maybe someone can figure out a good way to explain that (maybe w/ diagrams) which is both simple & accurate.


Title: Re: Can Someone Explain?
Post by: beckspace on January 12, 2012, 11:58:47 PM
Addresses have keys, and keys have transactions, and transactions have balances.

This is a good start to fully understand that, thanks.

Maybe someone can figure out a good way to explain that (maybe w/ diagrams) which is both simple & accurate.

Agreed. Bitches love diagrams.



Title: Re: Can Someone Explain?
Post by: plogank on January 13, 2012, 01:53:27 AM
Ok, I'm not sure I understand this change thing but I can accept it.  Can you explain what the addresses on the left are?



TL/DR version:
Your wallet contains more addresses than you think it does because anytime you send coins the "Change" is sent to a new unused address.
There are tools to export your entire wallet and you will see all those "hidden" addresses and what value they have.  If you exported your wallet you would find those "unknown" inputs in the transaction above.  Also you would find the "unknown" output (it is your newest "change" address).


Thanks, that's quite understandable, however, I exported my wallet and found only 50 addresses and none of them the addresses in the transaction I posted above.  Perhaps I'm not exporting correctly, but I did hit the export button.


Title: Re: Can Someone Explain?
Post by: Hawkix on January 13, 2012, 06:28:31 PM
No, you did not export your wallet. You just exported the view of transactions. Beware that this "Export" button merely just dumps the view into file. It does not backup or save your bitcoin wallet in any way!