Follow Us

Header Ad

Latest Posts

Categories

blockchain – How to create bitcoin coin , coinbase transaction?

I know about

createrawtransaction '["txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0]' '"39jbHRLG6Z2KgXLHR3BWgbccZde1Moo15k":6.5' 

its give

020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff018036be260000000017a914583daf881525ddfcb891e1ab715a2a790b62f03c8700000000

19:10:24

decoderawtransaction 020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff018036be260000000017a914583daf881525ddfcb891e1ab715a2a790b62f03c8700000000



  "txid": "b95321ea560dbdf48581c0ff451699e4240c86021bd10791585b3bc4078681cf",
  "hash": "b95321ea560dbdf48581c0ff451699e4240c86021bd10791585b3bc4078681cf",
  "version": 2,
  "size": 83,
  "vsize": 83,
  "weight": 332,
  "locktime": 0,
  "vin": [
    
      "txid": "0000000000000000000000000000000000000000000000000000000000000000",
      "vout": 0,
      "scriptSig": 
        "asm": "",
        "hex": ""
      ,
      "sequence": 4294967295
    
  ],
  "vout": [
    
      "value": 6.50000000,
      "n": 0,
      "scriptPubKey": 
        "asm": "OP_HASH160 583daf881525ddfcb891e1ab715a2a790b62f03c OP_EQUAL",
        "hex": "a914583daf881525ddfcb891e1ab715a2a790b62f03c87",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "39jbHRLG6Z2KgXLHR3BWgbccZde1Moo15k"
        ]
      
    
  ]

but if i try decode tx from blockchain
as example tx d56e6eccf09e3b2993326b86d95bf79919ec98ff576c2cc6b550d7fd90187080
from block 00000000000000000005c8f82be414604a30f33fa35028079d0d012079c8f3ea

getrawtransaction d56e6eccf09e3b2993326b86d95bf79919ec98ff576c2cc6b550d7fd90187080




01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5b0300f60941d7e1f2e7560aff41d7e1f2e755ef2a2f45324d2026204254432e544f502ffabe6d6d1c3eb14eb586c97d05cb6333184280d0d86e081a6ccc1cbbc0367888f2368b2b8000000000000000e7000a064122000000000000ffffffff0140be4025000000001976a9140b904a4a8590d0ccff680bb8adc4ae4fe49f890a88ac00000000




decoderawtransaction 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5b0300f60941d7e1f2e7560aff41d7e1f2e755ef2a2f45324d2026204254432e544f502ffabe6d6d1c3eb14eb586c97d05cb6333184280d0d86e081a6ccc1cbbc0367888f2368b2b8000000000000000e7000a064122000000000000ffffffff0140be4025000000001976a9140b904a4a8590d0ccff680bb8adc4ae4fe49f890a88ac00000000





  "txid": "d56e6eccf09e3b2993326b86d95bf79919ec98ff576c2cc6b550d7fd90187080",
  "hash": "d56e6eccf09e3b2993326b86d95bf79919ec98ff576c2cc6b550d7fd90187080",
  "version": 1,
  "size": 176,
  "vsize": 176,
  "weight": 704,
  "locktime": 0,
  "vin": [
    
      "coinbase": "0300f60941d7e1f2e7560aff41d7e1f2e755ef2a2f45324d2026204254432e544f502ffabe6d6d1c3eb14eb586c97d05cb6333184280d0d86e081a6ccc1cbbc0367888f2368b2b8000000000000000e7000a064122000000000000",
      "sequence": 4294967295
    
  ],
  "vout": [
    
      "value": 6.25000000,
      "n": 0,
      "scriptPubKey": 
        "asm": "OP_DUP OP_HASH160 0b904a4a8590d0ccff680bb8adc4ae4fe49f890a OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9140b904a4a8590d0ccff680bb8adc4ae4fe49f890a88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1249HZzzG5YSi8juRXPXYopcCYBx3CQYW7"
        ]
      
    
  ]

i see coinbase value

"coinbase": "0300f60941d7e1f2e7560aff41d7e1f2e755ef2a2f45324d2026204254432e544f502ffabe6d6d1c3eb14eb586c97d05cb6333184280d0d86e081a6ccc1cbbc0367888f2368b2b8000000000000000e7000a064122000000000000",

what is this ? How to create working coinsbase tx what can be puted to block and it will be correct for mining , all what if find there is not incorrect info and link to outdatet wiki.
tx created by any of that solution dont have this field so they are invalid .

Problem is there no info how to add that coinbase to coinbase tx .

maybe some where exist some python script what can do coinbase tx ? For look at logic how it creation that tx.

    Leave Your Comment

    Your email address will not be published.*

    Forgot Password