Yes @Terminada, you have the idea… although with the transactions I myself am generally assembling at the command line (no token minting or smart contracts) it’s hard to imagine even a single iteration of the recursion being required: since
- simply putting actual values for the transaction inputs is guaranteed to calculate accurate byte lengths for those transaction fields;
- putting a generous figure like
200000or even300000for the yet-unknown transaction fee will likely not use more bytes for the fee field, and will never use less (since the Tx fee will never exceed such a value).
Since I don’t know whether these are bit fields rather than discrete sets of bytes, there could be conditions of overlap in which small changes in fee could make whole-byte differences… but if all values are the same or in excess of the actual transaction figures, then I don’t see how iteration would ever be required: just a valid first approximation.