<p>First of all, there is no "The mempool". Every full node has an individual mempool, and as these contain no transactions that are already in blocks (confirmed transactions), by definition nodes cannot be guaranteed to have agreement about it. So, what you're looking at it blockchain.info's mempool, which may or may not be similar to that of other nodes.</p>

<p>What can cause differences between mempools? One obvious example is in the case of a double spend: no conflicting transactions are allowed in it, so if two distinct transactions which spend the same inputs are broadcast into different places of the network, some will accept one, others will accept the other, based on which they hear first. That's not the only difference, though. Nodes can also have different mempool acceptance policies.</p>

<p>A node's mempool is ultimately its expectation for what transactions may reasonably confirm in the short to medium term. Good mempool acceptance policies are trying to model that expectation. If a transaction's fee is very low, it may not be worth keeping around if there are plenty of higher fee transactions to mine first. </p>

<p>And that is the basis for the mempool DoS protection that was added in Bitcoin Core 0.12. Roughly, whenever the mempool's memory usage goes over a certain preconfigured size (the <code>-maxmempool</code> setting), we kick out the transactions with the lowest feerate, and (temporarily) increase the minimum feerate to get in in the future to that of the evicted ones. That solves the issue of unbounded memory usage.</p>

<p>But what about bandwidth? Things like BIP125 and this eviction described above essentially result in the ability to keep broadcasting transactions, and have them be accepted and replace other transactions, without really paying anything. I say paying here, because the fundamental rule we base mempool policy decisions on is that since we expect transactions in the mempool to confirm, and thus pay their fee. Thus, we'd want a rule that whenever something is evicted from the mempool (for whatever other reason than it confirming), something else pays "something" for that relay. In practice this is accomplished by having a separately configured relay feerate (which does not change when the mempool is full), that specifies the "price" for relay. In the case of mempool eviction, the new transaction(s) must pay at least that relay fee more than the fee of the replaced ones.</p>

CC BY-SA 3.0
2017-02-08T08:29:07.767Z
Good answer, I cannot +1 without reputation though!
O.O.
CC BY-SA 3.0
2017-02-07T17:26:42.583Z
2017-04-02T07:51:52.607Z
2017-04-02T07:51:52.607Z
Pieter Wuille
<p>The mempool currently seems to contain almost 60K <a href="https://blockchain.info/unconfirmed-transactions" rel="nofollow noreferrer" title="unconfirmed transactions">unconfirmed transactions</a>, and the number seems to be growing.
According to <a href="https://bitcoin.stackexchange.com/questions/9709/do-unconfirmed-transactions-expire" title="Mempool expiration">this question</a>, it seems that unconfirmed transactions are eventually purged.</p>

<p><a href="https://bitcoin.stackexchange.com/questions/40425/what-prevents-an-attacker-from-doing-ddos-on-bitcoin-network-by-sending-billions">Other answers</a> indicate that it is impractical to hamper the transactions of others to go through by trying to fill blocks with your own transactions. That question does however not mention problems that the nodes would face in having to deal with a too large number of transactions being passed around (without considering them being included in the block at all).</p>

<p>Would it be possible for a malicious user to send a lot of transactions (say from the same valid address) to the network, aiming to increase the size of the node mempools, and thus cause problems? 
Has something like this happened?</p>

<p>Or does the purging happen fast enough, and are the unspent transactions small enough, for a growing mempool not to be a problem for the network nodes?
Are there any other common features implemented that protect against a bloating of the mempool?</p>

<attack><mempool>
What is protecting the mempool from being DDOSd?
O.O.
# What is protecting the mempool from being DDOSd?

(Asked by: username_0 on 2017-02-07)

The mempool currently seems to contain almost 60K [unconfirmed transactions](https://blockchain.info/unconfirmed-transactions "unconfirmed transactions"), and the number seems to be growing.
According to [this question](https://bitcoin.stackexchange.com/questions/9709/do-unconfirmed-transactions-expire "Mempool expiration"), it seems that unconfirmed transactions are eventually purged.

[Other answers](https://bitcoin.stackexchange.com/questions/40425/what-prevents-an-attacker-from-doing-ddos-on-bitcoin-network-by-sending-billions) indicate that it is impractical to hamper the transactions of others to go through by trying to fill blocks with your own transactions. That question does however not mention problems that the nodes would face in having to deal with a too large number of transactions being passed around (without considering them being included in the block at all).

Would it be possible for a malicious user to send a lot of transactions (say from the same valid address) to the network, aiming to increase the size of the node mempools, and thus cause problems?
Has something like this happened?

Or does the purging happen fast enough, and are the unspent transactions small enough, for a growing mempool not to be a problem for the network nodes?
Are there any other common features implemented that protect against a bloating of the mempool?

**Tags:** attack, mempool


---

## 1 answers

### Answer by username_1 on 2017-02-07. Score: 7 | Accepted answer

First of all, there is no "The mempool". Every full node has an individual mempool, and as these contain no transactions that are already in blocks (confirmed transactions), by definition nodes cannot be guaranteed to have agreement about it. So, what you're looking at it blockchain.info's mempool, which may or may not be similar to that of other nodes.

What can cause differences between mempools? One obvious example is in the case of a double spend: no conflicting transactions are allowed in it, so if two distinct transactions which spend the same inputs are broadcast into different places of the network, some will accept one, others will accept the other, based on which they hear first. That's not the only difference, though. Nodes can also have different mempool acceptance policies.

A node's mempool is ultimately its expectation for what transactions may reasonably confirm in the short to medium term. Good mempool acceptance policies are trying to model that expectation. If a transaction's fee is very low, it may not be worth keeping around if there are plenty of higher fee transactions to mine first.

And that is the basis for the mempool DoS protection that was added in Bitcoin Core 0.12. Roughly, whenever the mempool's memory usage goes over a certain preconfigured size (the `-maxmempool` setting), we kick out the transactions with the lowest feerate, and (temporarily) increase the minimum feerate to get in in the future to that of the evicted ones. That solves the issue of unbounded memory usage.

But what about bandwidth? Things like BIP125 and this eviction described above essentially result in the ability to keep broadcasting transactions, and have them be accepted and replace other transactions, without really paying anything. I say paying here, because the fundamental rule we base mempool policy decisions on is that since we expect transactions in the mempool to confirm, and thus pay their fee. Thus, we'd want a rule that whenever something is evicted from the mempool (for whatever other reason than it confirming), something else pays "something" for that relay. In practice this is accomplished by having a separately configured relay feerate (which does not change when the mempool is full), that specifies the "price" for relay. In the case of mempool eviction, the new transaction(s) must pay at least that relay fee more than the fee of the replaced ones.

> **Comments:**
> **username_0**: Good answer, I cannot +1 without reputation though!  

---

