I'm in the process of assembling raw transactions and I have a couple of questions.

I'm using listunspent to get a list of the transactions I can spend....

First, should I select the oldest transaction first for inclusion? Or is there a better way to select transactions?

Second, for calculating the transaction fee, is there an easy way to estimate the size of a transaction? For example, can I say each output is X bytes and each input is Y bytes?

1 Answer 1


You don't have to select the oldest transactions, they are same as the recent transactions in blockchain's utxo view. When building a transaction, you can take the transaction size into consideration, which could affect the transaction fee.

Generally, each output is 148bytes and each input is 34bytes. Here is a more accurate way to calculate transaction fee.

How to calculate transaction size before sending

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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