I read a lot about how bitcoin clients find each other. I would like to do a fork from bitcoin and I have a question. How my network will differ from bitcoin? How the client will understand if this is bitcoin's client or mine?


This seems like a silly question. If you're going to create new software, it will work as you program it.

It will differ in exactly the ways you make it.


Firstly, it's likely another coin would use different default ports to connect to. But assuming they used the same ports, two clients try to connect to each other by a handshake style exchange of information such as what version clients they are, what service bits/things they support (e.g. segwit, etc.). So a different coin would advertise itself as a different client during that initial handshake, and wouldn't connect if it wasn't compatible.


When you make your fork, you must change the default P2P port and change the network magic bytes. The network magic bytes are four byte which are found at the start of every single network message. By changing them, you are signalling to all nodes that you are using a different network and thus any Bitcoin node that connects to you will disconnect from you and all of your coin's nodes will disconnect from Bitcoin nodes.

Changing the default P2P network port will also help as nodes will really only connect to other nodes that are using the default port.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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