Error With Tx Fee In Linux Wallet

Discussion in 'Transactions' started by Levi Nobre, Apr 25, 2016.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. Levi Nobre

    Levi Nobre New Member

    Jan 19, 2016
    25
    18
    Male
    Trader, Investor and Programmer
    Brazil
    I've been set the TX fee to 0.05, but when I realize a transaction it's sent with 0.01265.
     
  2. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    This is (likely) the correct behavior. The transaction fee is not a flat fee, but a ratio of DCR per kilobyte of serialized transaction. Your transaction was likely around 253 bytes (0.01265/0.05=0.253) so you only payed a portion of the fee. If the transaction was larger than a kB, you would pay more than 0.05 in fees.
     
  3. Levi Nobre

    Levi Nobre New Member

    Jan 19, 2016
    25
    18
    Male
    Trader, Investor and Programmer
    Brazil
    But in versions prior to 0.1.0 the transactions was sent with the set value.
     
  4. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    Yes. We changed it. Now you pay less in fees. Why would you want to pay more than needed?
     
  5. Levi Nobre

    Levi Nobre New Member

    Jan 19, 2016
    25
    18
    Male
    Trader, Investor and Programmer
    Brazil
    That's great. But I received a complaint because my site reports that the rate of the network would be 0.05 but the transaction was charged less.
     
  6. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    This is an issue with your site then.

    First of all, the required fee (called the mempool relay fee) is 0.01/kB, not 0.05. This has been the case for several dcrd versions now. Until recently, wallets continued to use the 0.05/kB relay fee as a default so that transactions would relay across the network even when people were not using the latest dcrd version.

    Second, the required fee is calculated based on the transaction's actual size and that relay fee. There is no flat fee that every transaction must always pay. Instead, a minimum number of atoms is calculated, and if the fee is less than that value, it is rejected by mempool (I am ignoring the priority checks for simplicity here). This minimum fee can be calculated as:

    Code:
    minFee = (serializeSize * relayFee) / 1000
    where minFee is the number of atoms of required fee, serialize size is the size of the transaction in bytes, and relayFee is the number of atoms that must be paid per a full kB of transaction. One Decred is 1e8 atoms, so given the 0.01 DCR/kB relay fee policy, the relayFee here is 1e6.
     
  7. Levi Nobre

    Levi Nobre New Member

    Jan 19, 2016
    25
    18
    Male
    Trader, Investor and Programmer
    Brazil
    Isn't a problem with my site, I just didn't know of this change, but, thank you!
     

Share This Page