如何创建比特币、coinbase交易?

我知道

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

它的给予

20000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff018036be260000000017a914583daf881525ddfcb891e1ab715a2a790b62f03c8700000000

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"
        ]
      }
    }
  ]
}

 

我看到了基本价值

"coinbase": "0300f60941d7e1f2e7560aff41d7e1f2e755ef2a2f45324d2026204254432e544f502ffabe6d6d1c3eb14eb586c97d05cb6333184280d0d86e081a6ccc1cbbc0367888f2368b2b8000000000000000e7000a064122000000000000",

 

这是什么?如何创建工作coinsbase tx什么可以放在块和它将是正确的挖掘,所有如果发现有没有不正确的信息和链接到过期维基。任何解决方案创建的tx都没有此字段,因此它们无效。
问题是没有关于如何将coinbase添加到coinbase tx的信息。
也许有些地方存在一些python脚本coinbase tx能做什么?看看它是如何创建tx的。
比特币核心区块链挖掘理论coinbase transaction createrawtransaction
分享
改进这个问题
跟随
10月15日18:06编辑
10月15日16:16被问到
t系列
17511银牌1212铜牌
添加评论
1个答案
最活跃的投票
0
coinbase事务是一种特殊事务,必须满足以下条件:
只有1个输入
输入使用0x0000000000000000000000000000作为其txid,0xffffff作为其索引(vout)
此输入的签名脚本的长度必须介于2和100之间(2<=length<=100)
BIP-34激活后的任何块(高度>=227931)必须使用严格的推送长度在签名脚本的开头推送块高度。(脚本的其余部分将被忽略。)
与任何其他事务一样,它必须至少有一个输出
如果该块包含任何具有见证的事务,则coinbase tx必须具有*一个包含32字节见证承诺的单个见证(对应于其单个输入)和一个包含计算的见证merkle根哈希的输出,该输出以opu Return开始,后跟0x24aa21a9ed,并且至少总共38字节
产出金额之和必须小于或等于区块奖励+费用之和
*如果没有目击证人,这是可选的(所以在街区内)

sskoo.com (3)

发表评论

邮箱地址不会被公开。 必填项已用*标注