3

A P2WPKH PubKey is shorter than a P2WSH PubKey. Would this also be the case that a Taproot PubKey is larger than a Schnorr PubKey? If so, wouldn't people be incentivised to use the Schnorr PubKey and as a result Taproot would be less fungible?

6

A P2WPKH PubKey is shorter than a P2WSH PubKey.

No, not quite. A p2wpkh address is shorter than a p2wsh address. The addresses are both based on a hash of the underlying witness program (i.e. the locking conditions of the output). In the case of pay-to-witness-pubkey-hash (p2wpkh) the witness program contains only the pubkey. On the other hand, pay-to-witness-script-hash (p2wsh) doesn't have a pubkey, its witness program consists of a witness script. P2wpkh and p2wsh addresses differ in length, because the hash for p2wpkh is a RIPEMD-160 hash which produces a digest of 20 byte (160 bit), while the hash for p2wsh is a SHA-256d hash which produces a 32 byte (256 bit) digest. Thus, the address for p2wsh simply has to encode 12 bytes more data and is that much longer.

Regarding Taproot and Schnorr, the outputs are actually indistinguishable, either commits the funds to a public key. In fact, if the spender doesn't make use of the taproot, but spends the output using the internal key, they remain indistinguishable even at spending time.

So, all SegWit V1 outputs are always the same length, while the inputs may differ in size depending on how they got spent. Actually, they aren't categorized as two different output types, they are all categorized as pay-to-taproot (p2tr). Since the encoding used for public keys in p2tr is also 32 bytes, p2tr outputs end up being the same length as p2wsh outputs: 43 bytes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.