Transactions

關於解釋 blockchain.info API 返回的問題

  • April 17, 2022

例如,當查看此輸出時,對於塊中第一筆交易中的“輸入”條目(即始終由新生成的硬幣組成): "inputs":[{"sequence":4294967295,"witness":"01200000000000000000000000000000000000000000000000000000000000000000","script":"03046a0a046b03966062696e616e63652f626afabe6d6d5eab0f9044182c948a6cc6c4cfcc4c8df66f5839f34cbf36afff532d3eb0188e020000001e34c5f04e198bb203b9000000000000","index":0,"prev_out":{"tx_index":0,"value":0,"n":4294967295,"type":0,"spent":true,"script":"","spending_outpoints":[{"tx_index":6620159290300855,"n":0}]}}]

我想知道它是什麼意思"value":0,"n":4294967295。我試圖頁面中查找數字 4294967295,但一無所獲。另外我懷疑“value”和“n”的值似乎是相反的。

這是使用 Blockstream.info API 的相同交易,顯示的是 Coinbase Tx,在我看來比 blockchain.info 更清晰的輸出。根據比特幣 Wiki,序列號通常設置為 0xFFFFFFFF(十進制:4294967295),除非交易的 lock_time > 0。

{
 "txid": "e296d83b0442854cb58b709f2a231e3ba7e5530e506937f844b9cdd696ff27bc",
 "version": 2,
 "locktime": 0,
 "vin": [
   {
     "txid": "0000000000000000000000000000000000000000000000000000000000000000",
     "vout": 4294967295,
     "prevout": null,
     "scriptsig": "03046a0a046b03966062696e616e63652f626afabe6d6d5eab0f9044182c948a6cc6c4cfcc4c8df66f5839f34cbf36afff532d3eb0188e020000001e34c5f04e198bb203b9000000000000",
     "scriptsig_asm": "OP_PUSHBYTES_3 046a0a OP_PUSHBYTES_4 6b039660 OP_VER OP_VERIFY OP_2DUP OP_NOP OP_2DUP OP_IF OP_VERIF OP_PUSHBYTES_47 626afabe6d6d5eab0f9044182c948a6cc6c4cfcc4c8df66f5839f34cbf36afff532d3eb0188e020000001e34c5f04e OP_PUSHBYTES_25 <push past end>",
     "witness": [
       "0000000000000000000000000000000000000000000000000000000000000000"
     ],
     "is_coinbase": true,
     "sequence": 4294967295
   }
 ],
 "vout": [
   {
     "scriptpubkey": "00143156afc4249915008020f932783319f3e610b97d",
     "scriptpubkey_asm": "OP_0 OP_PUSHBYTES_20 3156afc4249915008020f932783319f3e610b97d",
     "scriptpubkey_type": "v0_p2wpkh",
     "scriptpubkey_address": "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4",
     "value": 679603284
   },
   {
     "scriptpubkey": "6a24aa21a9edc420b0f8e1264754b5baad9d6424a519a2e12941fecd869747590b577f87b3a3",
     "scriptpubkey_asm": "OP_RETURN OP_PUSHBYTES_36 aa21a9edc420b0f8e1264754b5baad9d6424a519a2e12941fecd869747590b577f87b3a3",
     "scriptpubkey_type": "op_return",
     "value": 0
   }
 ],
 "size": 240,
 "weight": 852,
 "fee": 0,
 "status": {
   "confirmed": true,
   "block_height": 682500,
   "block_hash": "00000000000000000007e70fe4af876da9444d3ae9c3283ef859fc1d0cdf9417",
   "block_time": 1620444011
 }
}

引用自:https://bitcoin.stackexchange.com/questions/113339