Wallet.dat consistency check #7239

issue ghost opened this issue on December 21, 2015
  1. ghost commented at 11:05 AM on December 21, 2015: none

    Not sure if i should ask it here but it is the only place i know of i could securely ask.

    Does Bitcoin Core UI/Client check for wallet.dat consistency on every startup? Does it check on startup if wallet.dat has all the correct private keys for every public key it contains? More importantly the private keys of those public keys listed in the UI on demand of "Request payment" button. (Does it also check when pressing that button?)

    I've been afraid of the hypothesis of sending coins to some address that i don't really have the private key due to some system failure.

  2. jonasschnelli commented at 11:32 AM on December 21, 2015: contributor

    Every keypair that was loaded from the wallet.dat file, will be checked thought a EC sign/verify operation. So it's probably impossible to have a public key in your wallet where you don't have the corresponding private key (unless you use impogrtaddress or importpubkey).

    But – if you assume your computer is compromised – nothing can stop an attack that would end up in lost/stolen coins. If you want to prevent from such attacks, create a cold storage (simple way: use a trusted offline computer, run Bitcoin-Core there, use it to keep private keys and use it for signing transactions) or use a hardware wallet.

    My personal recommendation: don't keep private keys on your standard computer, even if encrypted.

  3. jonasschnelli added the label Wallet on Dec 21, 2015
  4. LongShao007 commented at 3:09 PM on December 21, 2015: contributor

    Bitcoin-Core generate a public key from a private key

  5. ghost commented at 6:43 PM on December 21, 2015: none

    Every keypair that was loaded from the wallet.dat file, will be checked thought a EC sign/verify operation.

    I suppose it is only done when the public keys are created? So the private keys should be always correct. But what if in some system failure, bug or harmful malicious attack the private key gets corrupted or missing after its creation and before you can do a backup? Will the wallet still start up as if everything was fine?

    There was a bug in another wallet where people lost their coins 'cause private keys were missing, but its public keys were still there as valid addresses. Now they have a wallet consistency check on every start up.

  6. pstratem commented at 9:25 PM on December 25, 2015: contributor

    @louzada1 every key pair is checked on every load

  7. ghost commented at 7:24 AM on December 26, 2015: none

    @pstratem is it loaded on every bitcoin core startup? If a wallet is encrypted how is possible that the key pair would be checked?

  8. pstratem commented at 6:37 PM on December 26, 2015: contributor

    @louzada1 encrypted wallets are checked when the password is entered the first time.

    This really isn't an issue at all.

  9. laanwj commented at 12:01 PM on February 16, 2016: member

    The question has been answered, and the original poster has gone poof from github.

    Closing this.

  10. laanwj closed this on Feb 16, 2016

  11. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me