<p>Bitcoin is programmed to accept the most proof-of-work chain, which is many times also the longest chain. Every new block added to the blockchain references the previous block with its hash. Based on your question, there are a number of cases that I have come up with and how your new 'forked' blockchain will react.</p>

<ul>
<li><strong>You run the same software that Bitcoin is currently working on</strong>: your software will automatically accept blocks from other peers and add it to the genesis block. This will bring you to the current Bitcoin blockchain</li>
<li><strong>You change the genesis block, but use the same DNS seeding</strong>: when the peers will send you new blocks, the previous block hash reference in block 1 will not match your new genesis block header hash and hence that block cannot be added. This you have now generated a completely new chain.</li>
<li><strong>You fork the blockchain but change rules at certain point</strong>: This is how Bitcoin Cash was created. From a particular block height they increased the block size to more than 1MB, which resulted in the original Bitcoin nodes rejecting the newly generated blocks. So you now have a different chain from a particular height.</li>
</ul>

CC BY-SA 4.0
2019-06-29T06:12:10.230Z
2019-06-29T06:12:10.230Z
Ugam Kamat
<p>The first 4 bytes of every message sent over the bitcoin network protocol contain a "magic number," which identifies it as Bitcoin or some other chain. Bitcoin's magic number for mainnet is 0xD9B4BEF9. Anyone forking the code to implement a different chain should use a new magic number to distinguish it from Bitcoin.</p>

<p>You could technically have multiple chains with the same piece of software if they handle messages based on the magic number, but it's more likely that you would run them as independent pieces of software, in which case, you will use a different listening port for the software to receive incoming connections. (TCP does not allow multiple software to listen on the same port by regular means). Each blockchain would know which port to connect to on your machine because it would've been advertised via gossip or DNS.</p>

CC BY-SA 4.0
2019-06-29T06:30:54.517Z
2019-06-29T06:30:54.517Z
Mark H
<p>This will probably sound stupid but what would happen if you create an entirely new Bitcoin block chain and run it on the same computer. How does a node know which version of the Bitcoin block chain to talk to? Does each block chain have a unique identifier?</p>

<blockchain><network><nodes>
What would happen if you tried to follow two Bitcoin blockchains from the same computer?
Perz
# What would happen if you tried to follow two Bitcoin blockchains from the same computer?

(Asked by: username_0 on 2019-06-29)

This will probably sound stupid but what would happen if you create an entirely new Bitcoin block chain and run it on the same computer. How does a node know which version of the Bitcoin block chain to talk to? Does each block chain have a unique identifier?

**Tags:** blockchain, network, nodes


---

## 2 answers

### Answer by username_1 on 2019-06-29. Score: 0

Bitcoin is programmed to accept the most proof-of-work chain, which is many times also the longest chain. Every new block added to the blockchain references the previous block with its hash. Based on your question, there are a number of cases that I have come up with and how your new 'forked' blockchain will react.

* **You run the same software that Bitcoin is currently working on**: your software will automatically accept blocks from other peers and add it to the genesis block. This will bring you to the current Bitcoin blockchain
* **You change the genesis block, but use the same DNS seeding**: when the peers will send you new blocks, the previous block hash reference in block 1 will not match your new genesis block header hash and hence that block cannot be added. This you have now generated a completely new chain.
* **You fork the blockchain but change rules at certain point**: This is how Bitcoin Cash was created. From a particular block height they increased the block size to more than 1MB, which resulted in the original Bitcoin nodes rejecting the newly generated blocks. So you now have a different chain from a particular height.


---

### Answer by username_2 on 2019-06-29. Score: 0

The first 4 bytes of every message sent over the bitcoin network protocol contain a "magic number," which identifies it as Bitcoin or some other chain. Bitcoin's magic number for mainnet is 0xD9B4BEF9. Anyone forking the code to implement a different chain should use a new magic number to distinguish it from Bitcoin.

You could technically have multiple chains with the same piece of software if they handle messages based on the magic number, but it's more likely that you would run them as independent pieces of software, in which case, you will use a different listening port for the software to receive incoming connections. (TCP does not allow multiple software to listen on the same port by regular means). Each blockchain would know which port to connect to on your machine because it would've been advertised via gossip or DNS.


---

