1

I have a wallet.dat with Bitcoin Address: 15iRTcgqBk1QNtr2gKkq2dUsm5nN25dSeN

I want to delete this Bitcoin Address: 15iRTcgqBk1QNtr2gKkq2dUsm5nN25dSeN and add another Bitcoin Address

How can I add another Bitcoin Address to this wallet.dat if I know its public key, but I don’t know the private key of this Bitcoin Address?

1 Answer 1

3

A wallet.dat file will contain many, many bitcoin keypairs/addresses. So there is no reason to delete an older address, and in fact this is probably a bad idea. If you or anyone else ever mistakenly sends bitcoins to that address, it will be impossible to recover them once you've deleted those keys.

If you do not have the private key for an address, you will not be able to spend any bitcoin stored at it. That said, you can still import the address as a 'watch-only' address, meaning your wallet will keep track of the address' balance, but not be able to spend the coins (because you don't have the private key).

You can use the following commands:

bitcoin-cli importaddress for a bitcoin address

bitcoin-cli importpubkey for a bitcoin public key

Note that in order for your wallet to learn about transactions sent to the imported address/pubkey in the past, your wallet will need to rescan the blockchain (rescan=true by default when calling importaddress or importpubkey). If you happen to know which blocks the relevant transactions were included in, you can set rescan=false and then run rescanblockchain ("start_height") ("stop_height") and it will complete the rescan much faster.

And if you do have the private key, you can import it using:

bitcoin-cli importprivkey

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.