Customised Bitcoin core

  1. Generate the private key and public key using a script, you must have openssl installed. The script is shown below. To run it, enter the following in command line: ./script <filename>
    After that, there are two files generated: <filename>_private.pem and <filename>_public.pem
FILE_NAME=$1PRIVATE_KEY=${FILE_NAME}_private.pemPUBLIC_KEY=${FILE_NAME}_public.pemBITCOIN_PRIVATE_KEY=bitcoin_${FILE_NAME}_private.keyBITCOIN_PUBLIC_KEY=bitcoin_${FILE_NAME}_public.keyecho “Generating private key”
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY
echo “Generating public key”
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY
echo “Generating BitCoin private key”
openssl ec -in $PRIVATE_KEY -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > $BITCOIN_PRIVATE_KEY
echo “Generating BitCoin public key”
openssl ec -in $PRIVATE_KEY -pubout -outform DER|tail -c 65|xxd -p -c 65 > $BITCOIN_PUBLIC_KEY
echo “Files created!”
assert(consensus.hashGenesisBlock == uint256S("00000000395a494f09a2e15dc8c32e0ea69aa60dde5b5a3aafc77cf059063f72"));assert(genesis.hashMerkleRoot == uint256S("e9d3d787cec0e87057ebe72e4c91e1c25fc75f71d45d19eef07dd52bb15af594"));
const char* pszTimestamp = "The Indian News 09/June/2018 Mumbai Car Free Day";const CScript genesisOutputScript = CScript() << ParseHex("048c87388e0bf2c831d21a57c872975d3fe46a644f69dd10d9f2ab407a06c3f88901b65b12b1ee007b045d6a65dfca7e36b9dd7a3f7310a7f79575cdf772028458") << OP_CHECKSIG;
consensus.nMinimumChainWork = uint256S("0000000000000000000000000000000000000000000000000000000100010001");
static const CAmount MAX_MONEY = 21000000 * COIN;
static const int COINBASE_MATURITY = 100;
vSeeds.emplace_back
set checkpointData = { };
pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,<new_value>);
./minerd --user <username> --pass <password> --url http://127.0.0.1:<port_number>/ --threads 4 --coinbase-addr XQg3PmNxX9oEbxsymqtQHir6dkPpVPTJ6P --coinbase-sig "my test coins" -a sha256d -D
first node:
src/bitcoind -debug=rpc -dns=0 -dnsseed=0 -datadir=../datadir_0/ -connect=0 -maxtipage=432000000 -daemon
second node:
src/bitcoind -debug=rpc -addnode=127.0.0.1:<first_instance_port_number> -dns=0 -dnsseed=0 -datadir=../datadir_1/ -daemon
docker run -it -p <outer_port>:<inner_port> <username>/bitcoin:custom
static const unsigned int MAX_BLOCK_WEIGHT = 8000000
consensus.nPowTargetSpacing = 1 * 60;

--

--

--

Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why Is There a Global Crypto Crackdown?

LUNALAND: A DIGITAL CURRENCY DEVELOPED TO BATTLE INFLATION IN THE CRYPTO INDUSTRY.

How to trade crypto, and never lose money on a trade

Life of a Student in London, trying to make money.

为什么Defi需要利率掉期?

Bytom Weekly News (February 1st week)

Quantifying cryptocurrency market volatility in the last 3 days

Olympus Finance (OHM)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Victor Yeo

Victor Yeo

Engineer

More from Medium

Ethereum Devs Launches “Shadow Fork” Ahead Of Merge

🔭 The Ethereum Scaling Roadmap

Sliding Window Challenge Process for Congestion Detection

What exactly are DAOs, and How Do They Work?