I can use bitcoin-cli getpeerinfo to get the peer nodes' information. Is there some way to further get the peer nodes' peer nodes, i.e. the 2-order neighbor node?

1 Answer 1


No, that is not possible. The P2P protocol offers no such feature, by design.

The topology of the network graph is considered secret, because someone who knows how nodes are connected could leverage it to do other attacks (e.g. partitioning attacks or eclipse attacks).

Despite that, the protection against revealing this information is however only best effort, as it is very hard to completely exclude the possibility for peers to infer something. For example, a paper from 2018 called TxProbe: Discovering Bitcoin’s Network Topology Using Orphan Transactions showed how to infer connections between attacker-connected nodes using conflicting transactions. Several techniques using (IP) address gossip messages on the network have also been described. These attacks do get fixed or partially mitigated when discovered, but many more probably exist.

Still, it does mean you'll effectively need to find an exploit to get this information. It's not exposed deliberately as a feature.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.