<p>It sounds like you are creating a transaction by hand using the <code>createrawtransaction</code> RPC command. <code>createrawtransaction</code> is not influenced by any of the transaction fee commands or parameters at all. You will need to set the fee manually when you do this by creating change outputs as necessary.</p>

<p>As MeshCollider said, the transaction fee is the difference between the sum of the inputs and sum of the outputs of a transaction. So when you use <code>createrawtransaction</code>, you must ensure that the sum of the outputs you create are not too low or too high.</p>

<p>If you don't want to do this manually, you can use the <code>fundrawtransaction</code> command which will select inputs from your wallet and create change outputs as necessary. <code>fundrawtransaction</code> does handle transaction fees.</p>

CC BY-SA 3.0
2018-01-10T21:49:35.593Z
2018-01-10T21:49:35.593Z
Ava Chow
<p>The fee of a transaction is just the difference between the input and the output value. In the second transaction you posted, the input value was 0.25 LTC and the output value was 0.15 LTC, so you paid a 0.1 LTC fee (0.25-0.15) as you say. If you choose an input which is larger than the output you want to send as well as the fee, you have to create a change output to send the rest back to your wallet as well, otherwise it will all go to the miners as fees. For example, if your input was 0.25 LTC, and you wanted to send 0.15 LTC and only pay 0.01 LTC fee, your transaction would need to have two outputs, one for 0.15 LTC, and one for 0.09 LTC back to an address you own, so that the total fee is just (0.25-(0.15+0.9) = 0.01)</p>

CC BY-SA 3.0
2018-01-10T12:05:29.833Z
I came across `fundrawtransaction` which made it really easy.
Lexus123
CC BY-SA 3.0
2018-01-09T23:15:33.743Z
2018-01-09T23:15:33.743Z
meshcollider
<p>I've been working on my Litecoin wallet for a while now. But I can't seem to control the transaction fee when I make raw transactions.</p>

<p>I know how to send transactions with Litecoin-Qt GUI:
<a href="https://live.blockcypher.com/ltc/tx/2b2f0aab9d2661840a60b172dcda24f359e85b7dbd0810e7afb2d3a6c0b8e59c/" rel="nofollow noreferrer">https://live.blockcypher.com/ltc/tx/2b2f0aab9d2661840a60b172dcda24f359e85b7dbd0810e7afb2d3a6c0b8e59c/</a></p>

<p>No problem with that, the fee was 0.00017 LTC and was included in the next block. The <code>vsize</code> of this TX = 170, which explains the 0.00017 LTC fee.</p>

<p>But I'm also working on my own wallet on my VPS with the Litecoin-CLI. I made a raw TX, signed it and sent it. This happened:
<a href="https://live.blockcypher.com/ltc/tx/32ceefc7f377ad53c91922dffe62e6fd19e48a46d6afb4d610c2c090646404dc/" rel="nofollow noreferrer">https://live.blockcypher.com/ltc/tx/32ceefc7f377ad53c91922dffe62e6fd19e48a46d6afb4d610c2c090646404dc/</a></p>

<p>A transaction fee of 0.1 LTC!!! And the <code>vsize</code> is just 192.</p>

<p>I went back to the litecoin.conf file and it has the <code>paytxfee=0.001</code> parameter. Which means it would cost me 0.001 LTC/kB. <code>maxtxfee</code> wasn't turned on yet, but now it is with a value of 0.001. When I try to send now, it just prompts me with: <code>"error":{"code":-26,"message":"256: absurdly-high-fee"}</code>.</p>

<p>What am I doing wrong?</p>

<p>(Yes I'm testing my wallet on the mainnet, I'm stupid)</p>

<wallet><litecoin>
Help With Raw Transaction Fee - Absurdly High Fee
Lexus123
# Help With Raw Transaction Fee - Absurdly High Fee

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

I've been working on my Litecoin wallet for a while now. But I can't seem to control the transaction fee when I make raw transactions.

I know how to send transactions with Litecoin-Qt GUI:
<https://live.blockcypher.com/ltc/tx/2b2f0aab9d2661840a60b172dcda24f359e85b7dbd0810e7afb2d3a6c0b8e59c/>

No problem with that, the fee was 0.00017 LTC and was included in the next block. The `vsize` of this TX = 170, which explains the 0.00017 LTC fee.

But I'm also working on my own wallet on my VPS with the Litecoin-CLI. I made a raw TX, signed it and sent it. This happened:
<https://live.blockcypher.com/ltc/tx/32ceefc7f377ad53c91922dffe62e6fd19e48a46d6afb4d610c2c090646404dc/>

A transaction fee of 0.1 LTC!!! And the `vsize` is just 192.

I went back to the litecoin.conf file and it has the `paytxfee=0.001` parameter. Which means it would cost me 0.001 LTC/kB. `maxtxfee` wasn't turned on yet, but now it is with a value of 0.001. When I try to send now, it just prompts me with: `"error":{"code":-26,"message":"256: absurdly-high-fee"}`.

What am I doing wrong?

(Yes I'm testing my wallet on the mainnet, I'm stupid)

**Tags:** wallet, litecoin


---

## 2 answers

### Answer by username_2 on 2018-01-09. Score: 4 | Accepted answer

The fee of a transaction is just the difference between the input and the output value. In the second transaction you posted, the input value was 0.25 LTC and the output value was 0.15 LTC, so you paid a 0.1 LTC fee (0.25-0.15) as you say. If you choose an input which is larger than the output you want to send as well as the fee, you have to create a change output to send the rest back to your wallet as well, otherwise it will all go to the miners as fees. For example, if your input was 0.25 LTC, and you wanted to send 0.15 LTC and only pay 0.01 LTC fee, your transaction would need to have two outputs, one for 0.15 LTC, and one for 0.09 LTC back to an address you own, so that the total fee is just (0.25-(0.15+0.9) = 0.01)

> **Comments:**
> **username_0**: I came across `fundrawtransaction` which made it really easy.  

---

### Answer by username_1 on 2018-01-10. Score: 2

It sounds like you are creating a transaction by hand using the `createrawtransaction` RPC command. `createrawtransaction` is not influenced by any of the transaction fee commands or parameters at all. You will need to set the fee manually when you do this by creating change outputs as necessary.

As MeshCollider said, the transaction fee is the difference between the sum of the inputs and sum of the outputs of a transaction. So when you use `createrawtransaction`, you must ensure that the sum of the outputs you create are not too low or too high.

If you don't want to do this manually, you can use the `fundrawtransaction` command which will select inputs from your wallet and create change outputs as necessary. `fundrawtransaction` does handle transaction fees.


---

