Skip to content

Conversation

RobinLinus
Copy link

@RobinLinus RobinLinus commented Jul 13, 2025

Motivation
The default relay-fee (-minrelaytxfee) was set to 1000 sat/kvB about 10 years ago. Over that period the USD price of BTC has risen by roughly 2-3 orders of magnitude, making the economic cost of relaying small transactions disproportionately high.

Proposed change
Lower the default to 100 sat/kvB—a 10× reduction—bringing the effective USD cost back in line. This maintains DoS resistance without discouraging low-value UTXO consolidation.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 13, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32959.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept NACK 1440000bytes, luke-jr
Concept ACK delta1, sipa

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

No conflicts as of last run.

@lifofifoX
Copy link

DEFAULT_INCREMENTAL_RELAY_FEE should be decreased along with this as well.

@jlopp
Copy link
Contributor

jlopp commented Jul 13, 2025

Looks like p2p_ibd_txrelay.py test needs updating.

@caesrcd
Copy link

caesrcd commented Jul 13, 2025

DEFAULT_INCREMENTAL_RELAY_FEE should be decreased along with this as well.

Assuming there are miners using Bitcoin Core to mine, then the DEFAULT_BLOCK_MIN_TX_FEE should be lowered as well.

@supertestnet
Copy link

the USD price of BTC has risen by roughly 2-3 orders of magnitude...[let's do] a 10× reduction

Wouldn't a 100x reduction be more in line? i.e. something like 10 sat/kvB?

@Rob1Ham
Copy link

Rob1Ham commented Jul 13, 2025

Looks like p2p_ibd_txrelay.py test needs updating.

Dropped in a PR here to add testing so this passes.

@l0rinc
Copy link
Contributor

l0rinc commented Jul 14, 2025

Every commit needs to pass CI independently, and instead of merge commits or cherry-picks, we usually add co-authors.
Could you please squash the commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits?

And could you please explain how you got to the 10x reduction, did you conduct some analysis or is it just a hunch?

@RobinLinus RobinLinus force-pushed the reduce-minrelaytxfee branch from 18ab60a to 8b05fd6 Compare July 14, 2025 02:12
test: Update p2p_ibd_tx_relay.py to support minrelaytxfee as low as 100 sats/kvB.
@RobinLinus RobinLinus force-pushed the reduce-minrelaytxfee branch from 8b05fd6 to 7f2e35a Compare July 14, 2025 02:17
@1440000bytes

This comment was marked as abuse.

@1440000bytes

This comment was marked as abuse.

@delta1
Copy link

delta1 commented Jul 14, 2025

Concept ACK

@Sjors
Copy link
Member

Sjors commented Jul 14, 2025

Over that period the USD price of BTC has risen by roughly 2-3 orders of magnitude, making the economic cost of relaying small transactions disproportionately high.

The question is whether DoS protection back then was actually sufficient, or if the increase in fiat terms was the luck we needed. I don't know the answer to that.

As an example, a recent DoS fix involved a rate limiting mechanism that was set to 7 transactions per second. This rate limit is based on how many transactions fit in a block. It seems plausible, but I don't know, if a lower relay fee would have made it cheaper to DoS nodes before v25.0. It'd be interesting to simulate that with Warnet.

Another difference between now and back then is the presence of Lightning and other systems that are sensitive to mempool shenanigans in general. Again I don't know if those attacks scale with the minimum relay fee either.

If that research has already been done, please link to it. Otherwise I would not be in favor (although we may not have a choice if the full-RBF game is repeated).

Finally in terms of pure node performance, it might be better to wait for cluster mempool #30289 to be deployed.

@flack
Copy link
Contributor

flack commented Jul 14, 2025

small nit: The PR description should rather point to this commit: 9e93640

@Sjors
Copy link
Member

Sjors commented Jul 14, 2025

Better to (also) point to #6722 as it has the discussion from back then.

@LaurentMT
Copy link

DUST_RELAY_TX_FEE should be decreased along with this as well...

@andrewtoth
Copy link
Contributor

DUST_RELAY_TX_FEE should be decreased along with this as well...

That value is used to calculate the minimum output amount, not the fee rate of a tx. That seems orthogonal to the goal of this PR.

@LaurentMT
Copy link

LaurentMT commented Jul 15, 2025

That value is used to calculate the minimum output amount, not the fee rate of a tx. That seems orthogonal to the goal of this PR.

The two concepts of "dust limit" and minRelayTxFee are logically related and the former was originally derived from the latter in the implementation (see commit eb30d1a introducing the dustRelayFee).

If this logical relationship is abandoned, it would be better to explain why and what is the economic rationale behind the determination of the value defining the "dust limit".

@RobinLinus
Copy link
Author

DUST_RELAY_TX_FEE should be decreased along with this as well...

DEFAULT_MIN_RELAY_TX_FEE and DUST_RELAY_TX_FEE serve different purposes. The former is about protecting the P2P network, while the latter also aims at protecting the UTXO set from DoS attacks. Given that half of the UTXO set is spam these days, it seems like the dust limit should rather get increased than decreased. So it's a whole different discussion, and I would not want to conflate these two in this PR.

@lifofifoX
Copy link

It's ridiculous to obsess over "spam" and have it dictate policy, rather than rely on economic incentives. Dust limits should be set based on it being economical to spend a UTXO at minimum relay fees, rather than your misplaced notion of "spam".

@BitcoinMechanic
Copy link

It's ridiculous to obsess over "spam" and have it dictate policy, rather than rely on economic incentives. Dust limits should be set based on it being economical to spend a UTXO at minimum relay fees, rather than your misplaced notion of "spam".

This is an ideological stance that ignores how Bitcoin has operated for basically its entire existence.

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reducing DEFAULT_MIN_RELAY_TX_FEE only makes sense to me in conjunction with reducing DEFAULT_BLOCK_MIN_TX_FEE. Otherwise nodes become subject to free relay attacks that could be used to waste bandwidth across the network with transactions that are not even in danger of getting mined in most blocks.

DEFAULT_INCREMENTAL_RELAY_FEE should be decreased along with this as well.

That’s probably a bad idea, as it would increase the surface for bandwidth wasting attacks 10× even on top of what dropping the DEFAULT_MIN_RELAY_TX_FEE would do.

While I’m sympathetic to users wanting to transact (and especially consolidate) at lower feerates whenever blockspace demand is as low as it currently is, this drops a full block’s minimum transaction fees to ~100,000 sats, or about ~0.03% of the current subsidy. That seems like the wrong signal when the ecosystem’s long-term roadmap relies on transaction fees eventually funding mining.

If this idea gets traction, perhaps it would be interesting to combine a reduction of the minimum relay transaction fee rate with shifting the denomination of fee rates to sats/WU and setting a new minimum relay transaction fee rate to 100 sats/kWU instead which would be 0.4 sats/vB rather than 0.1 sats/vB.

@@ -28,17 +28,17 @@
)
from test_framework.test_framework import BitcoinTestFramework

MAX_FEE_FILTER = Decimal(9170997) / COIN
NORMAL_FEE_FILTER = Decimal(100) / COIN
MAX_FEE_FILTER = Decimal(9936506) / COIN
Copy link
Contributor

@murchandamus murchandamus Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t understand why the MAX_FEE_FILTER line was changed, could you elaborate?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I evaluated why the test was failing, I noticed that changing the value for NORMAL_FEE_FILTER on its own was insufficient for making the test pass. Digging further into the mechanics on how the policy filters worked, and looking logs on my local version of the code this is what I found:

I made the change from 9170997 to 9936506 because, reducing minrelaytxfee halves min_fee_limit (500→50, fees.cpp:1090). This alters the geometric sequence in MakeFeeSet (fees.cpp:1092-1095).

With spacing=1.1 (set in fees.h:322), starting lower fits one more bucket before capping at 1e7, yielding a higher max (9936506) due to floating point multiplication.

This can be verified independently if you run FeeFilterRounder with CFeeRate(100) vs CFeeRate(1000), and call round(MAX_MONEY).

To @instagibbs's point, if the better approach is write a new set of tests instead of working with the poorly written tests we have now, happy to help when I have time.

@instagibbs
Copy link
Member

If tests aren't breaking, a good place to start would be to write a test that breaks on these changes, then fix them in feature commit. As of now, nothing breaks which is concerning.

On the meta level: Very low feerate transactions have negligible impact on mining profitability in terms of block templates themselves. It's not obvious that the price going up 10x means we get to lower the default by 10x, because it's a more important system now and the stakes are simply higher. The most persuasive argument for this would be that miners have diverged from defaults and it is impacting block relay and the DoS risk of 10x lower fees is acceptable. Note that under transactional load(which is what we need long term anyways for consensus stability), this change is a no-op, so I'm not convinced at all this is the right tradeoff.

@caesrcd
Copy link

caesrcd commented Jul 19, 2025

The mempool is already constrained by DEFAULT_MAX_MEMPOOL_SIZE_MB, which prevents unbounded transaction accumulation and significantly reduces the feasibility of relay-based DoS attacks. Historically, the network has operated reliably even during extended periods of mempool congestion, where dynamic fee pressure naturally evicts lower-fee transactions.

This proposed configuration provides a practical balance between usability and relay robustness:

static constexpr unsigned int DEFAULT_MIN_RELAY_TX_FEE{100};       // 0.1 sat/vB
static constexpr unsigned int DEFAULT_INCREMENTAL_RELAY_FEE{400};  // 0.4 sat/vB
  • Allows low-priority transactions to be relayed when mempool space is available during low-demand periods.
  • Keeps RBF functional in low-fee environments without requiring large fee bumps.
  • Remains protected by eviction policies, ancestor/descendant limits, and the overall mempool cap.

No clear DoS vector is introduced by this change that doesn't already require significant real-world cost and effort from an attacker.

@ajtowns
Copy link
Contributor

ajtowns commented Jul 21, 2025

Sure, though at the same time the situation being discussed here isn't price up 10x means default down 10x. Compared to when this was last adjusted the price is up 500x and this proposes down by 10x. :P

Previous settings have been:

  • 2015/10/13 - 5sat/vb to 1sat/vb
    • $250/BTC
    • 1sat*200vb = 0.5c
    • 1sat/vb*1Mvb/25BTC = 0.04% of block reward
  • 2015/10/09 - 1sat/vb to 5at/vb
    • $250/BTC
    • 5sat*200vb = 2.5c
    • 5sat/vb*1Mvb/25BTC = 0.2% of block reward
  • 2013/04/13 - 10sat/vb to 1sat/vb
    • $120/BTC [edit: found a different price source that doesn't seem as crazy]
    • 10sat*200vb = 0.024c
    • 10sat/vb*1Mvb/25BTC = 0.4% of block reward

(Going by commit dates rather than merge/release dates)

These changes were largely irrelevant to people making transactions however, since most wallets were setting fees to a flat rate per transaction (eg, 10000 sats, independent of the transaction size) prior to 2016.

The rationale for the 5sat-to-1sat change was the cost of relaying a tx across the network -- 1kB of data across 100k nodes is at least 100MB of data, at 10c/GB (contemporary ec2 bandwidth pricing) is 1c total; and 1000sats at $250/BTC 0.25c total. Today, ec2 prices don't seem much different, and node counts aren't much higher, so at current prices, paying for relay would be closer to 0.01sat/vb. A rate of 0.1sat/vb would cover growing the node count to 1M nodes, and 1sat/vb would cover growing the node count to 10M nodes. So from a "free relay" perspective, I think 0.1 sat/vb is likely fine, both for min-fee and min-incremental-fee. If the p2p network grows to much more than 1M nodes, that might not be true though.

A full block of min fee txs would currently set fees at 0.32% of the total block reward; dividing that by 10 will delay hitting 1% from being ~7 years away to ~20 years away. If you're looking towards keeping hashrate reltively stable in an environment where the BTC price stabilises instead of continuing to more than double every four years, this is probably a step backwards, and setting an expectation that it fees will either decrease in BTC terms or stay stable in fiat/real terms is probably misleading, even in the medium term.

Likewise if you're looking to maximise miner revenue: it's better to mine 101kvB of 1sat/vb txs than 1MvB of 0.1sat/vb txs. But if miners want transactors to be subsidised even more than they already are, I guess that's their business.

In any event, I think not accepting these txs for relay significantly affects block relay, both due to not already having the transaction data already downloaded and having to validate their signatures in the critical path to accepting the block.

I've started seeing CPU spikes on one of my nodes which I think is a result of this (I don't find it particularly concerning since that node (a) runs a debug build which does extra processing, (b) accepts significantly more connections than the default, and (c) runs on a small/slow VPS); those spikes seem to have been resolved by accepting the lower fee txs, though time will tell.

Personally, I'm pretty disappointed at the lack of any attempt to justify and coordinate this change it in advance to avoid hitting problems in practice. Huge amounts of FAFO energy these days.

@darosior
Copy link
Member

@RobinLinus do you plan on addressing review here? Reminder that feature freeze is less than a month from now.

@petertodd
Copy link
Contributor

@murchandamus

Reducing DEFAULT_MIN_RELAY_TX_FEE only makes sense to me in conjunction with reducing DEFAULT_BLOCK_MIN_TX_FEE.

Reducing the default minimum relay feerate is safe if we're confident that plenty of hash power is in fact mining those transactions. The block minimum tx feerate default does not need to be tied to that change if you think of it in terms of a recommendation for profitability: while miners may choose to mine transactions with feerates so low that they may be losing subsidy revenue on stales, there's no reason to do it by default. Besides, worst case is that your mempool will fill up with low feerate junk that no-one is mining, eventually hitting the size limit, and the problem will mostly fix itself as the minimum is increased automatically.

Meanwhile, decreasing the default relay feerate in a world where plenty of blocks do in fact have those transactions in them will decrease propagation time and reduce stales for everyone because it'll improve block reconstruction rates.

So no, I don't think we need to necessarily tie those two parameters together.

Finally, it'd be good to get some data on sub-1sat/vB-delta RBF replacements. My Alice and Bob OpenTimestamps calendars are producing them. But I don't know if anything else is.

@petertodd
Copy link
Contributor

@ajtowns

A full block of min fee txs would currently set fees at 0.32% of the total block reward; dividing that by 10 will delay hitting 1% from being ~7 years away to ~20 years away. If you're looking towards keeping hashrate reltively stable in an environment where the BTC price stabilises instead of continuing to more than double every four years, this is probably a step backwards, and setting an expectation that it fees will either decrease in BTC terms or stay stable in fiat/real terms is probably misleading, even in the medium term.

This discussion is getting close to being off topic. You're really discussing the wider problem of how to pay for mining security going forward. Given how many miners have started mining sub-1sat/vB transactions, even when no widely deployed fork of Bitcoin Core relays them by default, it's clear that the forces at play here are purely economic. There's nothing we can do in Core to entice higher fee revenue if market dynamics simply don't provide a reason for that fee revenue to exist; we've done an excellent job of decoupling transactional use of Bitcoin with on-chain transaction fees, and we're only going to do an even better job of that in the future as L2 systems like Lightning and Ark are even further deployed. Anything Core tries to do here is almost certainly going to take the form of some kind of censorship/filtering of low feerate transactions, and that clearly does not work.

Obviously, there's another solution that has worked so far for reliably paying for mining security, taxation of BTC savings. But discussion of the economics of that (and fee revenue) really belongs on venues like the mailing list. Not this PR.

@murchandamus
Copy link
Contributor

As hinted by @glozow above, mempool_opts.min_relay_feerate is set automatically to the minimum of incrementalrelayfee and minrelaytxfee, so to lower the minimum feerate for what is accepted into a node’s mempool, which means that either DEFAULT_INCREMENTAL_RELAY_FEE also has to be lowered or the two need to be decoupled. I would still maintain that relaying things that aren’t mined by default would be odd, and so it sounds to me that lowering the DEFAULT_MIN_RELAY_TX_FEE would entail also lowering DEFAULT_INCREMENTAL_RELAY_FEE and DEFAULT_BLOCK_MIN_TX_FEE.

The following PRs might be interesting to the people developing this PR:

@RobinLinus
Copy link
Author

Since similar arguments keep coming up: The sole purpose of the minimum relay fee should be DoS protection. Trying to fix the security budget by imposing administered prices on block space seems misguided—market forces will likely circumvent such price controls and make things worse in the process.

@murchandamus
Copy link
Contributor

murchandamus commented Jul 23, 2025

Maybe the intent of my comment wasn’t clear. We are seeing that blocks including lower feerate transactions take significantly longer to get propagated, and the way I’m reading the sentiment here, a lot of people do not share my concern over a potential DoS protection reduction. In so far, it seems that there is at least interest in this PR being further developed. My suggestion is that if someone were to address the review feedback here, they should probably lower all three settings, not just the one. However, this breaks a dozen tests or so, there seem to be some more missing that it should be breaking, and feerate estimation currently doesn’t do below 1 s/vB, so this PR might be more involved than it seems at first glance.

Regarding the expectations around feerates, my concern is rather that overly cheap blockspace fosters the creation of some use cases that will inherently get priced out in the long run again, so facilitating the oddly low feerates at this time may set us up for a social backlash later down the road. OTOH, people getting outspent is a pretty clear signal that might speak for itself clearly enough.

@ArmchairCryptologist
Copy link

feerate estimation currently doesn’t do below 1 s/vB, so this PR might be more involved than it seems at first glance

IMHO it would probably be reasonable to stagger changes to wallet/fee estimation for one release, and only change the thresholds for mempool/relay and possibly mining initially. Based on some stats from my own nodes, I would assume that relaying sub-1 sat/vB transactions will still be spotty for some time after a new version with changed defaults is released.

Node 1: Of 199 connected nodes, 146 set a minfeefilter; 141 are using the default, while 5 are 100 sats/vkB or below. 45 nodes are running 29.x

Node 2: Of 188 connected nodes, 138 set a minfeefilter; 134 are using the default, while 4 are 100 sats/vkB or below. 42 nodes are running 29.x

In other words, 95%+ of nodes are using the default relay thresholds, and ~25% are on 29.x three months after release. So for nodes with fewer connections, lower-fee transactions might not reliably propagate for some time unless you actively seek out nodes that will accept them. (For comparison, Bitnodes is reporting 16.95% on 29.0.0.)

There are quite a few nodes that do not set a minfeefilter, but I would assume that most of those are either non-relaying spy nodes that I failed to block, or older nodes that predate this filter but that still won't relay transactions with lower fees.

@murchandamus
Copy link
Contributor

@RobinLinus, are you planning on working on this?

@RobinLinus
Copy link
Author

RobinLinus commented Jul 28, 2025

@RobinLinus, are you planning on working on this?

I'm interested in working on this, but I'm currently too busy moving apartments. I plan to revisit it in about two weeks. In the meantime, it would be greatly appreciated if someone could help fix the tests that fail when adjusting DEFAULT_BLOCK_MIN_TX_FEE.

@delta1
Copy link

delta1 commented Jul 29, 2025

should probably lower all three settings, not just the one. However, this breaks a dozen tests or so, there seem to be some more missing that it should be breaking, and feerate estimation currently doesn’t do below 1 s/vB

@murchandamus I'm busy with this to make some progress while @RobinLinus is away, what's the process - create a new PR as a continuation of this one?

When you say "there seem to be some more missing that it should be breaking" - what do you mean?

@1440000bytes

This comment was marked as abuse.

@sipa
Copy link
Member

sipa commented Jul 29, 2025

Concept ACK.

@darosior
Copy link
Member

darosior commented Jul 29, 2025

@delta1 i would suggest picking up #13990 and #13922. In this order, or make a good argument why it would be fine to lower the settings without first making the fee estimation be compatible.

Feel free to ping me for review, i think this is important it makes it into the next release. I'm managing expectations however since, as it's been pointed out multiple times already, this is a lot less trivial than some people in this thread seem to assume.

@delta1
Copy link

delta1 commented Jul 29, 2025

@darosior thanks I intend to make fee estimation work correctly as well

@murchandamus
Copy link
Contributor

should probably lower all three settings, not just the one. However, this breaks a dozen tests or so, there seem to be some more missing that it should be breaking, and feerate estimation currently doesn’t do below 1 s/vB

@murchandamus I'm busy with this to make some progress while @RobinLinus is away, what's the process - create a new PR as a continuation of this one?

Given that this branch is on Robin’s repository, it would be the easiest to create your own branch and PR (unless you are working with Robin on it and are talking about making a pull request to his branch). Please be sure to address the comments from this PR on your new PR.

When you say "there seem to be some more missing that it should be breaking" - what do you mean?

I was referring to what instagibbs said above:

If tests aren't breaking, a good place to start would be to write a test that breaks on these changes, then fix them in feature commit. As of now, nothing breaks which is concerning.

@ajtowns
Copy link
Contributor

ajtowns commented Jul 30, 2025

@delta1 i would suggest picking up #13990 and #13922. In this order, or make a good argument why it would be fine to lower the settings without first making the fee estimation be compatible.

I don't think fee estimation should be a blocker for the relay change. If anything, the reverse: while sub-1sat/vb txs don't relay well, it would be annoying if your fee estimates dropped resulting in your txs also not relaying well.

You could get the best of both worlds by fixing fee estimation first, then having a hardcoded flag day when the default relay fee automatically drops, but that ship has probably sailed.

@luke-jr
Copy link
Member

luke-jr commented Jul 31, 2025

Concept NACK. Everything below 1s/vB is spam. There's no reason to change the default.

Over that period the USD price of BTC has risen by roughly 2-3 orders of magnitude,

It's the USD that has fallen, Bitcoin has remained more or less the same.

This maintains DoS resistance without discouraging low-value UTXO consolidation.

DoS resistance is clearly insufficient even at 1s/vB.

Also, this logically implies a reduction of the dust limit, making spam attacks even worse on that front.

@luke-jr
Copy link
Member

luke-jr commented Jul 31, 2025

Actually, Bitcoin probably hasn't even kept up its value, so if anything we should be looking to increase the default relay fee, if maintaining the same actual-value cost is the goal.

@petertodd
Copy link
Contributor

petertodd commented Jul 31, 2025 via email

@petertodd
Copy link
Contributor

petertodd commented Jul 31, 2025 via email

@1440000bytes

This comment was marked as abuse.

@ArmchairCryptologist
Copy link

Luke isn't wrong if runes and inscriptions are considered spam. Minimum fee is still above 1 sat/vbyte in most blocks and sub 1 sat/vbyte fee rate is mostly used by runes and inscription transactions.

It's irrelevant whether or not anyone considers any transaction "spam", all that matters is if miners are mining them, and they are. At the time of this writing, looking back at the last three days worth of blocks, there are about 100 blocks containing <1 sat/vB transactions, and the only pools that have mined blocks with empty space instead of these transactions are ViaBTC and WhitePool.

All you accomplish by rejecting transactions that are getting mined is slowing down block propagation, and potentially wasting CPU cycles and bandwidth by downloading and processing the transaction twice. People who really want to do this are of course free to override the config, but doing it by default is detrimental.

@BitcoinMechanic
Copy link

It's irrelevant whether or not anyone considers any transaction "spam", all that matters is if miners are mining them, and they are.

Of course it's relevant if we're discussing what we relay and what we don't.

All you accomplish by rejecting transactions that are getting mined is slowing down block propagation, and potentially wasting CPU cycles and bandwidth by downloading and processing the transaction twice.

Completely false. It's sad to see such obvious dishonesty in here.

@fanquake
Copy link
Member

Closing this, in favour of #33106 (this can't be merged as is, and author is unavailable).

@fanquake fanquake closed this Jul 31, 2025
fanquake added a commit that referenced this pull request Aug 15, 2025
…ayfee, minrelaytxfee

ba84a25 [doc] update mempool-replacements.md for incremental relay feerate change (glozow)
18720bc [doc] release note for min feerate changes (glozow)
6da5de5 [policy] lower default minrelaytxfee and incrementalrelayfee to 100sat/kvB (glozow)
2e515d2 [prep/test] make wallet_fundrawtransaction's minrelaytxfee assumption explicit (glozow)
457cfb6 [prep/util] help MockMempoolMinFee handle more precise feerates (glozow)
3eab8b7 [prep/test] replace magic number 1000 with respective feerate vars (glozow)
5f2df0e [miner] lower default -blockmintxfee to 1sat/kvB (glozow)
d6213d6 [doc] assert that default min relay feerate and incremental are the same (glozow)
1fbee5d [test] explicitly check default -minrelaytxfee and -incrementalrelayfee (glozow)
72dc184 [test] RBF rule 4 for various incrementalrelayfee settings (glozow)
85f4988 [test] check bypass of minrelay for various minrelaytxfee settings (glozow)
e5f896b [test] check miner doesn't select 0fee transactions (glozow)

Pull request description:

  ML post for discussion about the general concept, how this impacts the wider ecosystem, philosophy about minimum feerates, etc: https://delvingbitcoin.org/t/changing-the-minimum-relay-feerate/1886

  This PR is inspired by #13922 and #32959 to lower the minimum relay feerate in response to bitcoin's exchange rate changes in the last ~10 years. It lowers the default `-minrelaytxfee` and `-incrementalrelayfee`, and knocks `-blockmintxfee` down to the minimum nonzero setting. Also adds some tests for the settings and pulls in #32750.

  The minimum relay feerate is a DoS protection rule, representing a price on the network bandwidth used to relay transactions that have no PoW. While relay nodes don't all collect fees, the assumption is that if nodes on the network use their resources to relay this transaction, it will reach a miner and the attacker's money will be spent once it is mined. The incremental relay feerate is similar: it's used to price the relay of replacement transactions (the additional fees need to cover the new transactions at this feerate) and evicted transactions (following a trim, the new mempool minimum feerate is the package feerate of what was removed + incremental).

  Also note that many nodes on the network have elected to relay/mine lower feerate transactions. Miners (some say up to 85%) are choosing to mine these low feerate transactions instead of leaving block space unfilled, but these blocks have extremely poor compact block reconstruction rates with nodes that rejected or didn't hear about those transactions earlier.
  - #33106 (comment)
  - https://x.com/caesrcd/status/1947022514267230302
  - https://mempool.space/block/00000000000000000001305770e0aa279dcd8ba8be18c3d5cf736a26f77e06fd
  - https://mempool.space/block/00000000000000000001b491649ec030aa8e003e1f4f9d3b24bb99ba16f91e97
  - https://x.com/mononautical/status/1949452586391855121

  While it wouldn't make sense to loosen DoS restrictions recklessly in response to these events, I think the current price is higher than necessary, and this motivates us changing the default soon. Since the minimum relay feerate defines an amount as too small based on what it costs the attacker, it makes sense to consider BTC's conversion rate to what resources you can buy in the "real world."

  Going off of [this comment](#32959 (comment)) and [this comment](#33106 (comment))
  - Let's say an attacker wants to use/exhaust the network's bandwidth, and has the choice between renting resources from a commercial provider and getting the network to "spam" itself it by sending unconfirmed transactions. We'd like the latter to be more expensive than the former.
  - The bandwidth for relaying a transaction across the network is roughly its serialized size (plus relay overhead) x number of nodes. A 1000vB transaction is 1000-4000B serialized. With 100k nodes, that's 0.1-0.4GB
  - If the going rate for ec2 bandwidth is 10c/GB, that's like 1-4c per kvB of transaction data
  - Then a 1000vB transaction should pay at least 4c
  - $0.04 USD is 40 satoshis at 100k USD/BTC
  - Baking in some margin for changes in USD/BTC conversion rate, number of nodes (and thus bandwidth), and commercial service costs, I think 50-100 satoshis is on the conservative end but in the right ballpark
  - At least 97% of the recent sub-1sat/vB transactions would be accepted with a new threshold of 0.1sat/vB: #33106 (comment)

  List of feerates that are changed and why:
  - min relay feerate: significant conversion rate changes, see above
  - incremental relay feerate: should follow min relay feerate, see above
  - block minimum feerate: shouldn’t be above min relay feerate, otherwise the node accepts transactions it will never mine. I've knocked it down to the bare minimum of 1sat/kvB. Now that we no longer have coin age priority (removed in v0.15), I think we can leave it to the `CheckFeeRate` policy rule to enforce a minimum entry price, and the block assembly code should just fill up the block with whatever it finds in mempool.

  List of feerates that are not changed and why:
  - dust feerate: this feerate cannot be changed as flexibly as the minrelay feerate. A much longer record of low feerate transactions being mined is needed to motivate a decrease there.
  - maxfeerate (RPC, wallet): I think the conversion rate is relevant as well, but out of scope for this PR
  - minimum feerate returned by fee estimator: should be done later. In the past, we've excluded new policy defaults from fee estimation until we feel confident they represent miner policy (e.g. #9519). Also, the fee estimator itself doesn't have support for sub-1sat/vB yet.
  - all wallet feerates (mintxfee, fallbackfee, discardfee, consolidatefeerate, WALLET_INCREMENTAL_RELAY_FEE, etc.): should be done later. Our standard procedure is to do wallet changes at least 1 release after policy changes.

ACKs for top commit:
  achow101:
    ACK ba84a25
  gmaxwell:
    ACK ba84a25
  jsarenik:
    Tested ACK ba84a25
  darosior:
    ACK ba84a25
  ajtowns:
    ACK ba84a25
  davidgumberg:
    crACK  ba84a25
  w0xlt:
    ACK ba84a25
  caesrcd:
    reACK ba84a25
  ismaelsadeeq:
    re-ACK ba84a25

Tree-SHA512: b4c35e8b506b1184db466551a7e2e48bb1e535972a8dbcaa145ce3a8bfdcc70a8807dc129460f129a9d31024174d34077154a387c32f1a3e6831f6fa5e9c399e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.