<p>Okay, I finally found an algorithm which can fit to my wishes.</p>
<p>Available at : <a href="https://bitcoin.stackexchange.com/questions/103654/calculating-fee-based-on-fee-rate-for-bitcoin-transaction">Calculating fee based on fee rate for bitcoin transaction</a></p>
<p>This can be easily converted into a Python code in order to build a transaction correctly.</p>

CC BY-SA 4.0
2023-05-24T08:36:56.457Z
2023-05-24T08:36:56.457Z
Loopite
<p>I was wondering how can we build a transaction with a fixed amount of fees already FIXED.</p>
<p>Let's have this configuration
2 Inputs (X:0 = 520 BTC, X:1 = 102 BTC) =&gt; 1 RECEIVER (+510 BTC)
Fees are: 0.001 BTC / byte</p>
<p>How can we build a transaction wheras we don't even know the signature size ? Can you show your steps please ?</p>

CC BY-SA 4.0
2023-05-12T19:12:06.700Z
Do you mean a “fixed feerate [sat/vB]” rather than a “fixed fee [sat]”?
Murch
CC BY-SA 4.0
2023-05-12T19:15:23.493Z
I think the instructions I wrote here just earlier today would also work for you: https://bitcoin.stackexchange.com/a/118302/5406
Murch
CC BY-SA 4.0
2023-05-12T19:24:32.707Z
Your answer uses RPC interactions. But, I'd like to know the steps to BUILD a new transaction in Python or something like that by specifying all conditions. This is more an algorithm conception.
Loopite
CC BY-SA 4.0
2023-05-12T19:45:57.003Z
Please edit your question to incorporate that information, drop the “bitcoin-core”-tag and instead add “python”.
Murch
<transactions><transaction-fees><python>
How to build a raw signed transaction with a FIXED fee?
Loopite
# How to build a raw signed transaction with a FIXED fee?

(Asked by: username_0 on 2023-05-12)

I was wondering how can we build a transaction with a fixed amount of fees already FIXED.

Let's have this configuration
2 Inputs (X:0 = 520 BTC, X:1 = 102 BTC) => 1 RECEIVER (+510 BTC)
Fees are: 0.001 BTC / byte

How can we build a transaction wheras we don't even know the signature size ? Can you show your steps please ?

**Tags:** transactions, transaction-fees, python

> **Comments:**
> **username_1**: Do you mean a “fixed feerate [sat/vB]” rather than a “fixed fee [sat]”?  
> **username_1**: I think the instructions I wrote here just earlier today would also work for you: https://bitcoin.stackexchange.com/a/118302/5406  
> **username_0**: Your answer uses RPC interactions. But, I'd like to know the steps to BUILD a new transaction in Python or something like that by specifying all conditions. This is more an algorithm conception.  
> **username_1**: Please edit your question to incorporate that information, drop the “bitcoin-core”-tag and instead add “python”.  

---

## 1 answers

### Answer by username_0 on 2023-05-24. Score: 0 | Accepted answer

Okay, I finally found an algorithm which can fit to my wishes.

Available at : [Calculating fee based on fee rate for bitcoin transaction](https://bitcoin.stackexchange.com/questions/103654/calculating-fee-based-on-fee-rate-for-bitcoin-transaction)

This can be easily converted into a Python code in order to build a transaction correctly.


---

