<p>Your bitcoin client is generating a <a href="https://bitcoin.stackexchange.com/questions/66428/what-is-the-size-of-different-bitcoin-transaction-types">P2WPKH (bech32 encoded) address</a>, which is a newer address format <a href="https://bitcoin.stackexchange.com/questions/78930/benefits-of-bech32-addresses">which has some benefits compared to legacy formats</a>. The address is valid, but for whatever reason, the exchange mentioned has not upgraded it's code to recognize and send to this address type yet.</p>
<p>The fix is easy: you just need to tell bitcoin-core to generate a legacy address. You can use the following command:</p>
<p><code>$ bitcoin-cli getnewaddress &quot;(address_label)&quot; &quot;legacy&quot;</code></p>
<p>You can substitute your own label in for the (address_label), this is just for local book-keeping purposes, it can also just be left blank if you'd like:</p>
<p><code>$ bitcoin-cli getnewaddress &quot;&quot; &quot;legacy&quot;</code></p>

CC BY-SA 4.0
2020-11-26T20:51:13.183Z
2020-11-26T20:51:13.183Z
chytrik
<p>I set up bitcoind, and the complete blockchain is synced. I created a wallet, and I loaded the wallet.</p>
<p>How can I generate an address to deposit BTC to? I tried <code>bitcoin-cli getnewaddress</code> and I get this address <code>bc1q4mglxdp28f693lw476fnmcesq25tmfkcsfqnpk</code>, but at the Huobi exchange when I try to withdraw 0.001 BTC to that address as a test, I get the message &quot;Invalid address.&quot;</p>
<p>What am I doing wrong? How can I create a valid BTC address on my loaded wallet to send BTC to?</p>

<bitcoind><bitcoin-cli><address-generation><address-format>
How to generate valid BTC address to withdraw coins to
kintsukuroi
# How to generate valid BTC address to withdraw coins to

(Asked by: username_0 on 2020-11-26)

I set up bitcoind, and the complete blockchain is synced. I created a wallet, and I loaded the wallet.

How can I generate an address to deposit BTC to? I tried `bitcoin-cli getnewaddress` and I get this address `bc1q4mglxdp28f693lw476fnmcesq25tmfkcsfqnpk`, but at the Huobi exchange when I try to withdraw 0.001 BTC to that address as a test, I get the message "Invalid address."

What am I doing wrong? How can I create a valid BTC address on my loaded wallet to send BTC to?

**Tags:** bitcoind, bitcoin-cli, address-generation, address-format


---

## 1 answers

### Answer by username_1 on 2020-11-26. Score: 2 | Accepted answer

Your bitcoin client is generating a [P2WPKH (bech32 encoded) address](https://bitcoin.stackexchange.com/questions/66428/what-is-the-size-of-different-bitcoin-transaction-types), which is a newer address format [which has some benefits compared to legacy formats](https://bitcoin.stackexchange.com/questions/78930/benefits-of-bech32-addresses). The address is valid, but for whatever reason, the exchange mentioned has not upgraded it's code to recognize and send to this address type yet.

The fix is easy: you just need to tell bitcoin-core to generate a legacy address. You can use the following command:

`$ bitcoin-cli getnewaddress "(address_label)" "legacy"`

You can substitute your own label in for the (address\_label), this is just for local book-keeping purposes, it can also just be left blank if you'd like:

`$ bitcoin-cli getnewaddress "" "legacy"`


---

