Bitcoin-Core

Chainparams.cpp 中的這條評論是什麼意思?

  • July 23, 2018

比特幣原始碼下面有註釋src/chainparams.cpp

`/**

  • Build the genesis block. Note that the output of its generation
  • transaction cannot be spent since it did not originally exist in the
  • database.
  • CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
  • CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
  • CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
  • CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
  • vMerkleTree: 4a5e1e */`

這個值到底指的是什麼?

coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73

最初的 50 BTC 幣庫不可使用,因為它不包含在 UTXO 集中。任何試圖花費它的交易都是無效的,因為之前來自 coinbase tx 的輸出在 utxo 集中不存在。

十六進製字元串是 的編碼The Times 03/Jan/2009 Chancellor on brink of second bailout for banks,以及正常的 coinbase 參數。它本質上是一個標記,通過包含當天論文的標題來證明該鏈在 2009 年 3 月 1 日之前沒有被預挖。

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