A scary thing happened... I need help debugging. #2500

issue vikstrous opened this issue on April 10, 2013
  1. vikstrous commented at 5:13 AM on April 10, 2013: none

    I try to send money:

    user@computer:~/dev/bitcoin/src$ ./bitcoind listaccounts
    {
        "" : 0.00000000,
        "wallet" : 16.00000000
    }
    user@computer:~/dev/bitcoin/src$ ./bitcoind sendfrom wallet 1Gxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 4
    c8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    user@computer:~/dev/bitcoin/src$ ./bitcoind listaccounts
    {
        "" : 0.00000000,
        "wallet" : 12.00000000
    }
    

    At this point I check blockchain.info and find out that 3.4 BTC was sent to another account, 1Fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    I get confused and worried. I check if I own that account:

    user@computer:~/dev/bitcoin/src$ ./bitcoind getaddressesbyaccount ""
    [
        "12xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ]
    user@computer:~/dev/bitcoin/src$ ./bitcoind getaddressesbyaccount wallet
    [
        "1Gxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "13xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ]
    

    I don't known the account and freak out and almost post on a forum asking for help figuring out what happened. Then I suspect that my bitcoin client still knows where the money is since it's showing a balance of 12.00000000.

    Then I attempt to send the full 12.00000000 to another account and succeed.

    Is this a bug? Where is the private key for 1Fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx? Why was anything sent to 1Fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx? I read that bticoind pre-generates addresses and puts them in a queue. If this is the next account that was pre-generated, why wasn't it added to any account? This really looks like a bug to me. Can I check what addresses are currently pre-generated or something like that?

    Can someone help me figure out what happened?

  2. gmaxwell commented at 5:18 AM on April 10, 2013: contributor
  3. vikstrous commented at 5:27 AM on April 10, 2013: none

    Ah, I did read that it works like this in theory, but I've never seen it in practice. I didn't realize this is what it looks like.

    The way I was trying to use my client is by keeping all the money in the same address for which I have they key stored offline, but also have it in my bitcoin wallet so that I can actually use it. The offline version is more of a backup than a security system in this case.

    This change system is really problematic because it means that I can't make sure that my money stays at one address if I use bitcoind.

    "The wallet file contains the private keys for change addresses, and they can receive and send coins normally. However, the GUI in the default client does not display them in the address book."

    This is the part that can lead to a lot of user error. I'm probably not alone in assuming that when I list my public keys I'm listing all public keys bitcoind knows about.

    Is there a better way to keep my money at the same address which is also stored offline? I don't think copying wallet files to USB sticks is very convenient.

  4. gmaxwell commented at 5:42 AM on April 10, 2013: contributor

    Reusing addresses is highly discouraged. It screws up the system's privacy properties for all users, and it reduces your security. You can currently make your backups good for a long time by setting the keypool size to a large value. If you want to do offline txn, I'd currently recommend using armory— it has a way of generating addresses that allows it to produce infinite addresses from one piece of saved data.

  5. vikstrous commented at 5:58 AM on April 10, 2013: none

    Ah, okay, thanks! That makes sense. I'll check out armory.

    Maybe there's something that can be done to improve the usability of bitcoind... Is there any reason not to have a way to dump out all the private information about a given account (as opposed to address)? There is dumpprivkey, but that's deceptively convenient while not actually giving you enough info to import your account on another computer. How about dumpprivaccountdata or something? It would dump out info about not only one address, but all addressed for this account including all change addresses.

    To me this is a problem:

    user@computer:./bitcoind help | grep change
    user@computer:
    

    There doesn't seem to be a way to get any info about change addresses. The account to address mapping was the most confusing part of bitcoind and this hidden change account business makes it even more of a black box when I want to know everything that's happening in there.

    Is there a page of warnings for people who think they know how bitcoin works and want to use bitcoind? Maybe that would've saved me from being confused and scared. If not, I could start one...

  6. vikstrous commented at 1:17 PM on April 10, 2013: none

    I think I'll make a separate issue for this later and just close this for now.

  7. vikstrous closed this on Apr 10, 2013

  8. DrahtBot locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me