Author

Topic: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"? (Read 142 times)

newbie
Activity: 21
Merit: 11
Your problem is that getnewaddress actually takes TWO arguments... the first is "label"... and the second one is "address_type"

Quote from: help getnewaddress
getnewaddress ( "label" "address_type" )

Returns a new Bitcoin address for receiving payments.
If 'label' is specified, it is added to the address book
so payments received with the address will be associated with 'label'.

Arguments:
1. label           (string, optional, default="") The label name for the address to be linked to. It can also be set to the empty string "" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name.
2. address_type    (string, optional, default=set by -addresstype) The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".

So, what you have done is generate a bunch of the "default type" addresses and labelled them "bech32" and "legacy" and "p2sh-segwit". Roll Eyes If you have a look in your "Window -> Receiving Addresses" list, you'll see a bunch of addresses with those labels! Tongue


NOTE: while it says "label" is optional, that really means you just don't need to populate it and can use an empty string ie. "". BUT if you're going to include arguments AFTER it, it still needs to be specified. You need to use the "address_type", so you MUST specify the label. This means that if you want to generate new addresses on the console you need to use:
Code:
getnewaddress "" "p2sh-segwit"
getnewaddress "" "bech32"
getnewaddress "" "legacy"


NOTE2: setting the value in .conf file simply sets the default "address_type" that will be used if you don't specify anything when using getnewaddress command. You can still override that (ie. have address_type=bech32 in .conf, but use getnewaddress "" "legacy" on the console)

Awesome, thanks! makes perfect sense, and whoops, yes labelled Smiley
HCP
legendary
Activity: 2086
Merit: 4361
Your problem is that getnewaddress actually takes TWO arguments... the first is "label"... and the second one is "address_type"

Quote from: help getnewaddress
getnewaddress ( "label" "address_type" )

Returns a new Bitcoin address for receiving payments.
If 'label' is specified, it is added to the address book
so payments received with the address will be associated with 'label'.

Arguments:
1. label           (string, optional, default="") The label name for the address to be linked to. It can also be set to the empty string "" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name.
2. address_type    (string, optional, default=set by -addresstype) The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".

So, what you have done is generate a bunch of the "default type" addresses and labelled them "bech32" and "legacy" and "p2sh-segwit". Roll Eyes If you have a look in your "Window -> Receiving Addresses" list, you'll see a bunch of addresses with those labels! Tongue


NOTE: while it says "label" is optional, that really means you just don't need to populate it and can use an empty string ie. "". BUT if you're going to include arguments AFTER it, it still needs to be specified. You need to use the "address_type", so you MUST specify the label. This means that if you want to generate new addresses on the console you need to use:
Code:
getnewaddress "" "p2sh-segwit"
getnewaddress "" "bech32"
getnewaddress "" "legacy"


NOTE2: setting the value in .conf file simply sets the default "address_type" that will be used if you don't specify anything when using getnewaddress command. You can still override that (ie. have address_type=bech32 in .conf, but use getnewaddress "" "legacy" on the console)
newbie
Activity: 21
Merit: 11
Thanks!
now I get this...
mrLuuW2hwraLWa3tSjTde9e25xuCk2xyvQ

if I make it say this in the conf;
addresstype=bech32
changetype=bech32

I get this
n2HaJyTFXbBGABtyi5puhCQS6NFw4SxKyB


if I change .CONF to;
addresstype=p2sh-segwit
changetype=p2sh-segwit

I get this;
mmwKf8knfPpFodAcxxMd3dghzLHiNkqCXX

what's the difference between these and the tb1 addresses (and the "2" addresses)?
legendary
Activity: 3374
Merit: 3095
BTC price road to $80k
Check this post on how to generate multiple addresses at once from here "Generate Multiple Wallet Addresses"

Try to add this on bitcoin.conf
Code:
addresstype=legacy
changetype=legacy
Then generate a new address using getnewaddress command.

Don't forget to make a backup of bitcoin.conf in case you experience some issue you can revert it back.
newbie
Activity: 21
Merit: 11
I have a question about generating new addresses in Bitcoin QT on testnet.

Questions:
1. Can I generate 10 addresses at a time, if so, what's the command?

2. Why can I only create Testnet P2SH addresses in the console?
(when I click the "Create New Receiving Address" button in the receive tab of QT, I get a bech32 address, like this; tb1q5h7tk85rjwwap4jsxlje8kl9mfr20c7qghx6qa)



In the console, when I run getnewaddress, I only get P2SH addresses, am I doing something wrong here?
Here are a few commands and the resulting addresses

  • getnewaddress "p2sh-segwit"
    2NGQJDo2aAPE8CHGxEc48BJ4S9GzqQujhVF

    getnewaddress "legacy"
    2NAoHS6cfN4oVj9tJrmTgbNEjtHpjyW26RZ

    getnewaddress "bech32"
    2N3ppZqJdDKQfQKyFxmbLhoiVSzjk6KfybU

    getnewaddress ("bech32")
    2N3e1F587BJBPatxThFBt4oyiU3gPr1zos4

    getnewaddress '("bech32")'
    2N2VbaEmjmB2rJ49mgZEYRCunAxG727Xj5a




Bitcoin Client Software and Version Number: Testnet Bitcoin Core 0.19.1
Operating System: Windows 10 64-bit
System Hardware Specs: AMD threadripper 2950x 16-core with 32gb memory
Description of Problem: Unable to create bech32 addresses in testnet QT console
Any Related Addresses: None
Any Related Transaction IDs: None
Screenshot of the problem: NA
Log Files from the Bitcoin Client: NA

Jump to: