Can getnewaddress return base58 address and not bech32 address? #21990

issue liorko87 opened this issue on May 18, 2021
  1. liorko87 commented at 10:40 AM on May 18, 2021: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    Expected behavior getneewaddress returns base58 encoding address.

    <!--- What behavior did you expect? -->

    Actual behavior When I'm calling getneewaddress, I'm getting bech32 encoding address.

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    System information

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    bitcoin core 0.21.0, Ubuntu 20.04.1 LTS

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. liorko87 added the label Bug on May 18, 2021
  3. jonatack commented at 11:49 AM on May 18, 2021: member

    Hi @liorko87, bech32 is the default, but the getnewaddress help explains how you can set the address type:

    $ bitcoin-cli 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".
    

    You can also set it for your node as a configuration option on the command line when starting the node or in your bitcoin.conf file:

    $ bitcoind -h | grep -C1 "What type of addresses to use"
      -addresstype
           What type of addresses to use ("legacy", "p2sh-segwit", or "bech32",
           default: "bech32")
    
  4. liorko87 closed this on May 18, 2021

  5. fanquake removed the label Bug on May 19, 2021
  6. DrahtBot locked this on Aug 18, 2022
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-25 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me