<h3>Protocol &amp; data deserialization</h3>
<p>When your software is connecting to a peer, you are both sending raw data that respects a specific structure. It is the Bitcoin P2P protocol. So if a peer is sending bad data that you can't deserialize or that do not follow protocol, it is a &quot;bad&quot; peer. That's the first way.</p>
<h3>Data integrity</h3>
<p>The second way is to know data integrity of what the peer is sending you. For instance, if you asked a block, the peer would have to answer you with this block. However, this block might be invalid, and if it is, this peer is a BAD one. Another example, a checksum with SHA256d is used in the header of requests in the P2P v1. If it is incorrect, your software will detect it.</p>
<h3>Conclusion</h3>
<p>Bitcoin core follows its own specific network protocol. A peer which doesn't respect it will be a &quot;bad&quot; peer. There are plenty of consensus network rules. I just illustrated main ones.</p>

CC BY-SA 4.0
2023-08-23T07:18:36.523Z
2023-08-23T07:18:36.523Z
Loopite
<p>How do I know if it's a bad peer?</p>
<p>I see a lot of connections, but does the software filter out bad peers?
Or is it up to me to do it?</p>
<p>Thank you!</p>

CC BY-SA 4.0
2023-08-23T13:09:02.840Z
What do you mean with “bad peers”?
Murch
<bitcoin-core><peers>
How to identify bad peers that are connected to my node
Edward Halverson
# How to identify bad peers that are connected to my node

(Asked by: username_0 on 2023-08-21)

How do I know if it's a bad peer?

I see a lot of connections, but does the software filter out bad peers?
Or is it up to me to do it?

Thank you!

**Tags:** bitcoin-core, peers

> **Comments:**
> **username_1**: What do you mean with “bad peers”?  

---

## 1 answers

### Answer by username_2 on 2023-08-23. Score: -2

### Protocol & data deserialization

When your software is connecting to a peer, you are both sending raw data that respects a specific structure. It is the Bitcoin P2P protocol. So if a peer is sending bad data that you can't deserialize or that do not follow protocol, it is a "bad" peer. That's the first way.

### Data integrity

The second way is to know data integrity of what the peer is sending you. For instance, if you asked a block, the peer would have to answer you with this block. However, this block might be invalid, and if it is, this peer is a BAD one. Another example, a checksum with SHA256d is used in the header of requests in the P2P v1. If it is incorrect, your software will detect it.

### Conclusion

Bitcoin core follows its own specific network protocol. A peer which doesn't respect it will be a "bad" peer. There are plenty of consensus network rules. I just illustrated main ones.


---

