0

I just have a few questions to help better my understanding of the coinbase transaction.

Example:

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

From what I know currently, the format of the coinbase transaction typically looks something like this when decoded:

TX Version:         01000000
# of Inputs:        01
Previous TX Hash:   0000000000000000000000000000000000000000000000000000000000000000
Previous Index:     FFFFFFFF
Input Script Len:   4D
Input Script:       04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73
Input Sequence:     FFFFFFFF
# of Outputs:       01
Output Value (Sat): 00F2052A01000000
Output Script Len:  43
Output Script:      4104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC
Lock Time:          00000000

My first question:

What exactly is the "Previous Index" and why is the value of it FFFFFFFF and not 00000000? Since the previous transaction doesn't exist, shouldn't it be 0 just like the previous hash?

Second question:

From my understanding, the input script contains arbitrary data chosen by the miner when constructing the coinbase transaction and can typically be decoded into ASCII.

For example, this example input script (genesis block) decodes into ASCII as:

ÿÿEThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks

Is this correct? And is this also used when the nonce overflows as an 'extraNonce'?

Third question:

What is the input sequence? Why is it always 0xFFFFFFFF when the locktime is 0x00000000?

Final question (I promise):

What data is stored in the output script, and how can it be broken down to be decoded?

Thank you!

1 Answer 1

0

What exactly is the "Previous Index" and why is the value of it FFFFFFFF and not 00000000? Since the previous transaction doesn't exist, shouldn't it be 0 just like the previous hash?

Coinbase transactions must have index FFFFFFFF, which is -1.

From my understanding, the input script contains arbitrary data chosen by the miner when constructing the coinbase transaction and can typically be decoded into ASCII.

For example, this example input script (genesis block) decodes into ASCII as:

ÿÿEThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks

Is this correct? And is this also used when the nonce overflows as an 'extraNonce'?

Yes, it is exactly ÿÿEThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks. Any part of coinbase can be used as the extranonce.

What is the input sequence? Why is it always 0xFFFFFFFF when the locktime is 0x00000000?

See this for details

What data is stored in the output script, and how can it be broken down to be decoded?

It is a pay-to-pubkey output.

41 Push 65 bytes

04678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5F Satoshi's public key

AC OP_CHECKSIG

2
  • Thanks! Maybe this deserves a different question, but it appears that newer block coinbase transactions have their version as "02000000" indicating version 2. From what I read here this was implemented in BIP34. However instead of the Version+NumberOfInputs+PreviousTXHash There appear to be extra fields. This block for example, Has the version first, and then 3 bytes of something I cannot identify. Do you know what these are? Sep 3, 2018 at 19:02
  • 1
    BIP34 added the requirement that the coinbase scriptSig must start with a push of the block height. Sep 4, 2018 at 0:06

Your Answer

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

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