I am very interested in the p2p protocol used by Bitcoin clients. There are some excellent answers here that describe the way clients connect to the network.

I want to replicate the peer-to-peer network only without participating in the crypto-currency part. This is for an experiment on peer to peer discovery.

So, can you please show me some code instructions to set-up such a network?

1 Answer 1


This is a good start point to understand better the code related to peers discovery and management: https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp
I can't help you directly writing such a code for you but Bitcoin p2p is very similar to bittorrent one or similar. The greatness in Bitcoin is properly the fact that it has such (crypto)currency functionalities, so why should you use the Bitcoin protocol to create a p2p app which has no interest of using the main feature of the original code?
I think there are different code bases more suitable for your research.

  • 1
    Thanks! Yes. There are other code bases; just wanted to check out Bitcoin. Jun 9, 2017 at 10:04

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.