• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Guide to forking Dash up to the genesis block?

Status
Not open for further replies.

Koromoto

Member
Hey guys, I'd like to fork Dash to play with tokens in my continuous research about solving world commerce and instant payment so any pointers on how to do that would be highly appreciated.

I'll also create a very specific wallet with vanity numbers and instant exchange between X-DASH and fiat so links and refs are also highly welcome.

Thanks.
 
Expanding a bit more, the whole idea is to have a master coin (store of value) with 100 tokens (country fiats), a wallet with two main accounts as savings (private) and cash (vanity) where transfers from personal accounts occur instantly (internal exchange) and transfers from wallets (world payment) also occur instantly.

So if you have 1000 X-DASH in your savings they fluctuate according to demand and supply, usually up as it is deflationary and fixed in supply. Then if you want to pay for a Starbucks coffee you use your cash account and your wallet does an internal sell order at market price (X-DASH exchange) from X-DASH to US-DASH sending the money to the public cash account of Starbucks at 1-800-STARBUCKS. Starbucks at the same time moves all incoming US-DASH to X-DASH (internal exchange) so the buy/sell equilibrium is satisfied and the 1% spread goes to the Masternodes, cheaper than VISA or MasterCard.

There will be no mining, only ten masternodes that will work as sharders/replicators of the master blockchain (1GB in size for one billion active accounts), while child blockchains will be consolidated and archived keeping only the latest balances, archived transactions will be available for child blockchain explorers.

That's my dream and I'd like to test with DASH as it is the only crypto that has all I need to get started.
 
I don't fully understand your idea, but that's fine ;) You could try out the new "devnets" feature that was just recently merged into our develop branch. The PR and description can be found here: https://github.com/dashpay/dash/pull/1791.
More documentation and examples will probably follow, but you can already start trying things out. Just checkout the develop branch and give it a try.
 
I don't fully understand your idea, but that's fine ;) You could try out the new "devnets" feature that was just recently merged into our develop branch. The PR and description can be found here: https://github.com/dashpay/dash/pull/1791.
More documentation and examples will probably follow, but you can already start trying things out. Just checkout the develop branch and give it a try.

Is it possible to merge two devnet blockchains?
 
Last edited:
I'm also learning coursera's Cryptocurrency Technologies course and started to use Dash as more advance technology(compare to bitcoin).

You need to change the PORT and change the genesis block which you can use lhartikk/GenesisH0 from github (couldn't put the full link because of spam protection)

After that you'll hit other problems which I haven't manage to solve ;)

But devnets looks interesting. I'll definitely try it out
 
It would be nice to have a guide to forking Dash. There are others doing it but they aren't sharing their knowledge. Fine I suppose. But then trying to look at source code of Dash forks or attempted Dash forks with a new genesis block brings us back to the same problem: what else?

What I would like to do is really understand Dash. To do that I'd like to dig around in its guts and make some gradual changes and test them out. One first one was to change the Proof of Work, and see what happens, which might lead to experiments in block timing and what happens with DGW. But then, how to make DGW active from genesis. It would be nice to have DH wallets from the start and maybe even BIP34 with the block height in the coinbase. It's hard even with simpler coins to get this working. It's almost impossible unless you can ask actual coin developers who have made this work, and understandably their time is in short supply.

So far I think you can use nasa8x's genesis tool, or GenesisH0 for an X11 genesis block, but how to make BIP34 type genesis blocks, I don't know, or what the ramifications of that would be. If BIP34 was active from the beginning presumably there would be no invalid-cb-height errors in the debug log.

So it looks like with changing the Proof of Work to understand that a bit more, retargeting, timeframes and so on, a few hacks are needed to genesis block creators. It's definitely easier than the old way going back to 2013 where most guides have a simple hack to force genesis block creation with the mining code then making the asserts fail for the merkle root and genesis hash, then look in the debug log for it, then put it in and remove the hack to keep creating a genesis block.

So the code and especially nasa8x's node genesis block creator looks a little easier to work with, at least for me anyway, but GenesisH0 looks good too, if you're a Python wizard. We definitely need a neat new C++ genesis block creation tool to make it a lot faster than JS or Python.

That aside, assuming we are keeping Dash prefixes, change the ports for P2P and RPC, then try to recompile and see if it sorta checks out. Then of course miner code needs to be hacked to make a "new" PoW check out, say for example removing a few hashing algorithms for X11 or making it 3x keccak or something of that nature. Just something interesting to play with, and hack on the miner code in Dash.

So aside from genesis block, port numbers, optionally changing address prefixes, what to do with block times and when to readjust difficulty, what that means with DGW, and trying to integrate BIP34 if you want from the beginning, looking at whether you want the same coin supply and halving intervals, there's actually quite a bit of work to do forking DASH, especially if you aren't yet understanding Masternodes, confirmation times, whether it's reasonably easy and what the ramifications of changing confirmations would be (15 for MNs?) and rewards for MNs, plus what stake they have to have, and so on, it's harder than just cloning and adjusting a few bits and pieces from Bitcoin or Litecoin.

DASH is a much more interesting coin to clone though in my view. Harder but more rewarding in the end, and you might get the benefit of understanding a lot more about DASH and how it really works and perhaps contribute to the DASH project in future.

The developer guide is much better than others I've seen, but still it's inadequate for those new to coin/cryptocurrency development. It assumes too much, and there's no Mastering DASH or Programming DASH books out there to help along the way.
 
All the forks seem to be from older repositories and it would be nice to just fork the latest that works.

Having said that, there's a basic guide if you search for Flowercoin. Also search for paper29 and The method of design of an own cryptocurrency based on the dash project if you're having trouble finding paper29.pdf which describes the basic rebranding from DASH to Flowercoin if you really want a new DASH for some reason. Looks adequate though for trying out a new Dash and trying to understand its innards a bit more. A bit of a jump start to more interesting changes to understand it. If you can manage all the Masternode things, what on earth sporks are and exactly how privatesend and instant sending works and so on.
 
Hi, did you manage to find a guide to the dash fork? I am facing the same problem and if you can share information with me I would be very grateful.
 
Hello
I'm found the Raptoreum
Them use this code to Debug and get genesis block hash
/Raptor3um/raptoreum/blob/master/src/chainparams.cpp
Code:
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
    const char* pszTimestamp = "The Times 22/Jan/2018 Raptoreum is name of the game for new generation of firms";
    const CScript genesisOutputScript = CScript() << ParseHex("040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9") << OP_CHECKSIG;
    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
Is it true?
Code:
static void FindMainNetGenesisBlock(uint32_t nTime, uint32_t nBits, const char* network)
{

    CBlock block = CreateGenesisBlock(nTime, 0, nBits, 4, 5000 * COIN);

    arith_uint256 bnTarget;
    bnTarget.SetCompact(block.nBits);

    for (uint32_t nNonce = 0; nNonce < UINT32_MAX; nNonce++) {
        block.nNonce = nNonce;

        uint256 hash = block.GetPOWHash();
        if (nNonce % 48 == 0) {
            printf("\nrnonce=%d, pow is %s\n", nNonce, hash.GetHex().c_str());
        }
        if (UintToArith256(hash) <= bnTarget) {
            printf("\n%s net\n", network);
            printf("\ngenesis is %s\n", block.ToString().c_str());
            printf("\npow is %s\n", hash.GetHex().c_str());
            printf("\ngenesisNonce is %d\n", nNonce);
            std::cout << "Genesis Merkle " << block.hashMerkleRoot.GetHex() << std::endl;
            return;
        }

    }

    // This is very unlikely to happen as we start the devnet with a very low difficulty. In many cases even the first
    // iteration of the above loop will give a result already
    error("%sNetGenesisBlock: could not find %s genesis block",network, network);
    assert(false);
}

Code:
 
github
Raptor3um/raptoreum/commit/11c6fe93bed1bbb2e7372f550c94da3c8f42c183

They can change time to get genesis block
 

Attachments

  • Screenshot 2022-01-16 at 23-17-44 Commits · Raptor3um raptoreum.png
    Screenshot 2022-01-16 at 23-17-44 Commits · Raptor3um raptoreum.png
    30.8 KB · Views: 257
  • Screenshot 2022-01-16 at 23-22-08 Commits · Raptor3um raptoreum.png
    Screenshot 2022-01-16 at 23-22-08 Commits · Raptor3um raptoreum.png
    44 KB · Views: 253
Status
Not open for further replies.
Back
Top