<p><a href="https://en.bitcoin.it/wiki/Transaction_fees" rel="nofollow">https://en.bitcoin.it/wiki/Transaction_fees</a>
Those are rules about calculating fees.</p>

<p>Considering algorithms, i think you should check all possiblities (brute-force) or it could be also some kind of knapsack problem.</p>

CC BY-SA 3.0
2013-07-31T19:18:45.490Z
2013-07-31T19:18:45.490Z
ripazha
<p>I'm attempting to use the <code>createrawtransaction</code> to manually create my transactions and I want to (obviously) reduce my fees. The complication I'm having is that I want to send <strong>ALL</strong> of the bitcoins in my wallet to 2 parties. So I know that I can specify the inputs and outputs, but there's that pesky fee concept which makes it difficult to just spend it all.</p>

<p>So if I have 5 inputs and 2 outputs, how would I go about calculating exactly what the fee will be and reducing it?</p>

<transaction-fees><api><json-rpc>
What's a good algorithm for reducing Transaction fees?
Shamoon
# What's a good algorithm for reducing Transaction fees?

(Asked by: username_0 on 2013-07-29)

I'm attempting to use the `createrawtransaction` to manually create my transactions and I want to (obviously) reduce my fees. The complication I'm having is that I want to send **ALL** of the bitcoins in my wallet to 2 parties. So I know that I can specify the inputs and outputs, but there's that pesky fee concept which makes it difficult to just spend it all.

So if I have 5 inputs and 2 outputs, how would I go about calculating exactly what the fee will be and reducing it?

**Tags:** transaction-fees, api, json-rpc


---

## 1 answers

### Answer by username_1 on 2013-07-31. Score: 2 | Accepted answer

<https://en.bitcoin.it/wiki/Transaction_fees>
Those are rules about calculating fees.

Considering algorithms, i think you should check all possiblities (brute-force) or it could be also some kind of knapsack problem.


---

