Skip to main content

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what iI know and the doubts are marked by a ?:

[PARAMETER]                  [SIZE]   [ENDIANNESS] [ALLOWED VALUES]

 - version                      - 4 Bytes   - LE  - 01000000 
 - input count                  - 1 Bytes   - xx  - 01 
 - prev tx                      - 32 Bytes  - xx  - 0000000000...0000
 - prev out n                   - 4 Bytes   - xx  - ffffffff (outpoint index or fake index)
 - coinbase script length (LCS)  - <?> Bytes - <?> - <what is value range of LCS i.e. min and max Bytes?>
   length (LCS)
 - coinbase script              - LCS Bytes : 
                                                1 Bytes       - xx - 03 (Size of Block Height in next 3 Bytes)
                                                3 Bytes       - LE - __ (Valid Block Height in LE for Block being mined)
                                                [LCS-4 Bytes] - xx - xx (ANY binary string is Valid. ANY STRING!!!!)

 - sequence                     - 4 Bytes   - xx  - ffffffff
 - output count                 - 1 Bytes   - xx  - 01
 - value                        - <?> Bytes - LE  - __ (mining reward + transaction fee of all other included transactions in Satoshi)

 - script length (SL)           - 1 Bytes   - xx  - (what is value range of SL i.e. min and max bytes, or is it fixed size?)
 - pubkey script                - SL Bytes  - <?> - __ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)
 - locktime                     - 4 Bytes   - xx  - 00000000


Notation:

LE    - Little Endian.
BE    - Big Endian.
xx    - Endianness doesn't matter.
__    - User input.
<..?> - Unclear.'''

Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what i know and the doubts are marked by a ?:

[PARAMETER]                  [SIZE]   [ENDIANNESS] [ALLOWED VALUES]

 - version                      - 4 Bytes   - LE  - 01000000 
 - input count                  - 1 Bytes   - xx  - 01 
 - prev tx                      - 32 Bytes  - xx  - 0000000000...0000
 - prev out n                   - 4 Bytes   - xx  - ffffffff (outpoint index or fake index)
 - coinbase script length (LCS) - <?> Bytes - <?> - <what is value range of LCS i.e. min and max Bytes?>
 - coinbase script              - LCS Bytes : 
                                                1 Bytes       - xx - 03 (Size of Block Height in next 3 Bytes)
                                                3 Bytes       - LE - __ (Valid Block Height in LE for Block being mined)
                                                [LCS-4 Bytes] - xx - xx (ANY binary string is Valid. ANY STRING!!!!)

 - sequence                     - 4 Bytes   - xx  - ffffffff
 - output count                 - 1 Bytes   - xx  - 01
 - value                        - <?> Bytes - LE  - __ (mining reward + transaction fee of all other included transactions in Satoshi)

 - script length (SL)           - 1 Bytes   - xx  - (what is value range of SL i.e. min and max bytes, or is it fixed size?)
 - pubkey script                - SL Bytes  - <?> - __ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)
 - locktime                     - 4 Bytes   - xx  - 00000000


Notation:

LE    - Little Endian.
BE    - Big Endian.
xx    - Endianness doesn't matter.
__    - User input.
<..?> - Unclear.'''

Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what I know and the doubts are marked by a ?:

[PARAMETER]           [SIZE]   [ENDIANNESS] [ALLOWED VALUES]

 - version            - 4 Bytes   - LE  - 01000000 
 - input count        - 1 Bytes   - xx  - 01 
 - prev tx            - 32 Bytes  - xx  - 0000000000...0000
 - prev out n         - 4 Bytes   - xx  - ffffffff (outpoint index or fake index)
 - coinbase script    - <?> Bytes - <?> - <what is value range of LCS i.e. min and max Bytes?>
   length (LCS)
 - coinbase script              - LCS Bytes : 
                                                1 Bytes       - xx - 03 (Size of Block Height in next 3 Bytes)
                                                3 Bytes       - LE - __ (Valid Block Height in LE for Block being mined)
                                                [LCS-4 Bytes] - xx - xx (ANY binary string is Valid. ANY STRING!!!!)

 - sequence           - 4 Bytes   - xx  - ffffffff
 - output count       - 1 Bytes   - xx  - 01
 - value              - <?> Bytes - LE  - __ (mining reward + transaction fee of all other included transactions in Satoshi)

 - script length (SL) - 1 Bytes   - xx  - (what is value range of SL i.e. min and max bytes, or is it fixed size?)
 - pubkey script      - SL Bytes  - <?> - __ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)
 - locktime           - 4 Bytes   - xx  - 00000000


Notation:

LE    - Little Endian.
BE    - Big Endian.
xx    - Endianness doesn't matter.
__    - User input.
<..?> - Unclear.

Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

Became Hot Network Question
Rollback to Revision 1
Source Link
RedGrittyBrick
  • 28.5k
  • 3
  • 25
  • 53

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what i know and the doubts are marked by a ?:

|PARAMETER[PARAMETER]      |SIZE     |ENDIANNESS|ALLOWED VALUES|      [SIZE]   [ENDIANNESS] [ALLOWED VALUES]
|---------------|---------|----------|----------
 - version                      - 4 Bytes   - LE  -| 01000000 
|version - input count     |  4 Bytes|LE|01000000|
|input count    |     - 1 Bytes|xx|01|Bytes   - xx  - 01 
|prev - prev tx        |              - 32 Bytes|xx|0000000000Bytes  - xx  - 0000000000...0000|0000
|prev - prev out n     |              - 4 Bytes|xx|ffffffffBytes   - xx  - ffffffff (outpoint index or fake index)|
|coinbase - coinbase script length (LCS)|< - <?> Bytes|<Bytes - <?> - <what is value range of LCS i.e. min and max Bytes?>|>
|coinbase script|LCS- Bytes|coinbase script  |            - |LCS Bytes : 
|               |                                 1 Bytes|xx|03Bytes       - xx - 03 (Size of Block Height in next 3 Bytes)|
|               |                                 3 Bytes|LE|Bytes       - LE - __ (Valid Block Height in LE for Block being mined)|
|           |[LCS                                     [LCS-4 Bytes]|xx|Bytes] - xx - xx (ANY binary string is Valid. ANY STRING!!!!)|
|sequence 
 - sequence     |                - 4 Bytes|xx|ffffffff|Bytes   - xx  - ffffffff
|output - output count   |              - 1 Bytes|xx|01|Bytes   - xx  - 01
|value - value     |<                   - <?> Bytes|LE|__Bytes - LE  - __ (mining reward + transaction fee of all other included transactions in Satoshi)|
|script 
 - script length (SL)|1 Bytes|xx|          - 1 Bytes   - xx  - (what is value range of SL i.e. min and max bytes, or is it fixed size?)|
|pubkey - pubkey script  |              - SL Bytes|<Bytes  - <?>|__> - __ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)|
|locktime  - locktime    |  4 Bytes|xx|00000000|


Notation:

|     |         - 4 Bytes   |
|-----|------------- xx  -| 00000000
|LE

Notation:

LE   |Little - Little Endian.|
|BEBE   |Big - Big Endian.|
|xxxx   |Endianness - Endianness doesn't matter.|
|____   |User - User input.|
|<<..?>|Unclear> - Unclear.'''|
'''

1.Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

2.Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what i know and the doubts are marked by a ?:

|PARAMETER      |SIZE     |ENDIANNESS|ALLOWED VALUES|
|---------------|---------|----------|--------------|
|version        |  4 Bytes|LE|01000000|
|input count    |  1 Bytes|xx|01| 
|prev tx        | 32 Bytes|xx|0000000000...0000|
|prev out n     |  4 Bytes|xx|ffffffff (outpoint index or fake index)|
|coinbase script length (LCS)|<?> Bytes|<?> - <what is value range of LCS i.e. min and max Bytes?>|
|coinbase script|LCS Bytes|   |             |
|               |  1 Bytes|xx|03 (Size of Block Height in next 3 Bytes)|
|               |  3 Bytes|LE|(Valid Block Height in LE for Block being mined)|
|           |[LCS-4 Bytes]|xx|(ANY binary string is Valid. ANY STRING!!!!)|
|sequence       |  4 Bytes|xx|ffffffff|
|output count   |  1 Bytes|xx|01|
|value      |<?> Bytes|LE|__ (mining reward + transaction fee of all other included transactions in Satoshi)|
|script length (SL)|1 Bytes|xx|(what is value range of SL i.e. min and max bytes, or is it fixed size?)|
|pubkey script  | SL Bytes|<?>|__ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)|
|locktime       |  4 Bytes|xx|00000000|


Notation:

|     |              |
|-----|--------------|
|LE   |Little Endian.|
|BE   |Big Endian.|
|xx   |Endianness doesn't matter.|
|__   |User input.|
|<..?>|Unclear.'''|


1. Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

2. Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

[PARAMETER]                  [SIZE]   [ENDIANNESS] [ALLOWED VALUES]

 - version                      - 4 Bytes   - LE  - 01000000 
 - input count                  - 1 Bytes   - xx  - 01 
 - prev tx                      - 32 Bytes  - xx  - 0000000000...0000
 - prev out n                   - 4 Bytes   - xx  - ffffffff (outpoint index or fake index)
 - coinbase script length (LCS) - <?> Bytes - <?> - <what is value range of LCS i.e. min and max Bytes?>
 - coinbase script              - LCS Bytes : 
                                                1 Bytes       - xx - 03 (Size of Block Height in next 3 Bytes)
                                                3 Bytes       - LE - __ (Valid Block Height in LE for Block being mined)
                                                [LCS-4 Bytes] - xx - xx (ANY binary string is Valid. ANY STRING!!!!)
 
 - sequence                     - 4 Bytes   - xx  - ffffffff
 - output count                 - 1 Bytes   - xx  - 01
 - value                        - <?> Bytes - LE  - __ (mining reward + transaction fee of all other included transactions in Satoshi)
 
 - script length (SL)           - 1 Bytes   - xx  - (what is value range of SL i.e. min and max bytes, or is it fixed size?)
 - pubkey script                - SL Bytes  - <?> - __ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)
 - locktime                     - 4 Bytes   - xx  - 00000000


Notation:

LE    - Little Endian.
BE    - Big Endian.
xx    - Endianness doesn't matter.
__    - User input.
<..?> - Unclear.'''

Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

added 191 characters in body
Source Link
RedGrittyBrick
  • 28.5k
  • 3
  • 25
  • 53

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what i know and the doubts are marked by a ?:

[PARAMETER]           |PARAMETER      |SIZE [SIZE]   [ENDIANNESS] [ALLOWED|ENDIANNESS|ALLOWED VALUES]
VALUES|
 |- version                      - 4 Bytes   - LE  - 01000000 
 - input count                  - 1 Bytes   - xx  - 01 
 - prev------|---------|----------|--------------|
|version tx       |  4 Bytes|LE|01000000|
|input count    |  1 Bytes|xx|01| 
|prev tx  - 32 Bytes  - xx | -32 0000000000Bytes|xx|0000000000...00000000|
 - prev|prev out n                  | - 4 Bytes   - xx  - ffffffffBytes|xx|ffffffff (outpoint index or fake index)|
 - coinbase|coinbase script length (LCS) - <|<?> Bytes - <Bytes|<?> - <what is value range of LCS i.e. min and max Bytes?>>|
 - coinbase script|coinbase script|LCS Bytes|   |         - LCS Bytes : |
                               |               |  1 Bytes       - xx - 03Bytes|xx|03 (Size of Block Height in next 3 Bytes)|
                               |               |  3 Bytes       - LE - __ Bytes|LE|(Valid Block Height in LE for Block being mined)|
                                     |           [LCS|[LCS-4 Bytes] - xx - xx Bytes]|xx|(ANY binary string is Valid. ANY STRING!!!!)
 |
 - sequence             |sequence       | - 4 Bytes   - xx  - ffffffffBytes|xx|ffffffff|
 - output|output count                | - 1 Bytes   - xx  - 01Bytes|xx|01|
 - value                   |value     - <|<?> Bytes - LE  - __Bytes|LE|__ (mining reward + transaction fee of all other included transactions in Satoshi)
 |
 - script|script length (SL)           - 1 Bytes   - xx  -|1 Bytes|xx|(what is value range of SL i.e. min and max bytes, or is it fixed size?)|
 - pubkey|pubkey script                -| SL Bytes  - <Bytes|<?> - __>|__ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)|
 - locktime |locktime       |  4 Bytes|xx|00000000|


Notation:

|     |     - 4 Bytes   - xx  - 00000000


Notation:|
|-----|--------------|
LE |LE   - Little|Little Endian.|
BE  |BE  - Big|Big Endian.|
xx  |xx  - Endianness|Endianness doesn't matter.|
__  |__  - User|User input.|
<|<..?> - Unclear>|Unclear.''''''|

Q1:
1. Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2:2. Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

[PARAMETER]                  [SIZE]   [ENDIANNESS] [ALLOWED VALUES]

 - version                      - 4 Bytes   - LE  - 01000000 
 - input count                  - 1 Bytes   - xx  - 01 
 - prev tx                      - 32 Bytes  - xx  - 0000000000...0000
 - prev out n                   - 4 Bytes   - xx  - ffffffff (outpoint index or fake index)
 - coinbase script length (LCS) - <?> Bytes - <?> - <what is value range of LCS i.e. min and max Bytes?>
 - coinbase script              - LCS Bytes : 
                                                1 Bytes       - xx - 03 (Size of Block Height in next 3 Bytes)
                                                3 Bytes       - LE - __ (Valid Block Height in LE for Block being mined)
                                                [LCS-4 Bytes] - xx - xx (ANY binary string is Valid. ANY STRING!!!!)
 
 - sequence                     - 4 Bytes   - xx  - ffffffff
 - output count                 - 1 Bytes   - xx  - 01
 - value                        - <?> Bytes - LE  - __ (mining reward + transaction fee of all other included transactions in Satoshi)
 
 - script length (SL)           - 1 Bytes   - xx  - (what is value range of SL i.e. min and max bytes, or is it fixed size?)
 - pubkey script                - SL Bytes  - <?> - __ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)
 - locktime                     - 4 Bytes   - xx  - 00000000


Notation:

LE    - Little Endian.
BE    - Big Endian.
xx    - Endianness doesn't matter.
__    - User input.
<..?> - Unclear.'''

Q1: Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

Q2: Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

I was trying to understand the structure of coinbase transaction. I tried a few sources but I still have a few doubts regarding the structure with exactly 1 output. Here is what i know and the doubts are marked by a ?:

|PARAMETER      |SIZE     |ENDIANNESS|ALLOWED VALUES|
|---------------|---------|----------|--------------|
|version        |  4 Bytes|LE|01000000|
|input count    |  1 Bytes|xx|01| 
|prev tx        | 32 Bytes|xx|0000000000...0000|
|prev out n     |  4 Bytes|xx|ffffffff (outpoint index or fake index)|
|coinbase script length (LCS)|<?> Bytes|<?> - <what is value range of LCS i.e. min and max Bytes?>|
|coinbase script|LCS Bytes|   |             |
|               |  1 Bytes|xx|03 (Size of Block Height in next 3 Bytes)|
|               |  3 Bytes|LE|(Valid Block Height in LE for Block being mined)|
|           |[LCS-4 Bytes]|xx|(ANY binary string is Valid. ANY STRING!!!!)|
|sequence       |  4 Bytes|xx|ffffffff|
|output count   |  1 Bytes|xx|01|
|value      |<?> Bytes|LE|__ (mining reward + transaction fee of all other included transactions in Satoshi)|
|script length (SL)|1 Bytes|xx|(what is value range of SL i.e. min and max bytes, or is it fixed size?)|
|pubkey script  | SL Bytes|<?>|__ (What is this?! Is it the wallet address or the public key or something else - of the person who recieves the funds in 'value'?)|
|locktime       |  4 Bytes|xx|00000000|


Notation:

|     |              |
|-----|--------------|
|LE   |Little Endian.|
|BE   |Big Endian.|
|xx   |Endianness doesn't matter.|
|__   |User input.|
|<..?>|Unclear.'''|


1. Can someone please address the doubts marked by ? and validate if rest of the structure is correct?

2. Does coinbase script have any additional structure, rules or constraints that I missed including here (other than above) that can make the transaction invalid?

Source Link
J.Doe
  • 127
  • 5
Loading