How do you delete an account in Bitcoin Core?

4

2

I am attempting to allow multiple bitcoin addresses to be created per account, but how can I delete them using the standard API? There doesn't seem to be a function for that.

E.g. the acccount "Test" :

Array (
[0] => 1JQQXBRrG5h7uW8StVtJRcGEdb4YYTqnas
[1] => 1LP8VeKDNKAgErCnYVAFvGMnrGbM3oHe6u
[2] => 1LwTx3a7hy4FZ5EJMxcPnRG9ap8AUwd2cm
[3] => 1AtbnW8dPuzp6jVnAvipiJR4o1BupCcU8D
[4] => 1K7FyNgmJ4ryjKgNz9ybxzQcYrGDEbYEUX
[5] => 1Ng77Nq1SF46MDZnz4pEirCEbbiHZ1Wthp
[6] => 175FKAiJSC9wA12BPcYZD6drTYLxXXChdZ
)

What if the user just wants to delete 1JQQXBRrG5h7uW8StVtJRcGEdb4YYTqnas?

Cheers!

Patrick Geyer

Posted 2015-01-11T17:24:45.903

Reputation: 143

Are you using the accounts feature of bitcoind?

Nick ODell 2015-01-11T17:46:10.970

@NickODell I am :)Patrick Geyer 2015-01-11T17:47:44.380

Do you want to delete the account, delete the address, or dis-associate the address from that account?morsecoder 2015-01-12T03:38:32.753

@StephenM347 I'd like to delete an account!Patrick Geyer 2015-01-25T16:55:55.720

@PatrickGeyer, I was confused because in your question you ask "What if the user just wants to delete 1JQQXBRrG5h7uW8StVtJRcGEdb4YYTqnas?" I'm glad you've got it figured out, though.morsecoder 2015-01-25T17:02:29.613

@StephenM347 - I can now delete an address from an account.. But it still appears in the list of Bitcoin receiving addresses under the label (no label). Any advice on how to completely delete the address?Patrick Geyer 2015-01-25T17:10:06.343

And I'm assuming label and account are the same thing - http://bitcoin.stackexchange.com/questions/4136/importprivkeys-label-is-it-the-same-as-an-account?rq=1

Patrick Geyer 2015-01-25T17:11:41.887

@PatrickGeyer, Yes, label and account are the same thing. Like Nick said in his answer, though, you can't delete the address itself.morsecoder 2015-01-25T17:12:47.940

"You can also use PyWallet to delete addresses permanently" - I guess not quite, then. Thanks a lot Stephen :)Patrick Geyer 2015-01-25T17:14:51.800

Answers

4

bitcoind does not allow you to delete addresses. (If it did, the next question people would ask is, "How do I undelete addresses?" :))

However, you can use the rpc call setaccount to change the account associated with the address. The first argument to setaccount should the the address you're changing; the second shound be the account you're moving it to. (If you want to move it to the default account, put "" as the second argument.)

Note that this does not change the balance of the account; balances are tracked internally. If you want to keep this consistent, run getreceivedbyaddress, then move that balance to the new account.

You can also use PyWallet to delete addresses permanently. Use the --multidelete option, and pass it a path to a file. That file should contain key as the first line, followed by each address you want to delete, each on a new line.

Nick ODell

Posted 2015-01-11T17:24:45.903

Reputation: 26 536

Thanks, I've used piwallet, but is there a way to do this from command line, not Web interface?Patrick Geyer 2015-01-12T07:29:13.937

@PatrickGeyer See edit.Nick ODell 2015-01-12T07:38:37.863

This is exactly what I am looking for, thanks so much :)Patrick Geyer 2015-01-12T07:39:51.933

What format should that file be? Is .txt okay?Patrick Geyer 2015-01-12T21:20:00.313

1@PatrickGeyer Yes.Nick ODell 2015-01-12T22:33:36.530

0

Just to answer the explicit question "how to delete an account": you cannot. The label will stick to another – eventuallay unused – addresses. for further information, read this issue: https://github.com/bitcoin/bitcoin/issues/1231#issuecomment-6305302

vv01f

Posted 2015-01-11T17:24:45.903

Reputation: 159