user19385: I was looking for answer everywhere.
Basically is there any way of calculate multi-sig transaction size when the transaction is creating, before the signing procedure? I was trying to find any pattern for that, with no results.
Informations I have:

num of inputs;
num of outputs;
num of required signatures

I will appreciate any clue to solve this problem.

user11123: pubkeySize=33
sigSize=72


SizeOfRedeemScript = 1+n*pubkeySize+1+1
SizeOfScriptSig = 1+m*(1+sigSize)+SizeOfVarIntFor(RedeemScript)+SizeOfRedeemScript
sizeOf(input) = 32+4+SizeOfVarIntFor(SizeOfScriptSig) + SizeOfScriptSig + 4

SizeOfScriptPubKey = SizeOfVarIntFor(SizeOfRedeemScript) + len(script)
sizeOf(output) = 8 + SizeOfScriptPubKey

sizeOf(tx) = 4 + SizeOfVarIntFor(numInputs) + sum(SizeOfInputsArray) + SizeOfVarIntFor(numOutputs) + sum(SizeOfOutputsArray) + 4

Basically, once you know m & n (for your multisig), whether public keys are compressed (pubkeySize), plus the number of inputs and outputs, plus the types of outputs, you can come up with a pretty accurate figure for the size. 

19385: <p>I was looking for answer everywhere.
Basically is there any way of calculate multi-sig transaction size when the transaction is creating, before the signing procedure? I was trying to find any pattern for that, with no results.</p>

<p>Informations I have:</p>

<ul>
<li>num of inputs;</li>
<li>num of outputs;</li>
<li>num of required signatures</li>
</ul>

<p>I will appreciate any clue to solve this problem.</p>
 11123: <pre><code>pubkeySize=33
sigSize=72


SizeOfRedeemScript = 1+n*pubkeySize+1+1
SizeOfScriptSig = 1+m*(1+sigSize)+SizeOfVarIntFor(RedeemScript)+SizeOfRedeemScript
sizeOf(input) = 32+4+SizeOfVarIntFor(SizeOfScriptSig) + SizeOfScriptSig + 4

SizeOfScriptPubKey = SizeOfVarIntFor(SizeOfRedeemScript) + len(script)
sizeOf(output) = 8 + SizeOfScriptPubKey

sizeOf(tx) = 4 + SizeOfVarIntFor(numInputs) + sum(SizeOfInputsArray) + SizeOfVarIntFor(numOutputs) + sum(SizeOfOutputsArray) + 4
</code></pre>

<p>Basically, once you know m &amp; n (for your multisig), whether public keys are compressed (pubkeySize), plus the number of inputs and outputs, plus the types of outputs, you can come up with a pretty accurate figure for the size. </p>
