0

We are only able to generate "legacy" addresses that begin with a "1". This is a long standing problem generating new addresses using bitcoind and has persisted through a few recent versions of bitcoin core.

This might be a possible bug in bitcoind 64-bit linux.

We are currently running core 19.1 taken from here: https://bitcoincore.org/bin/bitcoin-core-0.19.1/

And our linux version is: Ubuntu 18.04.3 LTS x86_64

We have "addresstype=bech32" set in our bitcoin.conf.

Has anyone else seen this problem before?

Here is our bitcoin.conf:

addnode=**.***.***.***

server=1

rpcport=****

walletnotify=/btc_notify.sh %s

# OpenSSL settings used when rpcssl=1
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH
rpcsslcertificatechainfile=server.cert
rpcsslprivatekeyfile=server.pem

gen=0

keypool=100

paytxfee=0.00005000

addresstype=bech32

And here is an example of how the problem manifests itself:

enter image description here

  • How old is the wallet file? As in, when was it first created? – Pieter Wuille Mar 19 at 17:09
  • Also, can you post the output of the getwalletinfo command (specifically, its walletversion field). – Pieter Wuille Mar 19 at 17:27
  • And as a side-note, the rpcssl settings have been removed years ago, you might be best off removing them from your config as well. – user2084795 Mar 19 at 17:46
  • As for the age of the wallet file, we had to restart bitcoind today, and when we run "stat wallet.dat" we are getting access and modification dates for today. However, this full node has been running since at least 2013 and that's when it was likely originally created. – pferg Mar 19 at 17:47
  • { "walletname": "", "walletversion": 10500, "balance": 0.00000000, "unconfirmed_balance": 0.00000000, "immature_balance": 0.00000000, "txcount": 2019, "keypoololdest": 1583432175, "keypoolsize": 99, "paytxfee": 0.00005000, "private_keys_enabled": true, "avoid_reuse": false, "scanning": false } – pferg Mar 19 at 17:48
3

The problem is that your wallet version is extremely old - it predates support for compressed public keys (which was added in v0.6.0, released in March 2012). As segwit addresses require compressed public keys, Bitcoin Core is failing with the keys you have, and defaulting to legacy addresses instead.

The solution is restart with -upgradewallet (just once), which will update the wallet to the latest version but break compatibility with old Bitcoin Core versions. Note that you'll need a new backup after doing so.

| improve this answer | |
  • Thank you, Pieter. We have restarted with '-upgradewallet' and now the 'getwalletinfo' command returns this: { "walletname": "", "walletversion": 169900, "balance": 0.00000000, "unconfirmed_balance": 0.00000000, "immature_balance": 0.00000000, "txcount": 2019, "keypoololdest": 1584640664, "keypoolsize": 195, "keypoolsize_hd_internal": 5, "paytxfee": 0.00005000, "hdseedid": "f68ec1b30d87a265effc2735fcc0bc4aabbbc5f8", "private_keys_enabled": true, "avoid_reuse": false, "scanning": false } – pferg Mar 19 at 18:05
  • However, we are still only able to generate addresses that begin with a "1" – pferg Mar 19 at 18:06
  • And is the problem solved? – Pieter Wuille Mar 19 at 18:06
  • 1
    Ah, it may be the case that your keypool still has uncompressed public keys which you need to cycle through (running getnewaddress 100 times should do it). Make backups of wallet.dat frequently – Pieter Wuille Mar 19 at 18:11
  • 1
    Hello Pieter - you were right. We had to run 'getnewaddress' about 85 times and then the bech32 address just started to appear. Thank you you are a true hero of Bitcoin. – pferg Mar 19 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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