I see that many different altcoins have different lengths for the initial genesis tx. How would I go about finding the length of the initial genesis tx? I saw another answer but I have no need of making it as complicated; I just need the length and nothing else.

For example, Bitcoin's is


However, altcoins have different lengths. Is there an identifier I can use to determine the length of the genesis tx and nothing else?

EDIT: I am making a block explorer so I cannot use a block explorer to help me in getting info.


1 Answer 1


Unfortunately, the genesis block is not indexed in most altcoins (because they forked from bitcoin and kept the same bug), so you can't really get access to it via the RPC methods.

What you could do instead:

  • Use a block explorer that will tell you the size of the transaction. For example, blockchain.info makes this information available (204 bytes).
  • Find the parameters file and put a print the size of the genesis block to stdout.

The second option basically entails putting the following lines at the end of CMainParams() and then compiling.

ssBlock << genesis;
printf("block: %s\n", HexStr(ssBlock.begin(), ssBlock.end()).c_str());
printf("block size: %i\n", (int)::GetSerializeSize(genesis, SER_NETWORK, PROTOCOL_VERSION));
printf("tx size: %i\n", (int)::GetSerializeSize(genesis.vtx[0], SER_NETWORK, PROTOCOL_VERSION));

This will print the raw block data, it's size, and the transaction's size. (Note, this is untested, but something along these lines should work)

NOTE: It's possible, although not the norm, to put multiple transactions in a genesis block. Just check that your assumption is correct.

  • Size would definitely work for this situation. Only problem is that I am trying to make the block explorer for the coin via Abe, so option 1 isn't available to me. Could you explain the second option? I am guessing you mean chainparams.cpp but I have no idea how to print the size of the genesis block. Apr 6, 2015 at 19:09
  • @AnimalTesting, see updated answer.
    – morsecoder
    Apr 6, 2015 at 19:16
  • How would I use the new code? What command do I have to pass into the daemon? Apr 6, 2015 at 19:34
  • It requires actually re-compiling the daemon after you have put the code in place. Then just start the daemon and it will print.
    – morsecoder
    Apr 6, 2015 at 19:35
  • Also, will this say the size of the block or transaction? You said "This will print the raw block data and it's size." But in the first option, you show how to find the size of the transaction. Apr 6, 2015 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.