<p>I created an Altcoin based on this article. <a href="https://medium.com/@jordan.baczuk/how-to-fork-bitcoin-c39139506443" rel="nofollow noreferrer">https://medium.com/@jordan.baczuk/how-to-fork-bitcoin-c39139506443</a></p>

<p>The article mentions 13 steps but I changed only the message prefix.</p>

<pre><code>$ git branch
* v0.17.1

$ git diff
+++ b/src/chainparams.cpp
+        pchMessageStart[0] = 0xf1;
+        pchMessageStart[1] = 0xb2;
+        pchMessageStart[2] = 0xb3;
+        pchMessageStart[3] = 0xd4;
</code></pre>

<p>I started 3 processes; two forked bitcoind and one original bitcoind. forkA tries to connect to both original and forkB bitcoind. </p>

<pre><code># forkA
/home/zono/bitcoinA/src/bitcoind -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -datadir=$HOME/regtest/A/ -connect=localhost:17592 -connect=localhost:17593 -regtest -pid=$HOME/regtest/A/.pid -daemon -debug -listenonion=0

# original
/home/zono/bitcoinB/src/bitcoind -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16592 -datadir=$HOME/regtest/B/ -regtest -pid=$HOME/regtest/B/.pid -daemon -debug -listenonion=0

# forkB
/home/zono/bitcoinC/src/bitcoind -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16593 -datadir=$HOME/regtest/C/ -regtest -pid=$HOME/regtest/C/.pid -daemon -debug -listenonion=0
</code></pre>

<p>As you can see, forkA is connecting to forkB (port=17593)</p>

<pre><code>$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getpeerinfo
[
  {
    "id": 2,
    "addr": "localhost:17593",
    "addrbind": "127.0.0.1:37256",
    "services": "000000000000040d",
  ...
  }
]
</code></pre>

<p>You can see that original bitcoind refused to connect from forkA. (INVALID MESSAGESTART)</p>

<pre><code># forkA
2019-02-14T14:52:33Z trying connection localhost:17592 lastseen=0.0hrs
2019-02-14T14:52:33Z Added connection peer=2685
2019-02-14T14:52:33Z sending version (102 bytes) peer=2685
2019-02-14T14:52:33Z send version message: version 70015, blocks=0, us=[::]:0, peer=2685
2019-02-14T14:52:33Z socket closed
2019-02-14T14:52:33Z disconnecting peer=2685
2019-02-14T14:52:33Z Cleared nodestate for peer=2685

# original
2019-02-14T14:52:33Z Added connection peer=2684
2019-02-14T14:52:33Z connection from 127.0.0.1:54808 accepted
2019-02-14T14:52:33Z PROCESSMESSAGE: INVALID MESSAGESTART version peer=2684
2019-02-14T14:52:33Z disconnecting peer=2684
2019-02-14T14:52:33Z Cleared nodestate for peer=2684
</code></pre>

<p>A generated block on forkA is propagated to only forkB. </p>

<pre><code># generate 1 block on forkA
./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest generate 1

# forkA. current block = 1
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 1,

# original. current block = 0
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16592 -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 0,

# forkB. current block = 1
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16593 -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 1,
</code></pre>

CC BY-SA 4.0
2019-02-14T15:17:59.550Z
2019-02-14T15:17:59.550Z
zono
<p>Here is a tutorial I have used to create my own altcoin: <a href="https://www.hackster.io/pjdecarlo/how-to-make-a-cryptocurrency-using-litecoin-v0-15-source-fb5e82" rel="nofollow noreferrer">https://www.hackster.io/pjdecarlo/how-to-make-a-cryptocurrency-using-litecoin-v0-15-source-fb5e82</a></p>

CC BY-SA 4.0
2019-02-01T20:32:31.733Z
Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.
Ava Chow
CC BY-SA 4.0
2019-01-30T17:30:17.833Z
2019-02-15T10:27:33.737Z
2019-02-15T10:27:33.737Z
Leo Cornelius
<p>Is there any tutorial for altcoin fork creation?
I've found only tutorials for the very old versions, and any for the current ones.</p>

CC BY-SA 3.0
2017-12-02T22:27:29.810Z
You usually have to have knowledge of the programming language used to make various changes. The merkle-root, genesis block hash, and other coin info would need to be changed for the coin to operate as expected.
Monstrum
CC BY-SA 3.0
2017-12-02T22:36:03.543Z
Will it work if i'm trying to generate a new genesis block? I've set a new timestamp, and all other values (including asserts) to 0x0.
I've set to 0x0 the following variables: genesisOutputScript, BIP34Hash, defaultAssumeValid Removed the seeds and asserts, and I've set a new timestamp (unix and the text one). After that I've run make and got the result below.
user8519841
CC BY-SA 3.0
2017-12-02T23:18:08.603Z
Which altcoin are you trying to fork?
Monstrum
CC BY-SA 3.0
2017-12-03T07:25:57.973Z
The Bitcoin one.
user8519841
CC BY-SA 3.0
2017-12-03T07:28:54.493Z
Am I doing the right steps?
user8519841
CC BY-SA 4.0
2019-01-31T13:15:23.903Z
Hi, have you read this post? seems nice. https://bitcointalk.org/index.php?topic=3345808.0
zono
<altcoin><c++>
Altcoin fork tutorial
user8519841
# Altcoin fork tutorial

(Asked by: username_0 on 2017-12-01)

Is there any tutorial for altcoin fork creation?
I've found only tutorials for the very old versions, and any for the current ones.

**Tags:** altcoin, c++

> **Comments:**
> **username_1**: You usually have to have knowledge of the programming language used to make various changes. The merkle-root, genesis block hash, and other coin info would need to be changed for the coin to operate as expected.  
> **username_0**: Will it work if i'm trying to generate a new genesis block? I've set a new timestamp, and all other values (including asserts) to 0x0. I've set to 0x0 the following variables: genesisOutputScript, BIP34Hash, defaultAssumeValid Removed the seeds and asserts, and I've set a new timestamp (unix and the text one). After that I've run make and got the result below.  
> **username_1**: Which altcoin are you trying to fork?  
> **username_0**: The Bitcoin one.  
> **username_0**: Am I doing the right steps?  
> **username_2**: Hi, have you read this post? seems nice. https://bitcointalk.org/index.php?topic=3345808.0  

---

## 2 answers

### Answer by username_2 on 2019-02-14. Score: 1

I created an Altcoin based on this article. <https://medium.com/@jordan.baczuk/how-to-fork-bitcoin-c39139506443>

The article mentions 13 steps but I changed only the message prefix.

```
$ git branch
* v0.17.1

$ git diff
+++ b/src/chainparams.cpp
+        pchMessageStart[0] = 0xf1;
+        pchMessageStart[1] = 0xb2;
+        pchMessageStart[2] = 0xb3;
+        pchMessageStart[3] = 0xd4;

```

I started 3 processes; two forked bitcoind and one original bitcoind. forkA tries to connect to both original and forkB bitcoind.

```
# forkA
/home/username_2/bitcoinA/src/bitcoind -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -datadir=$HOME/regtest/A/ -connect=localhost:17592 -connect=localhost:17593 -regtest -pid=$HOME/regtest/A/.pid -daemon -debug -listenonion=0

# original
/home/username_2/bitcoinB/src/bitcoind -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16592 -datadir=$HOME/regtest/B/ -regtest -pid=$HOME/regtest/B/.pid -daemon -debug -listenonion=0

# forkB
/home/username_2/bitcoinC/src/bitcoind -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16593 -datadir=$HOME/regtest/C/ -regtest -pid=$HOME/regtest/C/.pid -daemon -debug -listenonion=0

```

As you can see, forkA is connecting to forkB (port=17593)

```
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getpeerinfo
[
  {
    "id": 2,
    "addr": "localhost:17593",
    "addrbind": "127.0.0.1:37256",
    "services": "000000000000040d",
  ...
  }
]

```

You can see that original bitcoind refused to connect from forkA. (INVALID MESSAGESTART)

```
# forkA
2019-02-14T14:52:33Z trying connection localhost:17592 lastseen=0.0hrs
2019-02-14T14:52:33Z Added connection peer=2685
2019-02-14T14:52:33Z sending version (102 bytes) peer=2685
2019-02-14T14:52:33Z send version message: version 70015, blocks=0, us=[::]:0, peer=2685
2019-02-14T14:52:33Z socket closed
2019-02-14T14:52:33Z disconnecting peer=2685
2019-02-14T14:52:33Z Cleared nodestate for peer=2685

# original
2019-02-14T14:52:33Z Added connection peer=2684
2019-02-14T14:52:33Z connection from 127.0.0.1:54808 accepted
2019-02-14T14:52:33Z PROCESSMESSAGE: INVALID MESSAGESTART version peer=2684
2019-02-14T14:52:33Z disconnecting peer=2684
2019-02-14T14:52:33Z Cleared nodestate for peer=2684

```

A generated block on forkA is propagated to only forkB.

```
# generate 1 block on forkA
./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest generate 1

# forkA. current block = 1
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16591 -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 1,

# original. current block = 0
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16592 -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 0,

# forkB. current block = 1
$ ./bitcoinA/src/bitcoin-cli -rpcuser=bitcoinrpc -rpcpassword=bitcoinrpcpass -rpcport=16593 -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 1,

```


---

### Answer by username_3 on 2019-01-30. Score: 0

Here is a tutorial I have used to create my own altcoin: <https://www.hackster.io/pjdecarlo/how-to-make-a-cryptocurrency-using-litecoin-v0-15-source-fb5e82>

> **Comments:**
> **username_4**: Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.  

---

