Bitcoin Forum
November 12, 2024, 12:39:43 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Change delivered to unknown address  (Read 1811 times)
realnowhereman (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 502



View Profile
May 21, 2011, 09:27:59 AM
 #1

I'm using the debian compiled bitcoind command line interface.

I've just sent an example transaction to a friend.  That worked fine.

The problem is that I haven't received the change.

I sent 1 bitcoin; and the transaction has appeared in the block chain.  The change was delivered back to a different address, that I can't see anywhere in bitcoind output.  "bitcoind listaccounts" shows all my accounts with their original values, and one "" account with a negative value.  My total balance is therefore correct.  But, how can I now spend that change?  I can't see its address anywhere?

Why didn't bitcoind give the change to the same address that the payment was sent from?

I'm not that interested in accounts at this stage, is there any way to get bitcoind to list all addresses in the wallet and the current balance on them?

1AAZ4xBHbiCr96nsZJ8jtPkSzsg1CqhwDa
realnowhereman (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 502



View Profile
May 21, 2011, 09:39:22 AM
 #2

... okay, I managed to get it to appear by using "bitcoind setaccount" and the address I found in blockexplorer.

Now bitcoind listaccounts shows an even bigger negative number for the "" account and double the value on my "Your Address" account.

Surely that can't be right?  Is bitcoins wallet really meant to work like this?

1AAZ4xBHbiCr96nsZJ8jtPkSzsg1CqhwDa
realnowhereman (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 502



View Profile
May 21, 2011, 10:05:30 AM
 #3

It wasn't so much the change to a different address, it was the change going to an address I had no way of finding (other than using blockexplorer, which average users really shouldn't have to understand).

Perhaps it's my use of the command line client that is the problem.  I don't suppose this problem would have occurred in the graphical version.

1AAZ4xBHbiCr96nsZJ8jtPkSzsg1CqhwDa
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1072
Merit: 1181


View Profile WWW
May 21, 2011, 10:29:36 AM
 #4

Accounts as currently implemented are purely an accounting feature. Some addresses are linked to an account, in a way that that account is automatically credited when payment arrives to that address, but they are by no means a way for knowing which address holds what amount of coins. Change transactions are always sent to addresses not shown in the user interface, by the way.

I do Bitcoin stuff.
realnowhereman (OP)
Hero Member
*****
Offline Offline

Activity: 504
Merit: 502



View Profile
May 21, 2011, 11:44:15 AM
 #5

That's fine; I understand that.  An account is just a label written against an address, and is an entirely local construct.

But the way the balances are calculated make it look like nothing has happened.  Here's what I saw:

  • $MYADDRESS has 10 BTC (bitcoind listreceivedbyaddress)
  • I send a coin to my friend (bitcoind sendtoaddress $FRIENDSADDRESS)
  • Block explorer shows that it has happened, with change to some new address $CHANGEADDRESS
  • ...but bitcoind doesn't (using bitcoind listreceivedbyaddress)
  • I go searching for this address, it must be somewhere because my local bitcoin generated the transaction (bitcoind getaddressesbyaccount shows nothing even for the empty account)
  • The only clue is that my total balance is right (bitcoind getbalance), I can find no way to get bitcoind to tell me the change address
  • Using the address I know exists from blockexplorer I can get bitcoind to reveal the balance (bitcoind getreceivedbyaddress $CHANGEADDRESS)
  • I guess that the problem is that the address has no account written against it (bitcoind setaccount $CHANGEADDRESS "Your Address")
  • It now starts appearing in bitcoind output
  • The list of transactions is obviously lies.  bitcoind listtransactions "" shows the sending of -9 BTC
  • bitcoind listtransactions "Your Address" shows the original input, and the change being returned which means bitcoind getreceivedbyaccount now shows +19BTC.  I don't have 19BTC on that account or either of the addresses in that account.
  • I get the feeling that I've managed to split one half of a double entry transaction into one account and the other into another, with no way of resolving it. 

My problem is that that $CHANGEADDRESS was utterly unknowable by me; the balance associated unknowable by me without information I got from an external source, and familiarity with the bitcoin technology.  Then when I do manage to get it to appear, it's made a muddle of all the figures in the wallet.  It's just ridiculously confusing.  I suspect that it's all been done in the name of reducing confusion, but there is no way I could explain what happened in the above sequence to a muggle.

1AAZ4xBHbiCr96nsZJ8jtPkSzsg1CqhwDa
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1072
Merit: 1181


View Profile WWW
May 21, 2011, 01:24:35 PM
 #6

That's fine; I understand that.  An account is just a label written against an address, and is an entirely local construct.

No that's not it. An account is almost entirely disconnected from addresses. Accounts are intended to group transactions together, and see their balance. They are in no way an indication for what address those credits are currently associated with.

I do Bitcoin stuff.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5376
Merit: 13410


View Profile
May 23, 2011, 06:52:06 AM
 #7

Bitcoin is designed to pretend that the concept of "change" doesn't exist. It lies about address balances and offers no ability to see change addresses.

For almost all cases, this is the desired behavior. Unless you are doing something very unusual, you probably don't actually need to see how change was handled.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!