1

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

0606e0d8bad7053a15e11686fefb667985fec2a2c89567e2c9dae9e862c76628a174eb3a00662c000000000282d55f01ffc6d45f01e8e4d19ec2870102e8f49622fd8bfd3b0bd8b20ab9f7fc8e33c7f327b0a6a6bda95096d4ab2150813401dd34b8939c64a4237cbd8ea2fad8bf87a5febbd144655e9e697fdd187a2be949021100000000000000000000000000000000000000

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

e8f49622fd8bfd3b0bd8b20ab9f7fc8e33c7f327b0a6a6bda95096d4ab2150813401dd34b8939c64a4237cbd8ea2fad8bf87a5febbd144655e9e697fdd187a2be949021100000000000000000000000000000000000000

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

e8f49622fd8bfd3b0bd8b20ab9f7fc8e33c7f327b0a6a6bda95096d4ab2150813401dd34b8939c64a4237cbd8ea2fad8bf87a5febbd144655e9e697fdd187a2be94902

How is this coinbase transaction key generated?

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 May 6 '18 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 May 6 '18 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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