free web page hit counter
How to properly do spam protection of mempool

How to properly do spam protection of mempool

Bitcoin Reddit

Reddit / Bitcoin Reddit 53 Views

Recently we've seen some shouts from memo users which touched on the mempool acceptance policies. This post is a higher level introduction of how we can manage mempool issues. This isn't a direct answer to those shouts, just brings a better understanding for all.

In any full node there is a mempool of validated transactions. Back in 2014 or so we had some attacks where people were sending millions of transactions to the network and the effect was full nodes going down because they ran out of memory.

We initially had some ideas on how to protect the node but we quickly realized that we had to have a simple goal;

Always accept real, money transactions while limiting inflow of non-money transactions.

What this means in real world terms is that if someone is spamming the network with silly transactions in order to make it slow and unusable, we can distinguish between those and others where people standing in the store and wanting to pay for something won't ever notice this "attack".

Again, all this is to protect the full node from being overwhelmed and having too many transactions in their memory-pool, causing it to run out of memory and crash.

The main way to do this has been discussed a couple of years ago. The main approach in Bitcoin Core is fees. And nothing but fees. Lets improve on that and define a list of priorities;

  1. Coin-age of spent coin (days-destroyed). Older is better.
  2. Ratio of inputs to outputs in one transaction. More inputs is better.
  3. Sigops count. Less is better.
  4. Transaction size in bytes. Smaller is better.
  5. Fees paid to the miner.

For instance we already have, and have had for many years, a free-transaction-limiter. Which means that zero-fee transactions are allowed, but only a certain number per minute are accepted.

In the memo case it violates the first rule in a particularly spectacular fashion. Without offsetting it with any of the other points being significantly better.

In the coming years we'll see all mining nodes implement the above priority list, where nodes protect themselves from being overwhelmed with cheap transactions by rejecting ones that show very low effort. At the same time people that spend money in the store will typically have a very good score on the priorities table and those will always be accepted in the mempool.

submitted by /u/ThomasZander
[link] [comments]