<p>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. </p>

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

<p><a href="https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending">How to calculate transaction size before sending</a></p>

CC BY-SA 3.0
2017-09-29T07:48:10.110Z
2017-09-29T07:48:10.110Z
Peili Liang
<p>I'm in the process of assembling raw transactions and I have a couple of questions.</p>

<p>I'm using listunspent to get a list of the transactions I can spend....</p>

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

<p>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?</p>

<api>
Createrawtransaction questions
user789235
# Createrawtransaction questions

(Asked by: username_0 on 2014-01-08)

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?

**Tags:** api


---

## 1 answers

### Answer by username_1 on 2017-09-29. Score: 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](https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending)


---

