Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: asche on January 08, 2019, 07:55:50 PM



Title: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: asche on January 08, 2019, 07:55:50 PM
Hello all,

I have noticed something with Bitcoin Core's latest version.

Not sure if it's a problem with me, or with the app, maybe you can help me out here.

So until now I had only used non segwit adresses. Now I seem to be unable to generate new non segwit adresses. I only get segwit (starting with 3) or native segwit - bech32 (starting with bc).

Neither of which I can use to sign a message obviously.

https://i.imgur.com/0MUmGLE.jpg
https://i.imgur.com/jvIOhDM.jpg
https://i.imgur.com/wpv5wc1.jpg

Can you help me, or is this a bug?


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: Carlton Banks on January 08, 2019, 08:11:49 PM
You need to start Bitcoin with -addresstype=legacy added to the command. Then the wallet will generate the old style addresses.



Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: asche on January 08, 2019, 08:13:41 PM
You need to start Bitcoin with -addresstype=legacy added to the command. Then the wallet will generate the old style addresses.



thank you man.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: darosior on January 08, 2019, 08:14:37 PM
Hi,

since you are on windows maybe you don't start bitcoin-core using the command line. You can still generate new legacy addresses by typing
Code:
getnewaddress "testLegacy" legacy
on the debug window.

Ref : https://bitcoincore.org/en/doc/0.17.0/rpc/wallet/getnewaddress/


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: achow101 on January 08, 2019, 11:11:40 PM
You need to start Bitcoin with -addresstype=legacy added to the command. Then the wallet will generate the old style addresses.
It can be added to the bitcoin.conf file as addresstype=legacy. No need to change the startup command, especially for users who don't know how to do that.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: bones261 on January 09, 2019, 01:51:05 AM
You need to start Bitcoin with -addresstype=legacy added to the command. Then the wallet will generate the old style addresses.
It can be added to the bitcoin.conf file as addresstype=legacy. No need to change the startup command, especially for users who don't know how to do that.

Can you start up your node with the switch; generate a legacy address; sign a message; close the wallet; then open the wallet normally; and go back to generating segwit addresses? I'm thinking to OP only wants to generate a P2PKH to sign a message.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: achow101 on January 09, 2019, 02:00:23 AM
You need to start Bitcoin with -addresstype=legacy added to the command. Then the wallet will generate the old style addresses.
It can be added to the bitcoin.conf file as addresstype=legacy. No need to change the startup command, especially for users who don't know how to do that.

Can you start up your node with the switch; generate a legacy address; sign a message; close the wallet; then open the wallet normally; and go back to generating segwit addresses? I'm thinking to OP only wants to generate a P2PKH to sign a message.
Certainly. It's not a setting in the wallet file itself so this isn't persisted. Or OP can just use the getnewaddress command mentioned earlier.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: buwaytress on January 09, 2019, 12:20:48 PM
Sorry to ask a stupid question, but does this mean it's possible to have legacy and SegWit addresses in one wallet? From the discussions seems it's possible but I had always thought this couldn't be the case and still maintain 2 wallets. Or does the getnewaddress command also generate a new wallet? If Bitcoin Core could do that then it solves one of my old issues (providing legacy address but maintaining in same wallet).


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: asche on January 09, 2019, 12:38:11 PM
Sorry to ask a stupid question, but does this mean it's possible to have legacy and SegWit addresses in one wallet? From the discussions seems it's possible but I had always thought this couldn't be the case and still maintain 2 wallets. Or does the getnewaddress command also generate a new wallet? If Bitcoin Core could do that then it solves one of my old issues (providing legacy address but maintaining in same wallet).

Yes it is possible to have both - see screenshot.
I think it is because Segwit is backwards compatible (being a soft fork).


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: HeRetiK on January 09, 2019, 01:29:22 PM
Sorry to ask a stupid question, but does this mean it's possible to have legacy and SegWit addresses in one wallet? From the discussions seems it's possible but I had always thought this couldn't be the case and still maintain 2 wallets. Or does the getnewaddress command also generate a new wallet? If Bitcoin Core could do that then it solves one of my old issues (providing legacy address but maintaining in same wallet).

Yes it is possible to have both - see screenshot.
I think it is because Segwit is backwards compatible (being a soft fork).

SegWit being a soft fork has nothing to do with the way Bitcoin addresses are generated.

Good question though. From what I've gathered so far P2SH-SegWit and native Bech32 SegWit addresses follow different derivation paths, but I guess legacy addresses and P2SH-SegWit addresses share the same derivation path? Or maybe that's just specific to Bitcoin Core's HD Wallet implementation?


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: asche on January 09, 2019, 01:31:55 PM
SegWit being a soft fork has nothing to do with the way Bitcoin addresses are generated.

Good question though. From what I've gathered so far P2SH-SegWit and native Bech32 SegWit addresses follow different derivation paths, but I guess legacy addresses and P2SH-SegWit addresses share the same derivation path? Or maybe that's just specific to Bitcoin Core's HD Wallet implementation?

It actually does in my opinion. Their use is backwards compatible. Being able to receive through non segwit and send through segwit or the other way around is dependent to the fact it is a soft fork.

A hard fork would indeed make you have two wallets since there is no compatibility.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: achow101 on January 09, 2019, 03:57:34 PM
Sorry to ask a stupid question, but does this mean it's possible to have legacy and SegWit addresses in one wallet?
Yes.

Or does the getnewaddress command also generate a new wallet?
No, it does not generate a new wallet.

Good question though. From what I've gathered so far P2SH-SegWit and native Bech32 SegWit addresses follow different derivation paths, but I guess legacy addresses and P2SH-SegWit addresses share the same derivation path? Or maybe that's just specific to Bitcoin Core's HD Wallet implementation?
Bitcoin Core does not use different derivation paths for different address types. They are all derived using the same derivation path because keys are derived before the address type is known.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: buwaytress on January 10, 2019, 10:43:36 AM
@achow thanks for that. Am quite surprised to learn this only now... Been using two different wallets just to have both Segwit and legacy. Now understand that Electrum has separate derivation paths.

Do you know of any other client other than Bitcoin Core that allows for this? (Legacy amd Segwit address in 1 wallet)


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: Lauda on January 10, 2019, 11:00:38 AM
Do you know of any other client other than Bitcoin Core that allows for this? (Legacy amd Segwit address in 1 wallet)
Not sure about desktop clients, but Samurai has this capability (Mobile). You can turn Segwit address generation on/off with 1 checkbox.


Title: Re: Bitcoin Core 0.17.1 unable to create non segwit adresses
Post by: achow101 on January 10, 2019, 05:06:14 PM
Do you know of any other client other than Bitcoin Core that allows for this? (Legacy amd Segwit address in 1 wallet)
IIRC Armory allows you to have both address types in one wallet. This is because they also generate keys before the address type is known.