Bitcoin Forum
May 25, 2024, 09:42:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help with creating android wallets for altcoins  (Read 561 times)
chaosagent (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250



View Profile
March 14, 2014, 04:25:19 AM
 #1

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?






.......Web...............Bounty..............Twitter.................Telegram.......
Blockchain Pensions Infrastructure



sidhujag
Legendary
*
Offline Offline

Activity: 2044
Merit: 1005


View Profile
March 27, 2014, 06:53:46 AM
 #2

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?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!