Bitcoin Forum
November 12, 2024, 05:47:17 PM *
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: [PATCH] remove private keys from wallet  (Read 1286 times)
riush (OP)
Member
**
Offline Offline

Activity: 73
Merit: 10


View Profile
June 19, 2011, 03:49:12 PM
 #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

1MKKiJhUJgqKyfCLeo7bB1bvELNEM8wUbz
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!