<p>The fee is calculated from the difference between vin and vout. Here you are sending a very small amount to an addresses but you have not specified an output to receive the change. The client sees this change as the fee which is probably very large.</p>

<p>You need to create a separate vout to send the change from the transaction, leaving a small amount for the fee.</p>

CC BY-SA 4.0
2018-09-19T22:17:24.877Z
Thank you for replying. I don't know much about it. How do I create vout?
PHPSEO
CC BY-SA 4.0
2018-09-19T22:18:12.770Z
You already have a vout: { "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed": 0.001 }
Nikos Kostoulas
CC BY-SA 4.0
2018-09-19T22:18:43.700Z
Create another one where the address belongs to your wallet (bitcoin-cli getnewaddress) and the value is the change minus a fee
Nikos Kostoulas
CC BY-SA 4.0
2018-09-19T22:19:20.687Z
You should be able to find the value of the vin by searching for the txid: 751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2
Nikos Kostoulas
CC BY-SA 4.0
2018-09-19T22:20:38.700Z
You could alternatively use the sendtoaddress rpc call
Nikos Kostoulas
CC BY-SA 4.0
2018-09-19T23:17:07.740Z
I'm trying, but I haven't succeeded. :(
From adress is: 2N4ZgDkNDUqo5aHADMxW2qHUahC51g6FVYY (751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2)
To address is: 2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed
Can you show me an example? Thank you for helping.
PHPSEO
CC BY-SA 4.0
2018-09-20T08:50:09.183Z
bitcoin-cli -testnet createrawtransaction '''
 [
    {
      "txid":"751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2",
      "vout" : 0
    }
 ]''' '{ "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed": 0.001,
 "change_address": vin_value - 0.001 - fee}'
Nikos Kostoulas
CC BY-SA 4.0
2018-09-21T21:14:16.423Z
Thank you so much. What is the difference between sendfrom and createrawtransaction? Which is safer?
PHPSEO
CC BY-SA 4.0
2018-09-23T18:38:09.317Z
With sendtoaddress input coins and fee are chosen automatically. With createrawtransaction you have the option which inputs to use and how exactly to structure outputs and fee.
Nikos Kostoulas
CC BY-SA 4.0
2018-09-19T22:14:41.480Z
2018-09-19T22:14:41.480Z
Nikos Kostoulas
<p>I'm running the following codes, respectively.</p>

<pre><code> bitcoin-cli -testnet createrawtransaction '''
 [
    {
      "txid":"751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2",
      "vout" : 0
    }
 ]''' '{ "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed": 0.001 }'
</code></pre>

<p>response;</p>

<pre><code>0200000001d2721359023b37b7f0b32c09ccc37621dae52031366604e01d628dcd61631b750000000000ffffffff02a08601000000000017a914657abfa90bd62f0f7a9533509b855cfd5f6e7d178750c300000000000017a91477c7f1a5a522daf70274dab6cdcb85efcc6e99318700000000
</code></pre>

<p>My DecodeRawTransaction output;</p>

<pre><code> array:8 [▼
      "txid" =&gt; "8608e07487a15b8866496bd5e90c92736d909a8b3023e1cfc75481e613164fe7"
      "hash" =&gt; "8608e07487a15b8866496bd5e90c92736d909a8b3023e1cfc75481e613164fe7"
      "version" =&gt; 2
      "size" =&gt; 83
      "vsize" =&gt; 83
      "locktime" =&gt; 0
      "vin" =&gt; array:1 [▼
           0 =&gt; array:4 [▼
                "txid" =&gt; "751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2"
                "vout" =&gt; 0
                "scriptSig" =&gt; array:2 [▼
                     "asm" =&gt; ""
                     "hex" =&gt; ""
                ]
                "sequence" =&gt; 4294967295
           ]
      ]
      "vout" =&gt; array:1 [▼
           0 =&gt; array:3 [▼
                "value" =&gt; 0.001
                "n" =&gt; 0
                "scriptPubKey" =&gt; array:5 [▼
                     "asm" =&gt; "OP_HASH160 657abfa90bd62f0f7a9533509b855cfd5f6e7d17 OP_EQUAL"
                     "hex" =&gt; "a914657abfa90bd62f0f7a9533509b855cfd5f6e7d1787"
                     "reqSigs" =&gt; 1
                     "type" =&gt; "scripthash"
                     "addresses" =&gt; array:1 [▼
                          0 =&gt; "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed"
                     ]
                ]
           ]
      ]
 ]
</code></pre>

<p>After, I'm running this command;</p>

<pre><code> signrawtransaction 0200000001d2721359023b37b7f0b32c09ccc37621dae52031366604e01d628dcd61631b750000000000ffffffff02a08601000000000017a914657abfa90bd62f0f7a9533509b855cfd5f6e7d178750c300000000000017a91477c7f1a5a522daf70274dab6cdcb85efcc6e99318700000000
</code></pre>

<p>And finally, I'm running the SendRawTransaction command.</p>

<pre><code>bitcoin-cli -testnet sendrawtransaction 02000000000101d2721359023b37b7f0b32c09ccc37621dae52031366604e01d628dcd61631b75000000001716001466c18ec25251afe44f6a9f99be78b4e04857ef46ffffffff01a08601000000000017a914657abfa90bd62f0f7a9533509b855cfd5f6e7d178702483045022100b0291f0c753b3876a7d0d5c8970caa0e4b70cad224de9248377054e342ad1ed1022006de0d6e07991319ce467e5550bb203e4d398452c457b138e1fb5b7a3b2e9427012103f382a14da980fba9234d02599fe5ced7b1f907385d1d14bfb17017e5cfdc318500000000
</code></pre>

<p>And I get this error;</p>

<pre><code> 256: absurdly-high-fee
</code></pre>

<p>Can anyone help me?</p>

CC BY-SA 4.0
2018-09-19T22:14:23.193Z
My problem is still continuing. The relevant content did not help.
PHPSEO
CC BY-SA 4.0
2018-09-19T22:22:19.353Z
you are spending a 0.15 btc output and only sending 0.01 btc the rest 0.14 will implicitly go as a fee to the miner which is very high so you get an error. You need to add a second output with where do you want the 0.14 btc to go.
Mike D
<bitcoind><php>
Raw Transaction Fee - 256: absurdly-high-fee error
PHPSEO
# Raw Transaction Fee - 256: absurdly-high-fee error

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

I'm running the following codes, respectively.

```
 bitcoin-cli -testnet createrawtransaction '''
 [
    {
      "txid":"751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2",
      "vout" : 0
    }
 ]''' '{ "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed": 0.001 }'

```

response;

```
0200000001d2721359023b37b7f0b32c09ccc37621dae52031366604e01d628dcd61631b750000000000ffffffff02a08601000000000017a914657abfa90bd62f0f7a9533509b855cfd5f6e7d178750c300000000000017a91477c7f1a5a522daf70274dab6cdcb85efcc6e99318700000000

```

My DecodeRawTransaction output;

```
 array:8 [▼
      "txid" => "8608e07487a15b8866496bd5e90c92736d909a8b3023e1cfc75481e613164fe7"
      "hash" => "8608e07487a15b8866496bd5e90c92736d909a8b3023e1cfc75481e613164fe7"
      "version" => 2
      "size" => 83
      "vsize" => 83
      "locktime" => 0
      "vin" => array:1 [▼
           0 => array:4 [▼
                "txid" => "751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2"
                "vout" => 0
                "scriptSig" => array:2 [▼
                     "asm" => ""
                     "hex" => ""
                ]
                "sequence" => 4294967295
           ]
      ]
      "vout" => array:1 [▼
           0 => array:3 [▼
                "value" => 0.001
                "n" => 0
                "scriptPubKey" => array:5 [▼
                     "asm" => "OP_HASH160 657abfa90bd62f0f7a9533509b855cfd5f6e7d17 OP_EQUAL"
                     "hex" => "a914657abfa90bd62f0f7a9533509b855cfd5f6e7d1787"
                     "reqSigs" => 1
                     "type" => "scripthash"
                     "addresses" => array:1 [▼
                          0 => "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed"
                     ]
                ]
           ]
      ]
 ]

```

After, I'm running this command;

```
 signrawtransaction 0200000001d2721359023b37b7f0b32c09ccc37621dae52031366604e01d628dcd61631b750000000000ffffffff02a08601000000000017a914657abfa90bd62f0f7a9533509b855cfd5f6e7d178750c300000000000017a91477c7f1a5a522daf70274dab6cdcb85efcc6e99318700000000

```

And finally, I'm running the SendRawTransaction command.

```
bitcoin-cli -testnet sendrawtransaction 02000000000101d2721359023b37b7f0b32c09ccc37621dae52031366604e01d628dcd61631b75000000001716001466c18ec25251afe44f6a9f99be78b4e04857ef46ffffffff01a08601000000000017a914657abfa90bd62f0f7a9533509b855cfd5f6e7d178702483045022100b0291f0c753b3876a7d0d5c8970caa0e4b70cad224de9248377054e342ad1ed1022006de0d6e07991319ce467e5550bb203e4d398452c457b138e1fb5b7a3b2e9427012103f382a14da980fba9234d02599fe5ced7b1f907385d1d14bfb17017e5cfdc318500000000

```

And I get this error;

```
 256: absurdly-high-fee

```

Can anyone help me?

**Tags:** bitcoind, php

> **Comments:**
> **username_0**: My problem is still continuing. The relevant content did not help.  
> **username_1**: you are spending a 0.15 btc output and only sending 0.01 btc the rest 0.14 will implicitly go as a fee to the miner which is very high so you get an error. You need to add a second output with where do you want the 0.14 btc to go.  

---

## 1 answers

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

The fee is calculated from the difference between vin and vout. Here you are sending a very small amount to an addresses but you have not specified an output to receive the change. The client sees this change as the fee which is probably very large.

You need to create a separate vout to send the change from the transaction, leaving a small amount for the fee.

> **Comments:**
> **username_0**: Thank you for replying. I don't know much about it. How do I create vout?  
> **username_2**: You already have a vout: { "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed": 0.001 }  
> **username_2**: Create another one where the address belongs to your wallet (bitcoin-cli getnewaddress) and the value is the change minus a fee  
> **username_2**: You should be able to find the value of the vin by searching for the txid: 751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2  
> **username_2**: You could alternatively use the sendtoaddress rpc call  
> **username_0**: I'm trying, but I haven't succeeded. :( From adress is: 2N4ZgDkNDUqo5aHADMxW2qHUahC51g6FVYY (751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2) To address is: 2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed Can you show me an example? Thank you for helping.  
> **username_2**: bitcoin-cli -testnet createrawtransaction '''  [     {       "txid":"751b6361cd8d621de00466363120e5da2176c3cc092cb3f0b7373b02591372d2",       "vout" : 0     }  ]''' '{ "2N2VoHPMHT8CBYrhJqhJj1uauPaxMN7Qqed": 0.001,  "change_address": vin_value - 0.001 - fee}'  
> **username_0**: Thank you so much. What is the difference between sendfrom and createrawtransaction? Which is safer?  
> **username_2**: With sendtoaddress input coins and fee are chosen automatically. With createrawtransaction you have the option which inputs to use and how exactly to structure outputs and fee.  

---

