Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vikstrous opened this issue Apr 10, 2013 · 5 comments
Closed

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

vikstrous opened this issue Apr 10, 2013 · 5 comments

Comments

@vikstrous
Copy link

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?

@gmaxwell
Copy link
Contributor

@vikstrous
Copy link
Author

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.

@gmaxwell
Copy link
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.

@vikstrous
Copy link
Author

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...

@vikstrous
Copy link
Author

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

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants