3

I understand that in a hardfork (e.g. the actual Bitcoin vs. Bitcoin Cash/Gold) the blockchains would diverge because the miners and clients have different rules to accept a valid block. It makes sense to me how you could get two or more divergent databases in this way, theoretically.

What's less clear to me is how the actual network joins itself together in practice. Are full nodes on one chain constantly bombarded by the blocks of the other? What keeps a spend [of pre-fork holdings] on one chain from accidentally — or for that matter intentionally! — propagating to the other?

1

2 Answers 2

4

Ports

One way that forks can deliberately separate themselves is by using a different TCP port number for network communications.

Currency Port
Bitcoin 8333
Litecoin 9333

Handshake

When two Bitcoin-like programs communicate with one another, there is an expected initial pattern to the communication, an expected form of data exchanged and some expected data values. We call this a handshake. Programs can use this to identify whether the other program they are communicating with looks sufficiently like themselves (whether their handshake feels right). See protocol documentation, especially version message details and protocol-version number.

Discovery

Another route for separation might be differences in the peer-discovery process. It would be natural for dissenting groups creating new forks to replace the seed nodes with ones they run themselves.

Shunning

Another mechanism is that BTC nodes reject "bad" data provided by BCH or BSV nodes on port 8333, and vice versa. This is because of consensus rule conflicts. That would eventually cause each set of nodes to blacklist the other. As Pieter Wuille commented: "Relaying an invalid block is a protocol violation (in most cases; there are exceptions), and (in Bitcoin Core) will cause the peer to be considered misbehaving. Misbehaving peers are eventually put on a "discouraged" list, which means their connection slot will be dropped and replaced by another when a non-discouraged IP connects. Bitcoin Core further has a mechanism to temporarily actively seek out extra connections when it appears none of its peers have a recent valid block".

5
  • 1
    The P2P handshake may also be different (en.bitcoin.it/wiki/Protocol_documentation#version). It depends really whether the hard fork was trying to disrupt Bitcoin as much as possible or it was happy to "play nice" and have a different port, P2P handshake etc May 10 at 11:00
  • 1
    @Michael, Thanks, I'll add that to my answer. May 10 at 12:03
  • 1
    @RedGrittyBrick The shunning is correct. Relaying an invalid block is a protocol violation (in most cases; there are exceptions), and (in Bitcoin Core) will cause the peer to be considered misbehaving. Misbehaving peers are eventually put on a "discouraged" list, which means their connection slot will be dropped and replaced by another when a non-discouraged IP connects. Bitcoin Core further has a mechanism to temporarily actively seek out extra connections when it appears none of its peers have a recent valid block. May 10 at 12:57
  • @Pieter: Thanks, I have added that information to the answer. May 10 at 15:17
  • Thanks for finding my old question and offering such a well-rounded answer after all these years! Makes sense that any of these mechanisms could keep the forks mostly separate, and especially when working all in combination.
    – natevw
    May 11 at 22:29
0

It looks like there is no standard on network joins itself together in practice. According to A History of Bitcoin Hard Forks:

   The fact that no one person or group can determine when and how bitcoin should be upgraded has similarly made the process of updating the system more complex. In the years following the Genesis Block, there have been several hard forks.

Additionally, this is the general rule of hard fork (Hard Fork (Blockchain)): How Fork Works

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.