dogecoin / dogecoin

very currency
MIT License
14.4k stars 2.8k forks source link

High Transaction Fee #3519

Open SaitamaTechno opened 1 month ago

SaitamaTechno commented 1 month ago

I can send and receive doge from my wallet in my node. when i receive it takes 10 minutes but fee is very low. When i send from my wallet, it happens in a few seconds, but the fee is not even stable and high. it uses rest of all doge in my wallet.

For example I had 1 doge in my wallet. I sent 0.6 doge, the fee is taken 0.4 doge. it is very high. On the other hand, from that 10 minutes platform i mentioned above, the fee is only 0.01 doge for the transaction of 1 doge. How can i manage the fee when i run the node, there is this dogecoin-cli estimatesmartfee 6 it is 0.14Doge per block. I mean it is still low but it always takes more, i mean it takes the rest of my wallet as fee, why???

Please check these transactions, one of them has 0.01 doge fee. https://sochain.com/tx/DOGE/1a507108f638578ff4a6974a4465cb8559cc0619f74b4d2bb0f27e3db03fe95b

Other one (my node wallet) has 0.4 doge fee: https://sochain.com/tx/DOGE/cc7e5eab64372cd2ca1b98d618bc2c7de937ffb30967d60b65149cd7d5b07a68

patricklodder commented 1 month ago

Hi! Need a little more information.

  1. Which version of dogecoind do you use? You can see with dogecoind -version
  2. What settings are in your dogecoin.conf? It's located in $HOME/.dogecoin on linux.
SaitamaTechno commented 1 month ago

Hi @patricklodder

Dogecoin Core Daemon version v1.14.7.0-a6d122013

I dont have a config file, I dont use it. Instead, I manage it via command line:

/usr/local/bin/dogecoind -daemon -paytxfee=0.01 -prune=10000
SaitamaTechno commented 1 month ago

I just learned how to set a transaction fee, I will be back soon with a detailed explanation. This was not a bug actually, but i still dont understand why it uses the rest of all money in the wallet when I dont specify a transaction fee with fundrawtransaction.

SaitamaTechno commented 1 month ago

Hey @patricklodder , I have a new issue. I rented a cloud computer. it was running fine for 14 days. I initialised doge blockchain in first 5 days with pruning 10gb. The cloud service shutdown my computer because of high disk usage (read/write) is that normal? they say: the computer used 4.2 tb read, 3.7tb write happened in 14days, that's why they shutdown. Do you have any suggestions?

patricklodder commented 1 month ago

is that normal?

I've not heard of this one before; it sounds like this is a specific limit to your provider.

the computer used 4.2 tb read, 3.7tb write

This sounds about right; noting that this can definitely be improved in the software.

Do you have any suggestions?

Try a provider that doesn't limit disk i/o. The bulk of the resource usage is during initial block download.

SaitamaTechno commented 2 weeks ago

hello @patricklodder , I would like to ask you something:

Let's say we have 10 doge in wallet A, I wanna send 5 doge to wallet B with 0.05 doge fee.

What i see from my experiment: it sends 5 doge to wallet B and spends 0.05 doge fee. Everything is good so far. However, it also sends the rest of all money to a totally new wallet. Lets call it wallet C. When i try listunspent "wallet A", i cannot see txid or doge but when i try listunspent "main_account" I see a new wallet is created and rest of my doge is stored in there. Moreover, When the transaction is created I have zero doge in balance. But after it gets a confirmation, I see wallet C with my money.

I think this behaviour is an ordinary behaviour, but what is the reason behind it and also is there anyway that i can send from wallet A specifying a fee and keeping the rest of the money in wallet A, too?

Another question: What is vout besides txid? vout is 1 in wallet C and 0 in wallet A.

Here is the code that I create and sign a transaction:

dogecoin-cli listunspent 1 9999999 '["DAYkrjxyroyhv8CwUAGmbE5JGZYxF4Jiig"]'
utxos_to_use='[
  {
    "txid": "4b9fbff55a4c1c5bb7b0f02b4efcb9830d6d22c3a5edc9f5f11c0e6d43416c51",
    "vout": 0
  }
]'

dogecoin-cli createrawtransaction "$utxos_to_use" '{"9vnmH4heyoCESGhMRyjupn5sNArQ9z8oCk":0.6}'
dogecoin-cli fundrawtransaction "0100000001516c41436d0e1cf1f5c9eda5c3226d0d83b9fc4e2bf0b0b75b1c4c5af5bf9f4b0000000000ffffffff01008793030000000017a9142fc0b583aa34e31476a41082e6aef952e32b95808700000000" '{"feeRate":0.03}'

dogecoin-cli signrawtransaction "0100000001516c41436d0e1cf1f5c9eda5c3226d0d83b9fc4e2bf0b0b75b1c4c5af5bf9f4b0000000000ffffffff02008793030000000017a9142fc0b583aa34e31476a41082e6aef952e32b95808700ef5e02000000001976a914d3df39df97825fec5fa38e8408d8e863113a454288ac00000000"
dogecoin-cli sendrawtransaction 0100000001516c41436d0e1cf1f5c9eda5c3226d0d83b9fc4e2bf0b0b75b1c4c5af5bf9f4b000000006a473044022075596dd16f11bcc5e8c9b1714fd91fe84d3d48a0322b1991513a7e693c198b3e02204705614cb30cef6e0b9de6bcccce1d7029312c7c79cca84935ab30e6a8050b38012103727111c396cb2e39ca1a3d6a5bf7e800318c0de3e81260272d8c803f0d245f45ffffffff02008793030000000017a9142fc0b583aa34e31476a41082e6aef952e32b95808700ef5e02000000001976a914d3df39df97825fec5fa38e8408d8e863113a454288ac00000000
patricklodder commented 2 weeks ago

Here is the code that I create and sign a transaction

You need to add the change address to createrawtransaction. Replace that with something like the following, creating a new outputs object:

...

change_amount="0.35" # <sum of input amounts (1) - send amount (0.6) - total fee (0.05)>
outputs="{\"9vnmH4heyoCESGhMRyjupn5sNArQ9z8oCk\":0.6,\"$(dogecoin-cli getrawchangeaddress)\":$change_amount}"

dogecoin-cli createrawtransaction "$utxos_to_use" "$outputs"

...
SaitamaTechno commented 2 weeks ago

@patricklodder Can i write the wallet address which i used in listunspent command, can i write this address DAYkrjxyroyhv8CwUAGmbE5JGZYxF4Jiig Instead of getrawchangeaddress. Because after i spent from this wallet, i want to keep the remaining money in this wallet.

patricklodder commented 2 weeks ago

Yes, but that's not the recommended way to do it. You should really only use a key once (ie don't send coin to an address after you've spent coin from it.)