I'm trying to calculate the weight of a 2-of-3 multisignature P2SH-P2WSH input. I found the related question Predict multi signature transaction size, which I've calculated out with
m=2, n=3 here:
pubkeySize=33 sigSize=72 SizeOfRedeemScript = 1+n*(1+pubkeySize)+1+1 // 2-of-3: SizeOfRedeemScript = 1+3*(1+33)+1+1 = 105 SizeOfScriptSig = 1+m*(1+sigSize)+SizeOfPushDataFor(RedeemScript)+SizeOfRedeemScript // 2-of-3: SizeOfScriptSig = 1+2*(1+72)+2+105 = 1 + 146 + 2 + 105 = 254 sizeOf(input) = 32+4+SizeOfCsuintFor(SizeOfScriptSig) + SizeOfScriptSig + 4 // 2-of-3: sizeOf(input) = 32+4+3+254+4 = 297
The size of 2-of-3 input in P2SH has 293 to 297 bytes1. Thus, this would correspond to up to
297*4 = 1188 bytes weight (BW).
How would I calculate the same BW for a 2-of-3 multisignature P2SH-P2WSH input?
1Correction: Note that if both signatures are 71 bytes, the scriptSig is 252 bytes which as a length can be encoded in 1 byte, but in the worst case both signatures are 72 bytes and the length of the scriptSig needs 3 bytes.