-snip- Has anyone provided the most straight forward way to block all or most of them to the public?
"
Straight-forward" as in no code changes?
There's this Github repository that's providing a banlist file which is compiled using bitnodes.
But since Bitnodes is now inaccessible, it hasn't been updated since April.
Here's the link anyways:
github.com/aeonBTC/Knots-BanlistThere's a script in the issues tab as an alternative.
Yes, in terms of straight-forward I am also looking for ways to make it as newbie-friendly as possible. We have quite a fair number of node runners that are not that technologically competent, and it would be nice to be able to provide them some easy ways to ban Knots nodes. Nice share, perhaps this could be a small project for someone on the forum to maintain a Knots banlist and refresh it. It is unfortunate that Bitnodes is not accessible anymore.
if "Knots" in user_agent:
This can easily result in banning peers, which you don't want to ban, or not banning those, who you want to target. A better idea would be to observe the traffic, and make decisions, based on that.
Which means banning the client, regardless of the User Agent, just if it consumes too much resources.
If we want to be objective on this level, don't we need to establish a good baseline then in order to define what is "too much"? In extreme cases it is clear, if a one node uses X amount and another 1000 times X then it is simple. But what about 25% more than X? I'd need to establish some sort of baseline to compare it fairly to catch most of them without creating too many false positives (I don't want to ban some normal node simply because it uses a little bit more than the average).
Again, it would help only for a while, but users can change their User Agent as they wish, and then, blocking next peers will be harder, if they will do that.
They can, but they fall into a trap with that. My observations:
1. In no case will all Knots users do this, perhaps not even the majority.
2. If they do this on a mass scale, they lose their sybil attack of fake nodes that is misrepresenting their support. They could claim that nodes with changes or empty user agents are Knots, but that has a much less manipulative effect.
3. Let them do it, since their nodes have a clear behavioral signature that makes them mostly distinct from Core nodes it will be easy. They would have to implement changes similar to Core in order to minimize this discrepancy and to be able to hide
within user agents.
Nevertheless I appreciate the thoughts and it would be worthwhile to work on this after deploying the easier solution first, because even in absence of the banning some peers may have already changes their node information.
Go to your favorite LLM and say "Write a python script that connects to the bitcoin core RPC using cookie authentication without using any non-standard python libraries. The script should run getpeerinfo and find all the peers that contain Knots in their subver. Then it should call disconnect node on each one of them. Then it should display ascii art of luke-jr crying."
This is a work of art, just beautiful.

I'll post an update once I try one of these and give some basic data changes. I could even post a list of the peers that I have identified and banned.
Thanks to all 3 of your for the various ideas and different approaches. I will try something out soon and see what happens to my number of connections and data usage.