Bitcoin Forum

Economy => Services => Topic started by: Adaxiongmao on June 17, 2016, 12:00:47 PM



Title: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: Adaxiongmao on June 17, 2016, 12:00:47 PM
Hi all,
I need to modify bitcoind source in order to add a new rpc command: deleteaddress

The command should delete all keys, txs, accounts and other address-related data from wallet.dat as well as from memory without restart or rescan.
I've tried
Code:
Erase(std::make_pair(std::string("keymeta"), vchPubKey));
Erase(std::make_pair(std::string("key"), vchPubKey));
Erase(std::make_pair(std::string("ckey"), vchPubKey));
Erase(std::make_pair(std::string("wkey"), vchPubKey));
and DelAddressBook procedure, but it doesn't delete all info from file, and doesn't delete from memory. And doesn't delete transactions info from wallet.dat. Well, after restart validateaddress "ismine" shows negative status, but wallet.dat has the same size and still contains pub keys info related to deleted addresses (if you check with a hex editor).

I pay 3 BTC for this work. Escrow if you like.

How it should work (testing):
- to the clean just created wallet we add new private key using importprivkey, which already has several transactions.
- after rescan wallet.dat is increased, added keys and tx info.
- we use deleteaddress command, wallet.dat returns to it's initial size, 'validateaddress ismine' returns false.

It should work in both encrypted and unencrypted wallets.

Please tell me if you can write this addition, your terms etc.
Thank you.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: instagibbs on June 17, 2016, 01:26:40 PM
It might be a good idea to see what problem you are trying to solve. It's quite dangerous to have a command that nukes private keys from your wallet, because that is how people shoot their feet off.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: achow101 on June 17, 2016, 03:19:40 PM
I think I can do this. I'll have to check the source code to see if this is within my ability. However, if I do this for you, I will want to use an escrow since this is a large amount of money that is being handled here.

Edit: I've sent you a PM


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: cloverme on June 17, 2016, 03:29:25 PM
I've used ognasty's escrow before, highly recommended.

https://bitcointalk.org/index.php?topic=303281.0


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: CIYAM on June 17, 2016, 03:32:36 PM
I would guess that you are going to need to "overwrite" the key (with some rubbish) in order to effectively "delete it" (as actual deleting can be problematic with any OS).

Another idea might be to change it to a "watch only" address (although I haven't looked at the wallet structure in detail so I'm not sure whether that would work).

Assuming that the wallet is encrypted then the unencrypted key should not remain in memory (unless you've instructed Bitcoin to unlock) but to be safe you'd probably want to restart bitcoind after the wallet modification is performed.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: dooglus on June 17, 2016, 05:46:47 PM
- we use deleteaddress command, wallet.dat returns to it's initial size, 'validateaddress ismine' returns false.

This seems like an odd requirement.

Do you really care that the starting and ending wallet.dat sizes be exactly the same? If so, why so? I doubt you're going to get this requirement met.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: Adaxiongmao on June 17, 2016, 06:09:31 PM
Actually we don't need exactly byte-to-byte size as origin, but the size should not significantly increase if we add 1000 wallets (with transactions), then delete 1000 wallets, then repeat all above 1000 times.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: cloverme on June 17, 2016, 06:25:36 PM
Hmmmm interesting, but you may find that when deleting a pair, it's probably going to be like adding a watch address and it's going to have to rescan the blockchain (assuming).  Why not just delete the wallet file if you don't care about the tx's or pub/priv keys?  It would probably be faster.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: Adaxiongmao on June 17, 2016, 06:31:26 PM
Hmmmm interesting, but you may find that when deleting a pair, it's probably going to be like adding a watch address and it's going to have to rescan the blockchain (assuming).  Why not just delete the wallet file if you don't care about the tx's or pub/priv keys?  It would probably be faster.
We don't need delete a whole wallet, just "old" addresses. And we can't stop service and restart wallet, all should be done with rpc command.


Title: Re: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]
Post by: Adaxiongmao on June 18, 2016, 06:41:38 PM
I've found a developer, thanx to all.