Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: chaosagent on March 14, 2014, 04:25:19 AM



Title: Help with creating android wallets for altcoins
Post by: chaosagent on March 14, 2014, 04:25:19 AM
Sooo... This appears in MainNetParams.java:

Code:
    private static Block createGenesis(NetworkParameters n) {
        Block genesisBlock = new Block(n);
        Transaction t = new Transaction(n);
        try {
            // A script containing the difficulty bits and the following message:
            //
            //   "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
            byte[] bytes = Hex.decode
                    ("04b217bb4e022309");
            t.addInput(new TransactionInput(n, t, bytes));
            ByteArrayOutputStream scriptPubKeyBytes = new ByteArrayOutputStream();
            Script.writeBytes(scriptPubKeyBytes, Hex.decode
                    ("41044870341873accab7600d65e204bb4ae47c43d20c562ebfbf70cbcb188da98dec8b5ccf0526c8e4d954c6b47b898cc30adf1ff77c2e518ddc9785b87ccb90b8cdac"));
            scriptPubKeyBytes.write(ScriptOpCodes.OP_CHECKSIG);
            t.addOutput(new TransactionOutput(n, t, Utils.toNanoCoins(50, 0), scriptPubKeyBytes.toByteArray()));
        } catch (Exception e) {
            // Cannot happen.
            throw new RuntimeException(e);
        }
        genesisBlock.addTransaction(t);
        return genesisBlock;
    }

There are two hex-encoded values here, 41044870341873accab7600d65e204bb4ae47c43d20c562ebfbf70cbcb188da98dec8b5ccf0526c 8e4d954c6b47b898cc30adf1ff77c2e518ddc9785b87ccb90b8cdac, and 04b217bb4e022309.
The first one returns the pszTimestamp when decoded, and the second one returns a set of numbers.

So my question is:
How do I generate these Hex-values? (They are in non-standard format BTW)

Also, is it OK to just replace it with a string?


Title: Re: Help with creating android wallets for altcoins
Post by: sidhujag on March 27, 2014, 06:53:46 AM
its the whole block in bytes.. you need to do a hex dump of the first block in your qt wallet and copy it.. I know your probably cloning bitcoinj to work on your clone coin wallet?