Transaction-Input

如何解釋比特幣交易的 vin/vout?

  • July 5, 2022

我使用 nownodes api 在事務中獲取此響應:

(
   [txid] => 38ac1348219f8aa9349f497bfa6f8d05f775cafbbd26354867d22ca84f15e1e1
   [version] => 2
   [vin] => Array
       (
           [0] => stdClass Object
               (
                   [txid] => 38cff250be850140644a1abf022b22f3e59cab15c6091706c3f73218a4d72050
                   [vout] => 1
                   [sequence] => 4294967295
                   [n] => 0
                   [addresses] => Array
                       (
                           [0] => 1EJtMFThodiQ1j26xy1kugFck9325C38CQ
                       )

                   [isAddress] => 1
                   [value] => 158316
                   [hex] => 4830450221009548f997389fd9881dfed78fe25fcce77f5b96d1545da91dfa13f56db3c02f6e02207fe239ac7916681edc36afd6a9a569981cd12c2c6801616bc15794be5c024431012102afe2e887e3ff56edcebe6b1aa6bf48f4a5a7f02cfc8d743e778896df2054adee
               )

       )

   [vout] => Array
       (
           [0] => stdClass Object
               (
                   [value] => 7000
                   [n] => 0
                   [hex] => a9144a09be6e2917ef00e5d72bc38035db5c5a5ed8ec87
                   [addresses] => Array
                       (
                           [0] => 38SVbkkFE8qcJuGyTJ9fY2cbGS3xknEfYr
                       )

                   [isAddress] => 1
               )

           [1] => stdClass Object
               (
                   [value] => 146856
                   [n] => 1
                   [hex] => 76a91491fb9214e6ad9b3ea19c1fd7d3a646e12f804d2688ac
                   [addresses] => Array
                       (
                           [0] => 1EJtMFThodiQ1j26xy1kugFck9325C38CQ
                       )

                   [isAddress] => 1
               )

       )

   [blockHash] => 000000000000000000050bfb2a645a5eb7ac882aeb1782bce37ef6a2652c383b
   [blockHeight] => 743696
   [confirmations] => 8
   [blockTime] => 1657005608
   [value] => 153856
   [valueIn] => 158316
   [fees] => 4460
   [hex] => 02000000015020d7a41832f7c3061709c615ab9ce5f3222b02bf1a4a64400185be50f2cf38010000006b4830450221009548f997389fd9881dfed78fe25fcce77f5b96d1545da91dfa13f56db3c02f6e02207fe239ac7916681edc36afd6a9a569981cd12c2c6801616bc15794be5c024431012102afe2e887e3ff56edcebe6b1aa6bf48f4a5a7f02cfc8d743e778896df2054adeeffffffff02581b00000000000017a9144a09be6e2917ef00e5d72bc38035db5c5a5ed8ec87a83d0200000000001976a91491fb9214e6ad9b3ea19c1fd7d3a646e12f804d2688ac00000000
)
  1. 交易金額:0.0001146 BTC
  2. 費用為:0.0000446
  3. 總計:0.0001592

但是,根據 Nownodes 的結果,我如何查看交易總額?我可以很容易地在“費用”下看到費用。但是我如何計算這筆交易的實際進出金額?

謝謝!

但是我如何計算這筆交易的實際進出金額?

從發件人錢包中流出的 Satoshis[vin][value]金額是該交易中金額的總和。

進入收件人錢包的金額是[vout][value]金額的總和

這兩個總數之間的差額是作為採礦費支付的金額。

很可能輸出之一是將更改返回給發件人。因此,發送者“餘額”的總減少是[vin][value]減去 1 的總和[vout][value]

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