1

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?

user789235
  • 136
  • 2
  • 6

1 Answers1

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