VincentDebug / go-ord-tx

golang ordinals btc nft inscribe tx
Creative Commons Zero v1.0 Universal
90 stars 41 forks source link

Clarification on Fee Calculation for SegWit Transactions #13

Open jaxonly opened 7 months ago

jaxonly commented 7 months ago

I am reviewing the code, and one line caught my attention

fee := (int64(wire.TxWitness{emptySignature, tool.txCtxDataList[i].inscriptionScript, emptyControlBlockWitness}.SerializeSize()+2+3) / 4) * feeRate

Specifically, I am looking to understand the reason for the additional +2+3 in the calculation.

Could you please provide some clarification on the purpose of these added values?

Any insight or reference to the appropriate documentation would be greatly appreciated.

Best Regards