Bitcoin Forum
May 24, 2024, 04:12:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Auto-setting min relay fee + RBF possible attack vector in 0.12  (Read 724 times)
dive (OP)
Full Member
***
Offline Offline

Activity: 194
Merit: 180


View Profile
January 17, 2016, 07:49:18 PM
 #1

Reading the release notes for 0.12 RC I was wondering of a possible attack vector introduced there so would like to check the scenario here before doing further review of the code (yeap - sometimes asking saves a lot of time) and testing it out.

- PR #6722 adds an automatic update of the min relay fee when mempool is full
- New version enables RBF

Possible scenario:
1. Flood the network with a chained TXs with high fee to use most of the standard mempool size space, bump out others txs and set a high minimum fee
2. Change through RBF the first TX with a higher fee to invalidate the entire chain
3. Long time for the entire blockchain to recover and possible disruption of services that don't rebroadcast their txs

- Cost of running the attack would be VERY low if RBF invalidates the entire chain before its added to a block.
- Making a chain of very large transactions (multiples txins and txouts) would allow for quickly fill up mempool with lower risk of propagation delay of the RBF transaction.

Ways to avoid the impact:
- RBF can only be issued if it changes entire tx chain
- RBF recalculates min relay fee based on mempool size (anticipates the half life of fee decay)

Is this scenario a possible attack vector?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3402
Merit: 6653


Just writing some code


View Profile WWW
January 17, 2016, 08:11:05 PM
 #2

Reading the release notes for 0.12 RC I was wondering of a possible attack vector introduced there so would like to check the scenario here before doing further review of the code (yeap - sometimes asking saves a lot of time) and testing it out.

- PR #6722 adds an automatic update of the min relay fee when mempool is full
- New version enables RBF

Possible scenario:
1. Flood the network with a chained TXs with high fee to use most of the standard mempool size space, bump out others txs and set a high minimum fee
2. Change through RBF the first TX with a higher fee to invalidate the entire chain
3. Long time for the entire blockchain to recover and possible disruption of services that don't rebroadcast their txs

- Cost of running the attack would be VERY low if RBF invalidates the entire chain before its added to a block.
- Making a chain of very large transactions (multiples txins and txouts) would allow for quickly fill up mempool with lower risk of propagation delay of the RBF transaction.

Ways to avoid the impact:
- RBF can only be issued if it changes entire tx chain
- RBF recalculates min relay fee based on mempool size (anticipates the half life of fee decay)

Is this scenario a possible attack vector?
IIRC nodes only store up to 25 transactions in an unconfirmed transaction chain in their mempools. Anything more than that will not be kept in the mempool and will simply be rejected.

Also, I think since changing that transaction would invalidate the entire chain, the chain would also be discarded.

dive (OP)
Full Member
***
Offline Offline

Activity: 194
Merit: 180


View Profile
January 17, 2016, 08:32:31 PM
 #3

IIRC nodes only store up to 25 transactions in an unconfirmed transaction chain in their mempools. Anything more than that will not be kept in the mempool and will simply be rejected.

You are right. 25tx or 100Kb.
So considering that maxmempool default is 300MB, and maximum chain size is 100kb, you'd need 3000 chains to clog the mempool.
To bump the minimum fee from 1000 satoshi/kb to 10000 satoshi/kb would only cost 0.3BTC

Also, I think since changing that transaction would invalidate the entire chain, the chain would also be discarded.

Yes - the chain is discarded but I don't think the minimum fee is updated when this happens.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!