1

so i just learnt how to created a raw coinbase transaction, and i need to confirm if the format is correct, can you guys help me with this?

: this is just an example it doesnt exists in the blockchain network

im using BIP34 transaction format and my wallet address is

address: 1Htcz9y5sVuztuwTnfpWR4dhqirhLMcK7r

this is the raw transaction format:

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e03fc7903036370756d696e657203000000000100f90295000000001976a914b9454405a39efcb023127cd6daacf9c133b84df388ac00000000

extract format:

01000000 .............................. Version
01 .................................... Number of inputs
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ...  Previous outpoint TXID
| ffffffff ............................ Previous outpoint index
|
| 0e .................................. Bytes in coinbase
| |
| | 03 ................................ Bytes in height
| | | fc7903 .......................... Height: 227836
| |
| | 036370756d696e657203 .............. Arbitrary data
| 00000000 ............................ Sequence

01 .................................... Output count
| 00f9029500000000 .................... Satoshis (25 BTC)
| 1976a914b9454405a39efcb023127cd6
| daacf9c133b84df388ac ................ P2PKH script
| 00000000 ............................ Locktime

Did i get all that right?

1 Answer 1

1

I'd recommend you use bitcoin-cli to check if the transaction you made is both syntactically and semantically correct. You can do so by running bitcoin-cli decoderawtransaction:

bitcoin-cli decoderawtransaction 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e03fc7903036370756d696e657203000000000100f90295000000001976a914b9454405a39efcb023127cd6daacf9c133b84df388ac00000000

That returns:

{
  "txid": "58857ef49cdfe7dc036bb0eb2463464aed859aae4abee915808ee51357e15abe",
  "hash": "58857ef49cdfe7dc036bb0eb2463464aed859aae4abee915808ee51357e15abe",
  "version": 1,
  "size": 99,
  "vsize": 99,
  "weight": 396,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "03fc7903036370756d696e657203",
      "sequence": 0
    }
  ],
  "vout": [
    {
      "value": 25.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 b9454405a39efcb023127cd6daacf9c133b84df3 OP_EQUALVERIFY OP_CHECKSIG",
        "desc": "addr(mxQaHD44gXMFg2R5WEntEyr2hiTQFvZkwi)#80h6hw5r",
        "hex": "76a914b9454405a39efcb023127cd6daacf9c133b84df388ac",
        "address": "mxQaHD44gXMFg2R5WEntEyr2hiTQFvZkwi",
        "type": "pubkeyhash"
      }
    }
  ]
}

The fact that the command doesn't fail already tells you that the transaction is syntactically correct. With respect to semantics, it looks to me that it achieves exactly what you were going after.

1

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.