Bitcoin Forum
February 23, 2020, 04:34:45 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"?  (Read 60 times)
FractalEncrypt
Newbie
*
Offline Offline

Activity: 11
Merit: 6


View Profile
February 10, 2020, 11:28:08 PM
Merited by LoyceV (2)
 #1

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

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1582432485
Hero Member
*
Offline Offline

Posts: 1582432485

View Profile Personal Message (Offline)

Ignore
1582432485
Reply with quote  #2

1582432485
Report to moderator
1582432485
Hero Member
*
Offline Offline

Posts: 1582432485

View Profile Personal Message (Offline)

Ignore
1582432485
Reply with quote  #2

1582432485
Report to moderator
BitMaxz
Legendary
*
Offline Offline

Activity: 1708
Merit: 1339


Beware on fake ledger nano, trezor and electrum.


View Profile WWW
February 10, 2020, 11:59:56 PM
 #2

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.

FractalEncrypt
Newbie
*
Offline Offline

Activity: 11
Merit: 6


View Profile
February 11, 2020, 12:18:51 AM
 #3

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)?
HCP
Legendary
*
Offline Offline

Activity: 1246
Merit: 2264

<insert witty quote here>


View Profile
February 11, 2020, 01:17:10 AM
Merited by nc50lc (1), Heisenberg_Hunter (1)
 #4

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)

FractalEncrypt
Newbie
*
Offline Offline

Activity: 11
Merit: 6


View Profile
February 11, 2020, 12:25:13 PM
 #5

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
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!