Author

Topic: [PATCH] remove private keys from wallet (Read 1287 times)

member
Activity: 73
Merit: 10
June 19, 2011, 10:49:12 AM
#1
Disclaimer: I'm not very familiar with the bitcoin code or even C++ itself, so please correct me if I'm wrong and tell me what I missed Smiley

https://github.com/mhanne/bitcoin/tree/removeprivkey

This adds a new RPC call "removeprivkey" which takes an address and removes the corresponding keys.
It's intended to be used after a key has been dumped (showwallet branch).

Currently, it removes the name and the key from the wallet and the private and public key from memory.

What it does NOT do is updating the coressponding account/transactions, so if you have spent transactions and you remove keys, you might get negative balances.
I'm not sure what to do about that, I tried to find and remove transactions, but couldn't figure out how. Rescan doesn't help either.
However, I think for some usecases (like my online-wallet) this won't even be a problem because a user never sees any balances until the keys are loaded.

Also, since this is obviously very dangerous, maybe there should be some safeguards like checking if the key has been dumped before, or at least a compile-time option.
Maybe even require the dumped key to be passed as input, for proof that the user has it?

Please look at the code and tell me what you think and if it might be worth a pull request.

 Marius
Jump to: