This document proposes a new fee structure and policy for Dogecoin Core, to be gradually deployed to the network over multiple software releases.
Meaningful fees were introduced for Dogecoin in 2014 to reduce on-chain spam. With a 1 DOGE fee per kilobyte, rounded up, the Dogecoin chain provided relatively cheap transactions, yet creating enough of a barrier to prevent large amounts of spam. The fee policy was a developer recommendation and was not enforced on the network in any way, other than it being a default in the Dogecoin Core software.
Additionally, to disincentivize spam further, the minimum output size was recommended to be 1 DOGE, where any outputs smaller than that to were to be penalized with an additional 1 DOGE fee.
Late 2018, the choice was made to enforce the fee policy on the relay code of Dogecoin Core nodes, which is triggered when nodes make a decision to broadcast a transaction. With the enforcement of fees on relay fully activating with the v4 softfork (as that removed all miners that were not running updated software) in November 2020, it turned out that a significant amount of transactions were not compliant with the original default policy:
- Approximately 8% of all transactions were taking advantage of the "free tier" inherited from Bitcoin Core. Meaning no fees were paid at all.
- Another ~11% of all transactions were not implementing fees correctly due to missing wallet implementations. Many wallets simply implemented Bitcoin-like fee calculation.
Because of the sudden disruption in transaction relay starting from November 2020, the policy rollout was not a success and better policy transition must be implemented in the future.
In the first 6 months of 2021, multiple new all time high exchange rates against both USD and BTC have caused the recommended fee of 1 DOGE to become steep for the perceived value of transacting Dogecoin on-chain, and is, together with the dust limit (also 1 DOGE), disincentivizing on-chain transactions unnecessarily. This situation causes people to keep their DOGE in custody of centralized platforms longer, because the perceived value loss of transferring DOGE to a secure wallet is (too) high.
Below table displays the cost in USD of creating a full day of full blocks at current, 1y low and 1y high exchange rates, using minimum fees, for BTC, LTC and DOGE.
coin | 6/26 | 1y low | 1y high |
---|---|---|---|
BTC | 44640 | 12960 | 92160 |
LTC | 70272 | 23040 | 237312 |
DOGE | 345599 | 2880 | 1051200 |
Since inception, the goal of Dogecoin has been to be accessible to everyone, but with current exchange rates, transacting DOGE is kept artificially higher than instated on Bitcoin's and Litecoin's chains, disregarding their fee economies. Where transacting DOGE used to be 10x cheaper than transacting LTC, it is as of writing nearly 5x more expensive.
Therefore, it makes sense to reduce fees by at least 50x to stay competitive.
The proposed changes below bring the decision power towards which transactions to include back to miners instead of the relay network and increase configurability of all fee related parameters, enhancing the sovereignty of each individual node operator and the community as a whole.
- Lower the minimal relay fee to 0.001 DOGE
- Lower the dust limit to 0.01 DOGE
- Set the default block inclusion fee rate to 0.01 DOGE
- Bring back a functional free transaction space
- Lower the default fee rate to 0.01 DOGE
Parameter | Current value | Proposed value |
---|---|---|
MIN_RELAY_FEE |
100,000,000 | 100,000 |
DEFAULT_FALLBACK_FEE |
100,000,000 | 1,000,000 |
DEFAULT_TRANSACTION_FEE |
0 | 1,000,000 |
DUST_RELAY_TX_FEE |
100,000,000 | 100,000 |
DEFAULT_BLOCK_MIN_TX_FEE |
1,000 | 1,000,000 |
DEFAULT_DUST_LIMIT |
(100,000,000) | 1,000,000 |
The minimum relay fee is prohibiting lower fee transactions to be propagated to miners. Even if miners would lower their own relay fees, the chances of a random set of nodes relaying transactions to the miner's nodes is minimal at the time of writing: within a subset of 862 nodes, 853 were filtering fees at 1 DOGE. The chance to connect to a node that is also connected to a miner at this time is (9/862)^2 * 8 ~= 0.0008 or 8 in 10,000.
Lowering the default relay fee below the default (fallback) fee enables future fee reductions. Optimal forward flexibility can be assured by always setting minimal relay to be lower than the recommended fee whenever the default fee recommendation changes.
Individual node operators can set a custom relay fee by setting the
-minrelaytxfee
parameter.
The dust limit is currently as prohibitive for Dogecoin to be used for microtransactions as the relay fee is, because dust outputs are disincentivized.
Currently the dust limit does not have it's own parameter but is statically
calculated in CTxOut::GetDustThreshold()
to always return COIN
(= 1 DOGE).
As we want to be able to tune the dust limit, visibly, we add a new global
nDustLimit
, a constant DEFAULT_DUST_LIMIT
and create a -dustlimit
runtime
parameter to allow node operators to change this, independently from software
releases.
With Dogecoin 1.14, the block inclusion fee rate has not been changed vs the forked Bitcoin 0.14 equivalent of 0.00001 DOGE. Although this means that miners are configured to be incredibly relaxed to accept lower fees by default, currently no transactions with fees under 1 DOGE are not reaching the miners, preventing this limit to ever be applied by mining code. This limit is too low to prevent spam, and thus is better increased.
To keep spam prevention effective within the defaults, we increase the default minimum block inclusion fee to be 0.01 DOGE, matching the target recommended fee rate.
Individual miners can set a custom inclusion fee for their blocks with
the -blockmintxfee
parameter.
A reservation of 27kb per block is inherited from Bitcoin 0.14 that allows transactions with insufficient (or no) fee to be included in each block, but this facility is currently largely unused because eligible transactions currently do not get relayed to miners. The relay logic has to be changed to once more accept free space transaction relay.
We would allow the following transactions to be included in the free transaction space exclusively:
- Transactions that are smaller than or equal to the free transaction space
- Inputs that spend p2pkh, p2sh and legacy p2pk scripts
- Outputs with p2pkh and p2sh scripts.
- No dust outputs.
This can be amended as new output scripts are becoming standardized.
Inclusion would be decided based on impact to the utxo database by subtracting the number of outputs from inputs, without assessing fee, i.e. the mempool would be sorted as follows:
prio | tx struct (p2pkh) | delta | tx bytes |
---|---|---|---|
1 | 175 inputs 2 outputs | 173 | 25978 |
2 | 60 inputs 1 output | 59 | 8924 |
3 | 5 inputs 2 outputs | 3 | 818 |
4 | 3 inputs 1 output | 2 | 488 |
5 | 2 inputs 1 outputs | 1 | 340 |
6 | 1 input 2 outputs | -1 | 226 |
In the next block, transaction 1 and 3 will be included, and a subsequent block will include transactions 2, 4, 5 and 6.
Miners can modify the free transaction space for their blocks by setting the
-blockprioritysize
parameter on their nodes.
The fee used for transactions can only be lowered if we can make sure that the network relays those transactions with fees under 1 DOGE per kb.
In a second software release, once the network has at least 30% of nodes allowing relay of transactions with a fee rate of 0.01 DOGE or less, a new default fee recommendation of 0.01 can be deployed.
Transaction byte rounding was introduced as a means to keep the fees optically simple, but creates a disincentive to optimize transaction size because there is no difference in fee between a p2pkh transaction with 2 inputs and 2 outputs, or 2 inputs and 10 outputs. Although this could allow for "free" consolidation of inputs, it also makes spamming painless, as including additional outputs within the same 1 kilobyte range costs nothing extra.
Standard p2pkh transactions currently pay fees as follows:
inputs | outputs | kb | fee | fee per kb | % of tx |
---|---|---|---|---|---|
1 | 1 | 192 | 1 DOGE | 5.21 DOGE | 4% |
1 | 2 | 226 | 1 DOGE | 4.42 DOGE | 36% |
2 | 1 | 340 | 1 DOGE | 2.94 DOGE | 11% |
2 | 2 | 374 | 1 DOGE | 2.67 DOGE | 5% |
1 | 24 | 974 | 1 DOGE | 1.03 DOGE | - |
This means that for the 56% most common transactions, a 2.5-5x fee reduction can be realized by removing the rounding function, rewarding small transactions and removing benefits inadvertently given to spam transactions.
We'd only have to reduce the recommended fees 40x instead of 100x to have a positive effect on pricing for the most common transactions while making spam more expensive simultaneously.
Parameter | Current value | Alternative value |
---|---|---|
MIN_RELAY_FEE |
100,000,000 | 100,000 |
DEFAULT_FALLBACK_FEE |
100,000,000 | 2,500,000 |
DEFAULT_TRANSACTION_FEE |
0 | 2,500,000 |
DUST_RELAY_TX_FEE |
100,000,000 | 100,000 |
DEFAULT_BLOCK_MIN_TX_FEE |
1,000 | 2,500,000 |
DEFAULT_DUST_LIMIT |
(100,000,000) | 2,500,000 |
The following table displays the fee for the 4 most common transactions and a spam transaction.
inputs | outputs | size | cur fee | cur fee/kb | new fee | new fee/kb | alt fee | alt fee/kb |
---|---|---|---|---|---|---|---|---|
1 | 1 | 192 | 1 | 5.21 | 0.01 | 0.0521 | 0.0048 | 0.025 |
1 | 2 | 226 | 1 | 4.42 | 0.01 | 0.0442 | 0.0057 | 0.025 |
2 | 1 | 340 | 1 | 2.67 | 0.01 | 0.0267 | 0.0085 | 0.025 |
2 | 2 | 374 | 1 | 2.67 | 0.01 | 0.0267 | 0.0094 | 0.025 |
1 | 24 | 974 | 1 | 1.03 | 0.01 | 0.0103 | 0.0244 | 0.025 |
As shown above, the alternative fee calculation without rounding the transaction size up to the nearest multiple of 1kb, will make simple, standard transactions cheaper than with the rounding in place yet make spam transactions linearly more expensive than with a rounded-up fee.
Release 1.14.4 would ideally implement:
- Lower relay fee, incl. optionally removal of rounding function
- Dust limit
- Block inclusion rate, incl. optionally removal of rounding function
- Free transaction space
Release 1.14.5 would then implement:
- Recommended minimum fee
- Optionally, removal of rounding
Release 1.21.0 then implements everything from 1.14.4 and 1.14.5 at once.
D6ftB9SDo9w1i4mT6Hb8Km3xaNj4vsjjCN