Below is a blocktemplate_blob obtained from calling the getblocktemplate RPC, with reserve size 17.


I'm trying to figure out how coinbase transactions are serialized. Based on CNS003 and CNS004, after stripping the block header, transaction version (0x02), unlock time (0x82d55f), num inputs (0x01), transaction type (0xff), block height (0xc6d45f), num outputs (0x01), reward (0xe8e4d19ec28701), and output type (0x02), we are left with


which I believe consists of the output public key, extra size, and the extra. Removing the extra size and extra leaves us with


How is this coinbase transaction key generated?

1 Answer 1


Why would you remove extra ? It's in there. See cn_deserialize.cpp, to which you can give the hex dump of that tx:

cn_deserialize --input aaaaaaaaaaaaaaaaaaaa

This will show you the tx key.

  • I removed extra to show the portion of the blocktemplate_blob that I wasn't understanding. I'm just lost on the process of generating the last hexstring. Which parameters are used to calculate it?
    – nnsun
    Commented May 6, 2018 at 19:49
  • Extra is typically composed of a set of chunks. The tx pubkey is a 32 byte chunk. The list of known chunk types and their contents is in tx_extra.h.
    – user36303
    Commented May 6, 2018 at 22:14

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.