When you pay from a P2SH address, does its change go into a P2SH address too?

2

Because that means you must always keep the redeem script around to make the change addresses, and if it's a multisignature script, then you'll need to have the script with those public keys around, ready to go too.

randomshinichi

Posted 2018-06-25T12:09:19.767

Reputation: 55

Answers

1

When you pay from a P2SH address, does its change go into a P2SH address too?

No. Not necessarily. You can include p2pkh/p2sh/p2wpkh/p2wsh outputs.

Because that means you must always keep the redeem script around to make the change addresses

  • If you consume P2(W?)SH UTXOs to produce new P2(W?)SH outputs, you generally keep the redeem script or communicate them well in advance with the recipient (if not yourself).

  • If you consume P2(W?)SH UTXOs to produce new P2(W?)PKH outputs, you do not need to communicate the redeem script as the recipient can work it out themselves.

renlord

Posted 2018-06-25T12:09:19.767

Reputation: 2 167

0

No, the change output can go to any kind of address.

There is no link between the input and output address types. Some wallets, however, do make the change address a P2SH one if you are sending from a native segwit address to a regular P2SH or P2PKH address to help obfuscate which output is the change a bit more.

Raghav Sood

Posted 2018-06-25T12:09:19.767

Reputation: 10 897