Post
Topic
Board Development & Technical Discussion
Re: What do you think of this change on the GUI
by
achow101
on 04/03/2018, 06:41:10 UTC
What's the actual-bytes transaction size (or, well, per-input size) in the case of P2SH-P2WPKH versus P2PKH or "legacy" single-key P2SH?
The actual byte size for a P2PKH input is 148 bytes. For a P2SH-P2WPKH input, it is 171 bytes. For a P2WPKH it's also 148 bytes.

However the actual byte size doesn't really matter. Blocks are not limited by size but rather by weight. And transaction fees are actually by weight or virtual size (weight/4) and not actual size. So th weight for a P2PKH output is 592. For P2SH-P2WPKH it is 360 and P2WPKH it is 268. So as you can see, the segwit inputs consume less weight and are thus cheaper to spend.

Is it currently possible to sign a message with a P2SH-P2WPKH address?
No. There is no standard for signing messages with segwit addresses yet. That's something that is being worked on. Note that messages aren't actually signed with an address. Rather they are signed with a public-private key pair which can correspond to multiple addresses. Your wallet software will calculate the public key for a message and convert that into an address. A wallet could just as easily show you a P2SH-P2WPKH or P2WPKH address instead of a P2PKH address when it is verifying a signed message. What needs to happen is a specification for signing messages with a script which can thus be generalized to signing with an address. Such messages and signatures would actually correspond to addresses and not a public key which your wallet just turns into an address.