Output

為什麼 vout 有時沒有地址?

  • July 10, 2020

我正在嘗試解析所有交易。

我發現有些交易的 vout 中沒有地址。

有兩種情況 vout 沒有地址。

第一個是礦工獎勵。

例如,執行這個:

bitcoin-cli getrawtransaction 4bec1175f9682fc10118bbb146d1def8fd82fdffdf27da8beea327469f79b2b0 true.

結果如下:

{

 "txid": "4bec1175f9682fc10118bbb146d1def8fd82fdffdf27da8beea327469f79b2b0",

 "hash": "4bec1175f9682fc10118bbb146d1def8fd82fdffdf27da8beea327469f79b2b0",

 "version": 1,

 "size": 135,

 "vsize": 135,

 "weight": 540,

 "locktime": 0,

 "vin": [

   {

     "coinbase": "048521131a028d00",

     "sequence": 4294967295

   }

 ],

 "vout": [

   {

     "value": 50.25892368,

     "n": 0,

     "scriptPubKey": {

       "asm": "04994b2548a865ad7e786c691bb9cac7d15afc60b8b4500e24e79ec1cd910830b7dd799defdfdc1a7136e4976d2086daa319a7923f633987905a86aaece612ab9b OP_CHECKSIG",

       "hex": "4104994b2548a865ad7e786c691bb9cac7d15afc60b8b4500e24e79ec1cd910830b7dd799defdfdc1a7136e4976d2086daa319a7923f633987905a86aaece612ab9bac",

       "type": "pubkey"

     }

   }

 ],

 "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff08048521131a028d00ffffffff011008912b01000000434104994b2548a865ad7e786c691bb9cac7d15afc60b8b4500e24e79ec1cd910830b7dd799defdfdc1a7136e4976d2086daa319a7923f633987905a86aaece612ab9bac00000000",

 "blockhash": "00000000000009e63c0dc84756b1f535b0c8d7c51b849e60b6ce893a9c6a4d51",

 "confirmations": 506698,

 "time": 1308295622,

 "blocktime": 1308295622

}

您可以看到在 vout 的第一個也是唯一的對像中沒有地址欄位。

第二個不是礦工獎勵。

例如,執行這個:

bitcoin-cli getrawtransaction 4caea993e7caa859840a8ebac457c31420bb4fb79b528d870556c5a2eec5da7a true.

結果如下:

{

 "txid": "4caea993e7caa859840a8ebac457c31420bb4fb79b528d870556c5a2eec5da7a",

 "hash": "4caea993e7caa859840a8ebac457c31420bb4fb79b528d870556c5a2eec5da7a",

 "version": 1,

 "size": 234,

 "vsize": 234,

 "weight": 936,

 "locktime": 0,

 "vin": [

   {

     "txid": "c245fbf8c03de1ab3372f72cafbd40ef47882fc0aba02c424e70cb4b44c65241",

     "vout": 0,

     "scriptSig": {

       "asm": "304502200eee831084af8de8ebac477d3c56b5a4d428522df0ccaed41ede77570eac27a5022100af5786d35cdef15a97a775542217a7e9ee85b06d4f07c50bab768bce189e3d9e[ALL]",

       "hex": "48304502200eee831084af8de8ebac477d3c56b5a4d428522df0ccaed41ede77570eac27a5022100af5786d35cdef15a97a775542217a7e9ee85b06d4f07c50bab768bce189e3d9e01"

     },

     "sequence": 4294967295

   }

 ],

 "vout": [

   {

     "value": 115.00000000,

     "n": 0,

     "scriptPubKey": {

       "asm": "OP_DUP OP_HASH160 208bbec311f62e7881ee746d7f3a6ba097203815 OP_EQUALVERIFY OP_CHECKSIG",

       "hex": "76a914208bbec311f62e7881ee746d7f3a6ba09720381588ac",

       "reqSigs": 1,

       "type": "pubkeyhash",

       "addresses": [

         "13y62oZbRtF4SJx2sezC3PvvDBfXx42jJb"

       ]

     }

   },

   {

     "value": 2.00000000,

     "n": 1,

     "scriptPubKey": {

       "asm": "0405d71f20e493a0721e705944e7151a1d7c1b9a9cd546cc44c2f348fa6e27b588ddfdd7b3e52c9af208598f3b2ac519af9d7ee78cea4f237ee5028020e33633c9 OP_CHECKSIG",

       "hex": "410405d71f20e493a0721e705944e7151a1d7c1b9a9cd546cc44c2f348fa6e27b588ddfdd7b3e52c9af208598f3b2ac519af9d7ee78cea4f237ee5028020e33633c9ac",

       "type": "pubkey"

     }

   }

 ],

 "hex": "01000000014152c6444bcb704e422ca0abc02f8847ef40bdaf2cf77233abe13dc0f8fb45c2000000004948304502200eee831084af8de8ebac477d3c56b5a4d428522df0ccaed41ede77570eac27a5022100af5786d35cdef15a97a775542217a7e9ee85b06d4f07c50bab768bce189e3d9e01ffffffff02001374ad020000001976a914208bbec311f62e7881ee746d7f3a6ba09720381588ac00c2eb0b0000000043410405d71f20e493a0721e705944e7151a1d7c1b9a9cd546cc44c2f348fa6e27b588ddfdd7b3e52c9af208598f3b2ac519af9d7ee78cea4f237ee5028020e33633c9ac00000000",

 "blockhash": "000000000000098444048edc683a41d26be975e302019a51a7ca3c2cc21d4813",

 "confirmations": 506676,

 "time": 1308309497,

 "blocktime": 1308309497

}

您可以看到 vout 的第二個對像中沒有地址欄位。

請解釋一下或提供一些關鍵字供我搜尋!謝謝你們!

地址是一種便利功能,旨在使人類更容易使用比特幣——比特幣協議本身對地址一無所知。

所有輸出實際上都發送到用比特幣腳本語言編寫的程序。這些程序可以採取任何形式。

我們已經定義了某些可以編碼為地址的程序 - 即 pay-to-public-key-hash、pay-to-script-hash、pay-to-witness-public-key-hash 和 pay-to-witness -腳本雜湊。

到任何其他程序的輸出都不能編碼為地址 - 在您的範例中,該程序被稱為 Pay to Public Key 輸出,它將硬幣直接鎖定到公共密鑰,而不是將它們鎖定到更常用的公共密鑰密鑰雜湊(p2pkh 地址,從 1 開始)。

輸出仍然可以使用。

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