I am curious if I copy bitcoin code and just change a little. Similar to make a new altcoin. If this altcoin has the same port and almost everything same just changed the bitcoin generated every block. Also I keep the genesis block the same as original bitcoin
If you are creating an altcoin, you had better change the genesis block. Why would you want or use Bitcoin’s genesis block, with an nTime of 1231006505 (2009-01-03 18:15:05Z)? Also, you will need to change:
- The port number.
- The network magic.
- The block magic number.
- The address version prefix (very important; do you see all these threads of people who sent BCH to a Bitcoin address, or vice versa?).
- A bunch of other things I am not thinking of off the top of my head for you. Do some research.
Of course, also you will need to change the name.
1 I know that if the two wallet meet each other there will be a fork problem. But I want to know at that point my altcoin will still run independently just similar to a new coin or the clone bitcoin will be dropped and only accept the original bitcoin since the original bitcoin has longer Blockchain?
This is why you change the genesis block, the network magic, and various other parameters. If you change
nothing, then your “clone” client will promptly start following Bitcoin’s blockchain instead of yours, because Bitcoin will have (many orders of magnitude) higher total POW.
2 if I make the coin generated will be different at the 100th block, whether the first 99 blocks will be the same as original bitcoin? I need to set the checkpoint at some where before 99th?
Say what? I don’t even understand this question. You should change the genesis block, Block 0; and if you don’t, then everything you generate from Block 1 onward will be different than Bitcoin.