<p>Make sure you are using Bitcoin-core v0.16 <code>bitcoin-cli getnetworkinfo</code> then in your bitcoin.conf add</p>

<pre><code>addresstype=bech32
</code></pre>

<p>As @Meshcolider comment if you want to get p2sh address you should set:</p>

<pre><code>addresstype=p2sh-segwit
</code></pre>

<p>But I would use bech32 since bech32 produces smaller transactions than P2SH segwit transactions.</p>

<hr>

<p>For Bitcoin-core version 0.15 send </p>

<p><code>bitcoin-cli addwitnessaddress 1BRo7qrYHMPrzdBDzfjmzteBdYAyTMXW75</code></p>

<p>to get p2sh address.</p>

CC BY-SA 3.0
2018-03-09T11:55:35.447Z
After adding, when I use "getnewaddress" , will it give me a segwit address directly?
merklexy
CC BY-SA 3.0
2018-03-10T13:28:43.123Z
Yeah, nothing more required. You are most welcome!
Tailer
CC BY-SA 3.0
2018-03-09T10:32:48.047Z
2018-03-09T16:10:43.627Z
2018-03-09T16:10:43.627Z
Tailer
<p>I am using bitcoind. It generates the BTC addresses(not segregated). How to get segwit addresses? Do I have to change the settings in <code>bitcoin.conf</code> file?  </p>

<p><code>bitcoin-cli getnewaddress</code>  -- generates address that starts with '1'</p>

<bitcoin-core><bitcoind><segregated-witness>
How to generate Segwit address using bitcoind?
merklexy
# How to generate Segwit address using bitcoind?

(Asked by: username_0 on 2018-03-09)

I am using bitcoind. It generates the BTC addresses(not segregated). How to get segwit addresses? Do I have to change the settings in `bitcoin.conf` file?

`bitcoin-cli getnewaddress` -- generates address that starts with '1'

**Tags:** bitcoin-core, bitcoind, segregated-witness


---

## 1 answers

### Answer by username_1 on 2018-03-09. Score: 2 | Accepted answer

Make sure you are using Bitcoin-core v0.16 `bitcoin-cli getnetworkinfo` then in your bitcoin.conf add

```
addresstype=bech32

```

As @Meshcolider comment if you want to get p2sh address you should set:

```
addresstype=p2sh-segwit

```

But I would use bech32 since bech32 produces smaller transactions than P2SH segwit transactions.

---

For Bitcoin-core version 0.15 send

`bitcoin-cli addwitnessaddress 1BRo7qrYHMPrzdBDzfjmzteBdYAyTMXW75`

to get p2sh address.

> **Comments:**
> **username_0**: After adding, when I use "getnewaddress" , will it give me a segwit address directly?  
> **username_1**: Yeah, nothing more required. You are most welcome!  

---

