Bitcoin Fork

This document is only a draft.

Bitcoin software allows a participating community to control the economic life of its participants through the power of issuing currency and credit. Read mutual banking or visit a real world community such as fair coop.

"Anyway, you can have a full time job, or a social and family life, and maintain a released altcoin – but probably not both, unless you’re one of those people who regards sleep as a wholly inadequate time-wasting substitute for caffeine."

dillingers.com - how to make an altcoin.

This page was based on above how to, with references to other pages found while researching.



Get the source

If bitcoin is already installed on system sources are already available on the system. If is not installed via pkgmk or prt-get is a opportunity to see if the code build and behaves as expected;

$ prt-get depinst bitcoin
$ mkdir bitcoin && cd bitcoin
$ cp /usr/ports/ports/bitcoin/Pkgfile .
$ pkgmk -do
$ tar xf bitcoin-0.18.0.tar.gz
$ cd bitcoin-0.18.0
$ git init .
$ git add .
$ git commit -m "initial 0.18.0"
$ git checkout -b fork

For now this temporary repository will be used, later upstream repository can be cloned and the commit of 0.18.0 checked out to create a branch from it and paste the new code over. This will allow to easily follow upstream and cherry-pick or merge upstream fix's.


Name

Name the new coin, check existing list of cryptocurrencies to make sure none exist with same name. In this example will be used Liber from latin means freedom.

$ grep -rl bitcoin --exclude-dir=.git/ | xargs sed -i 's/bitcoin/liber/g'
$ grep -rl Bitcoin --exclude-dir=.git/ | xargs sed -i 's/Bitcoin/Liber/g'
$ grep -rl BITCOIN --exclude-dir=.git/ | xargs sed -i 's/BITCOIN/LIBER/g'
$ grep -rl BTC --exclude-dir=.git/ | xargs sed -i 's/BTC/LBRC/g'
$ grep -rl btc --exclude-dir=.git/ | xargs sed -i 's/btc/lbrc/g'
$ grep -rl Btc --exclude-dir=.git/ | xargs sed -i 's/Btc/Lbrc/g'

Rename files;

$ find . -exec rename bitcoin libre {} ";"

Correct misspelling

$ sed -i 's/bitcon/liber/' src/qt/locale/libre_da.ts
$ sed -i 's/Bitconi/liber/' src/qt/locale/libre_et.ts

Fix copyright;

$ grep opyright -rl --exclude-dir=.git/ | xargs sed -i '/opyright/ s/Liber/Bitcoin/g'

Fix previous releases;

$ sed -i 's/liber/bitcoin/g' doc/release-notes/*
$ sed -i 's/Liber/Bitcoin/g' doc/release-notes/*

See modified files and commit;

$ git status
$ git add .
$ git commit -m "Bitcoin renamed to Liber"

Network

Change network ports so both clients don't collide.


Genesis

Check 181981.20 (source) for more information about genesis generator, other version was provided by hushan.

Genesis generator

To compile genesis_generator.c;

$ gcc genesis_generator.c -o genesis_generator -lcrypto

Genesisgen

Download genesisgen extract and run make;

$ wget https://wiki.leetio.dev/uploads/Main/genesisgen.tar.gz
$ tar xf genesisgen.tar.gz
$ cd genesisgen-master
$ make

GenesisH0

GenesisH0