Title: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"? Post by: FractalEncrypt on February 10, 2020, 11:28:08 PM 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
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 Title: Re: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"? Post by: BitMaxz on February 10, 2020, 11:59:56 PM Check this post on how to generate multiple addresses at once from here "Generate Multiple Wallet Addresses" (https://bitcointalk.org/index.php?topic=2568147.msg26163360#msg26163360)
Try to add this on bitcoin.conf Code: addresstype=legacy Don't forget to make a backup of bitcoin.conf in case you experience some issue you can revert it back. Title: Re: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"? Post by: FractalEncrypt on February 11, 2020, 12:18:51 AM 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)? Title: Re: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"? Post by: HCP on February 11, 2020, 01:17:10 AM 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". ::) If you have a look in your "Window -> Receiving Addresses" list, you'll see a bunch of addresses with those labels! :P 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" 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) Title: Re: Why 2 address types in Testnet Bitcoin QT console and "Receive Tab"? Post by: FractalEncrypt on February 11, 2020, 12:25:13 PM 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". ::) If you have a look in your "Window -> Receiving Addresses" list, you'll see a bunch of addresses with those labels! :P 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" 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 :) |