Wallet generates a (spurious?) key when creating a new wallet #8416

issue laanwj opened this issue on July 28, 2016
  1. laanwj commented at 10:59 AM on July 28, 2016: member

    The wallet code, after creating a new empty wallet, grabs a key from the mempool and gives it the empty label:

     cRj4c74AFYdH9W1vbM3UgnaCeGbwztu3qb11NgDReiudtS2Q1ZAr 2016-07-28T10:48:28Z label= # addr=mwR8SR9sfKk7Q8z99xpdcCUNtccq81iRup hdkeypath=m/0'/0'/0'
    

    I'm fairly sure this has always been the case, but is this necessary?

    Remember that when using wallet encryption, this key will have been generated pre-encryption, and with HD, with the old seed. So if people actually use the address, instead of creating one when they need it, there could be a small risk.

    The code to do this is here: https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L3306 Reading the comments this appears to be a leftover from the "default address" concept which was removed in 0.4.0? Do we still need it?

  2. laanwj added the label Wallet on Jul 28, 2016
  3. laanwj renamed this:
    Wallet generates a key when creating a new wallet
    Wallet generates a (spurious?) key when creating a new wallet
    on Jul 28, 2016
  4. jonasschnelli commented at 11:03 AM on July 28, 2016: contributor

    Code https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L3308

    I agree with @laanwj and I don't see a reason for the defaultKey.

  5. MarcoFalke commented at 5:25 PM on December 5, 2016: member

    Meeting comments from https://bitcoincore.org/en/meetings/2016/12/01/#vchdefaultkey-in-wallet:

    Sipa would like to get rid of this, however if we do that, a downgrade to an older wallet version would result in failing to rescan.

    Given this is not really urgent there’s no need for hacks like dummy keys etc. 0.14 could stop relying on vchDefaultKey, but still write it, and then in 0.15 delete the vchDefaultKey and increase the minimum version to 0.14 so 0.15 wallets will never be openable with 0.13.

  6. MarcoFalke added this to the milestone Future on Dec 5, 2016
  7. laanwj commented at 8:56 AM on August 24, 2017: member

    This was fixed in #10952. Thanks @achow101.

  8. laanwj closed this on Aug 24, 2017

  9. MarcoFalke removed this from the milestone Future on Aug 12, 2018
  10. 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-13 15:15 UTC

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