<p>To roughly calculate transaction send size in bytes we do:</p>

<pre><code>((numberOfInputs*148)+(numberOfOutputs*34)+10)
</code></pre>

<blockquote>
  <p>We want to make a transaction using two inputs of 0.01BTC (Amount to send = 0.015BTC, change left over = 0.005BTC). Number of outputs in this case will be two; as we have two inputs, one of which we are 'tearing-in-two' creating change that will be sent back to us (we are the second output so the change is not lost).</p>
</blockquote>

<p>So to calculate the fee</p>

<ul>
<li>We calculate the value of each input in BTC multiplied by the age of the input in blocks </li>
<li>Add up all the answers into a total priority</li>
<li>Divide the priority by the size of the transaction in bytes</li>
<li>If this gives a number less than 0.576 then the transaction requires a fee</li>
<li>Also if the transaction size exceeds 1000 bytes it requires a fee</li>
</ul>

<p>If both inputs were <strong>1000</strong> conformations old, a fee would be required:</p>

<pre><code>((0.01*1000) + (0.01*1000)) = 20 //priority
((2*148)+(2*34)+10) = 374 //bytes
20 / 374 = 0.053475935828877004
</code></pre>

<p>If both inputs were <strong>11000</strong> conformations old, a fee would <strong>not</strong> be required:</p>

<pre><code>((0.01*11000) + (0.01*11000)) = 220 //priority
((2*148)+(2*34)+10) = 374 //bytes
220 / 374 = 0.5882352941176471
</code></pre>

<p>Is this correct? </p>

<p>If one input was old dust and the other new and large (this looks free to me):</p>

<pre><code>((0.00001*11000) + (1*1000)) = 1000.11 //priority
((2*148)+(2*34)+10) = 374 //bytes
1000.11 / 374 = 2.6740909090909093
</code></pre>

<p>Does this explain how you can put a dust-input with a large-input to rescue dust?</p>

<p>Will the threshold of 0.576 change in the future and if so how will we find out?</p>

CC BY-SA 3.0
2014-06-11T07:04:15.480Z
where does you initial formula come from? Is it form you or from some wiki?
Dennis Kriechel
CC BY-SA 3.0
2014-06-11T13:50:50.543Z
http://bitcoinfees.com
BENZ.404
CC BY-SA 3.0
2017-06-20T07:07:26.637Z
The whole section about priority is not relevant anymore; free transaction mining doesn't happen in any significant amount anymore and software support for it has been removed in various places. Every transaction just pays bytes * feerate in fee.
Pieter Wuille
<transaction-fees><dust><coin-age-priority>
Calculation for transaction input-output balling:
BENZ.404
# Calculation for transaction input-output balling:

(Asked by: username_0 on 2014-06-11)

To roughly calculate transaction send size in bytes we do:

```
((numberOfInputs*148)+(numberOfOutputs*34)+10)

```

> We want to make a transaction using two inputs of 0.01BTC (Amount to send = 0.015BTC, change left over = 0.005BTC). Number of outputs in this case will be two; as we have two inputs, one of which we are 'tearing-in-two' creating change that will be sent back to us (we are the second output so the change is not lost).

So to calculate the fee

* We calculate the value of each input in BTC multiplied by the age of the input in blocks
* Add up all the answers into a total priority
* Divide the priority by the size of the transaction in bytes
* If this gives a number less than 0.576 then the transaction requires a fee
* Also if the transaction size exceeds 1000 bytes it requires a fee

If both inputs were **1000** conformations old, a fee would be required:

```
((0.01*1000) + (0.01*1000)) = 20 //priority
((2*148)+(2*34)+10) = 374 //bytes
20 / 374 = 0.053475935828877004

```

If both inputs were **11000** conformations old, a fee would **not** be required:

```
((0.01*11000) + (0.01*11000)) = 220 //priority
((2*148)+(2*34)+10) = 374 //bytes
220 / 374 = 0.5882352941176471

```

Is this correct?

If one input was old dust and the other new and large (this looks free to me):

```
((0.00001*11000) + (1*1000)) = 1000.11 //priority
((2*148)+(2*34)+10) = 374 //bytes
1000.11 / 374 = 2.6740909090909093

```

Does this explain how you can put a dust-input with a large-input to rescue dust?

Will the threshold of 0.576 change in the future and if so how will we find out?

**Tags:** transaction-fees, dust, coin-age-priority

> **Comments:**
> **username_1**: where does you initial formula come from? Is it form you or from some wiki?  
> **username_0**: http://bitcoinfees.com  
> **username_2**: The whole section about priority is not relevant anymore; free transaction mining doesn't happen in any significant amount anymore and software support for it has been removed in various places. Every transaction just pays bytes * feerate in fee.  

---

## 0 answers

