<p>The function would not work because the transaction fee is based upon the size of the transaction in bytes (well really its weight, which is based on the bytes). While the number of outputs is a factor in this, the other factor is the number of inputs, and what type of inputs they are. So given just the outputs (the value of the outputs doesn't even matter), you still cannot determine how much in transaction fees that you will need to pay. Thus your function <code>F(x, N)</code> would not work.</p>

CC BY-SA 3.0
2018-01-26T17:20:45.260Z
Can you please clarify what additional information is required?
Lizozom
CC BY-SA 3.0
2018-01-26T17:25:02.583Z
The number of inputs and the type of those inputs. If you want to optimize the transaction fee, then your function needs to also be selecting those inputs, and it will get very complicated if you want to do that.
Ava Chow
CC BY-SA 3.0
2018-01-26T17:27:53.207Z
Going to google what input types are out there :)
Lizozom
CC BY-SA 3.0
2018-01-26T17:18:06.183Z
2018-01-26T17:18:06.183Z
Ava Chow
<p>I want to use transaction batching to make BTC payments to multiple recipients.</p>

<p>In order to optimize transaction amount \ size, lets I'm making equal transfers of <strong>x BTC</strong> to <strong>N recipients</strong>, and that <code>F(x, N)</code> is the function representing the transaction fees.</p>

<p>How would this function look like?
How can I calculate it in any given time, to optimize transaction fees?</p>

CC BY-SA 3.0
2018-01-26T16:41:53.843Z
With or without segwit?
pebwindkraft
CC BY-SA 3.0
2018-01-26T17:21:01.280Z
@pebwindkraft both? :)
Lizozom
CC BY-SA 3.0
2018-01-26T20:07:07.347Z
maybe this: https://bitcoin.stackexchange.com/questions/7537/calculator-for-estimated-tx-fees?rq=1 or also this: https://bitcoin.stackexchange.com/questions/22870/createrawtransaction-and-sendrawtransaction-how-to-specify-transaction-fee?rq=1 this is all without segwit. Segwit changes things, generally it goes cheaper...
pebwindkraft
<transactions><transaction-fees><payment><payment-batching>
Batching transactions - calculating batch transaction fee
Lizozom
# Batching transactions - calculating batch transaction fee

(Asked by: username_0 on 2018-01-26)

I want to use transaction batching to make BTC payments to multiple recipients.

In order to optimize transaction amount \ size, lets I'm making equal transfers of **x BTC** to **N recipients**, and that `F(x, N)` is the function representing the transaction fees.

How would this function look like?
How can I calculate it in any given time, to optimize transaction fees?

**Tags:** transactions, transaction-fees, payment, payment-batching

> **Comments:**
> **username_1**: With or without segwit?  
> **username_0**: @username_1 both? :)  
> **username_1**: maybe this: https://bitcoin.stackexchange.com/questions/7537/calculator-for-estimated-tx-fees?rq=1 or also this: https://bitcoin.stackexchange.com/questions/22870/createrawtransaction-and-sendrawtransaction-how-to-specify-transaction-fee?rq=1 this is all without segwit. Segwit changes things, generally it goes cheaper...  

---

## 1 answers

### Answer by username_2 on 2018-01-26. Score: 1

The function would not work because the transaction fee is based upon the size of the transaction in bytes (well really its weight, which is based on the bytes). While the number of outputs is a factor in this, the other factor is the number of inputs, and what type of inputs they are. So given just the outputs (the value of the outputs doesn't even matter), you still cannot determine how much in transaction fees that you will need to pay. Thus your function `F(x, N)` would not work.

> **Comments:**
> **username_0**: Can you please clarify what additional information is required?  
> **username_2**: The number of inputs and the type of those inputs. If you want to optimize the transaction fee, then your function needs to also be selecting those inputs, and it will get very complicated if you want to do that.  
> **username_0**: Going to google what input types are out there :)  

---

