<p>When I use <code>bitcoin-cli getnewaddress "" "p2sh-segwit"</code> which kind of script is inside And can I convert if in bech32?</p>

CC BY-SA 4.0
2020-04-09T15:59:05.437Z
Does this answer your question? [Confusion about Addresses](https://bitcoin.stackexchange.com/questions/95006/confusion-about-addresses)
MCCCS
CC BY-SA 4.0
2020-04-09T20:51:28.010Z
You should never *ever* try to convert an address from one format into another, as you don't know what type the receiver software expects. If you want a particular type address, ask for it.
Pieter Wuille
CC BY-SA 4.0
2020-04-10T06:34:09.523Z
@MCCCS thanks. What kind of redeem script Can I have If I get p2sh? What is default script?
foo_bar
CC BY-SA 4.0
2020-04-13T21:52:56.420Z
"legacy" will give you a P2PKH script. "bech32" will give you a P2WPKH script. "p2sh-segwit" will give you a P2SH-P2WPKH (a P2SH script with a P2WPKH redeemScript).
Pieter Wuille
<segregated-witness><p2sh><bech32-address>
Generate p2sh-segwit and address bech32
foo_bar
# Generate p2sh-segwit and address bech32

(Asked by: username_0 on 2020-04-09)

When I use `bitcoin-cli getnewaddress "" "p2sh-segwit"` which kind of script is inside And can I convert if in bech32?

**Tags:** segregated-witness, p2sh, bech32-address

> **Comments:**
> **username_1**: Does this answer your question? [Confusion about Addresses](https://bitcoin.stackexchange.com/questions/95006/confusion-about-addresses)  
> **username_2**: You should never *ever* try to convert an address from one format into another, as you don't know what type the receiver software expects. If you want a particular type address, ask for it.  
> **username_0**: @username_1 thanks. What kind of redeem script Can I have If I get p2sh? What is default script?  
> **username_2**: "legacy" will give you a P2PKH script. "bech32" will give you a P2WPKH script. "p2sh-segwit" will give you a P2SH-P2WPKH (a P2SH script with a P2WPKH redeemScript).  

---

## 0 answers

