Bitcoin Forum
June 23, 2024, 11:37:28 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [$] Need developer. Add Bitcoin Core RPC command [deleteaddress]  (Read 710 times)
Adaxiongmao (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 17, 2016, 12:00:47 PM
 #1

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.
instagibbs
Member
**
Offline Offline

Activity: 114
Merit: 12


View Profile
June 17, 2016, 01:26:40 PM
 #2

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.
achow101
Staff
Legendary
*
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
June 17, 2016, 03:19:40 PM
Last edit: June 17, 2016, 06:10:33 PM by knightdk
 #3

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

cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1057


SpacePirate.io


View Profile WWW
June 17, 2016, 03:29:25 PM
 #4

I've used ognasty's escrow before, highly recommended.

https://bitcointalk.org/index.php?topic=303281.0
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 17, 2016, 03:32:36 PM
 #5

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.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
dooglus
Legendary
*
Offline Offline

Activity: 2940
Merit: 1330



View Profile
June 17, 2016, 05:46:47 PM
 #6

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

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
Adaxiongmao (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 17, 2016, 06:09:31 PM
 #7

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.
cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1057


SpacePirate.io


View Profile WWW
June 17, 2016, 06:25:36 PM
 #8

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.
Adaxiongmao (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 17, 2016, 06:31:26 PM
 #9

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.
Adaxiongmao (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 18, 2016, 06:41:38 PM
 #10

I've found a developer, thanx to all.
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!