Pages:
Author

Topic: back to creating new alt coin - page 3. (Read 477 times)

jr. member
Activity: 78
Merit: 4
December 28, 2021, 07:41:00 PM
#7
Building genesis in linux right? excuse me for asking maybe stupid things, between language and that I am a bit rusted..
You can either build it in linux or windows. May I assume you're a Windows user? Just install gcc and run gcc genesis.c -o genesis.exe

I might start all over with your tutorial, since i worked on bitcoin 2.1 and now is 22.00
You mean 0.21, right?

Hi black hat!

Hope you dont mind I quote you, could you help me to check whats wrong in my move in the last post?

thanks a lot, and hope doesnt disturbs you

thnx
jr. member
Activity: 78
Merit: 4
December 26, 2021, 10:35:22 PM
#6
First stuck

Hello there!

Well, I just started and im stucked at this point of your tutorial;

Quote
Now we will choose a different signature message in pchMessageStart of chainparams.cpp. This is a very important step, if it is not changed and you connect to a bitcoin node it will consider the bitcoin blockchain as the correct one. Do it like this:
Code:
pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;

Optional, but you can change the address prefix too. (1, 3, bc1)
Link of all prefixes: https://en.bitcoin.it/wiki/List_of_address_prefixes
In the base58Prefixes of chainparams.cpp I will show an example of the "X" prefix:
Code:
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,75);

First part, I have succesfully* done changing the 3 part where the pch message on the chainparams neded:

Code:
		pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;
        nDefaultPort = 17333;
        nPruneAfterHeight = 1000;
        m_assumed_blockchain_size = 40;
        m_assumed_chain_state_size = 2;

Code:
		pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;
        nDefaultPort = 17444;
        nPruneAfterHeight = args.GetBoolArg("-fastprune", false) ? 100 : 1000;
        m_assumed_blockchain_size = 0;
        m_assumed_chain_state_size = 0;

Code:
		pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;
        nDefaultPort = 17444;
        nPruneAfterHeight = args.GetBoolArg("-fastprune", false) ? 100 : 1000;
        m_assumed_blockchain_size = 0;
        m_assumed_chain_state_size = 0;


*It is really fine? as my point of view those 3 parts should have diferent prefixes, or i am wrong?



But, when I want to go to the step:  base58Prefixes

I stuck since I really don´t understand 100% this configuration and what should i do
(for me is important to know for what is this and how should I do fine)

Las time ive done it i followed this from another source:
Quote
Change address prefixes
Finally, let’s dive into the source code. Currently there are 3 standard address types in Bitcoin:
Pay to Pubkey Hash
Mainnet prefix “1”
Testnet/Regtest prefix “m or n”
Pay to Script Hash
Mainnet prefix “3”
Testnet/Regtest prefix “2”
Bech32 (Segwit)
Mainnet prefix “bc1”
Testnet prefix “tb1”
Regtest prefix “bcrt1”
Since these addresses are base58check encoded (except for bech32 which is it’s own custom encoding), we can set any prefix we want by using this helpful table of values found at https://en.bitcoin.it/wiki/List_of_address_prefixes. The source file containing these prefix settings is src/chainparams.cpp:
Code:
// Mainnet: Line 140
// ...
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,5);
base58Prefixes[SECRET_KEY] =     std::vector(1,128);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
bech32_hrp = "bc";
// ...
// Testnet: Line 244
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,196);
base58Prefixes[SECRET_KEY] =     std::vector(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
bech32_hrp = "tb";
// ...
// Regtest: Line 344
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,196);
base58Prefixes[SECRET_KEY] =     std::vector(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
bech32_hrp = "bcrt";
...
We want our p2pkh addresses to start with the letter “K” on mainnet and “k” on testnet and regtest. Then we want p2psh addresses to start with “L” on mainnet and “t” on testnet and regtest. We’ll keep secret keys the same, but we’ll change the bech32 addresses to “lc”, “tl”, and “lcrt” for mainnet, testnet, and regtest respectively. Based on the values in the table linked above, our chainparams.cpp becomes:
Code:
// Mainnet: Line 140
// ...
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,45); // K
base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,48); // L
// ...
bech32_hrp = "lc";
// ...
// Testnet: Line 244
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,107); // k
base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,65);  // t
// ...
bech32_hrp = "tl";
// ...
// Regtest: Line 344
base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,107); // k
base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,65);  // t
// ...
bech32_hrp = "lcrt";
...
jr. member
Activity: 78
Merit: 4
December 26, 2021, 08:05:36 PM
#5
Building genesis in linux right? excuse me for asking maybe stupid things, between language and that I am a bit rusted..
You can either build it in linux or windows. May I assume you're a Windows user? Just install gcc and run gcc genesis.c -o genesis.exe

I might start all over with your tutorial, since i worked on bitcoin 2.1 and now is 22.00
You mean 0.21, right?

I usually use Windows (have windows virtualization for ubuntu) and i have workd even on backtrack distro old days

Yes, well I mean 21.0 after 22.0 update
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 25, 2021, 07:56:09 AM
#4
Building genesis in linux right? excuse me for asking maybe stupid things, between language and that I am a bit rusted..
You can either build it in linux or windows. May I assume you're a Windows user? Just install gcc and run gcc genesis.c -o genesis.exe

I might start all over with your tutorial, since i worked on bitcoin 2.1 and now is 22.00
You mean 0.21, right?
jr. member
Activity: 78
Merit: 4
December 24, 2021, 05:57:06 PM
#3
Alright, so here's what you're going to do. Go on genesisgen on github, download genesis.c and build it. Once you have the executable, run name.exe .

In you should add your public key in uncompressed format. In your message. In the target. Leave it on 486604799 (1d00ffff) which is the lowest you can have with a difficulty of 1.

Once you mine the genesis block, the program will return you the coinbase script, the scriptPubKey, the merkle hash, the byteswapped merkle hash, the unix time, the nonce and finally the genesis block's hash.

1. Change the genesisOutputScript to your scriptPubKey from #L54.
2. Change genesis.hashMerkleRoot to the byteswapped merkle hash in #L114.
3. Change consensus.hashGenesisBlock to your block's hash in #L113.
4. Change the first two values from the CreateGenesisBlock function to the unix time and nonce respectively in #L111.
5. Build Bitcoin Core.

I've made a tutorial here: How to create your own altcoin (v0.20.1). It should be the same for the latest version of Bitcoin Core.

Hi! Thanks for your time in advace

Building genesis in linux right? excuse me for asking maybe stupid things, between language and that I am a bit rusted..

I might start all over with your tutorial, since i worked on bitcoin 2.1 and now is 22.00

Ill keep informed in this post hows going

Thanks again!
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 24, 2021, 02:37:05 PM
#2
Alright, so here's what you're going to do. Go on genesisgen on github, download genesis.c and build it. Once you have the executable, run name.exe .

In you should add your public key in uncompressed format. In your message. In the target. Leave it on 486604799 (1d00ffff) which is the lowest you can have with a difficulty of 1.

Once you mine the genesis block, the program will return you the coinbase script, the scriptPubKey, the merkle hash, the byteswapped merkle hash, the unix time, the nonce and finally the genesis block's hash.

1. Change the genesisOutputScript to your scriptPubKey from #L54.
2. Change genesis.hashMerkleRoot to the byteswapped merkle hash in #L114.
3. Change consensus.hashGenesisBlock to your block's hash in #L113.
4. Change the first two values from the CreateGenesisBlock function to the unix time and nonce respectively in #L111.
5. Build Bitcoin Core.

I've made a tutorial here: How to create your own altcoin (v0.20.1). It should be the same for the latest version of Bitcoin Core.
jr. member
Activity: 78
Merit: 4
December 24, 2021, 01:53:57 PM
#1
Hello there, I am back to the forum and I would like to achieve creating a coin, maybe based on bitcoin (now ver 22.0) or any other plataform

In the past I tried to make it based on 21.0 and stucked on the creation of the genesis block
(some of the posts where I asked help)
https://bitcointalk.org/index.php?topic=5319944.20
https://bitcointalksearch.org/topic/m.56435394

anyways this are not important

Anyone could help me to achieve creating a coin by myself? Or does anywhere were i can found a updated tutorial for it?
(I used linux to reach genesis block)

Thanks a lot, have a nice day!
Pages:
Jump to: