Mining

如何獲得全額礦工獎勵

  • October 8, 2017

好的,假設我希望獲得塊1000000礦工獎勵:

{
 difficulty: 12549332509227,
 extraData: "0xd783010303844765746887676f312e352e31856c696e7578",
 gasLimit: 3141592,
 gasUsed: 50244,
 hash: "0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e",
 logsBloom: "0x00000000000000000000000000000000000800000000000000000000000800000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000",
 miner: "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
 mixHash: "0x92c4129a0ae2361b452a9edeece55c12eceeab866316195e3d87fc1b005b6645",
 nonce: "0xcd4c55b941cf9015",
 number: 1000000,
 parentHash: "0xb4fbadf8ea452b139718e2700dc1135cfc81145031c84b7ab27cd710394f7b38",
 receiptsRoot: "0x20e3534540caf16378e6e86a2bf1236d9f876d3218fbc03958e6db1c634b2333",
 sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
 size: 768,
 stateRoot: "0x0e066f3c2297a5cb300593052617d1bca5946f0caa0635fdb1b85ac7e5236f34",
 timestamp: 1455404053,
 totalDifficulty: 7135202464334937706,
 transactions: ["0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f", "0xe9e91f1ee4b56c0df2e9f06c2b8c27c6076195a88a7b8537ba8313d80e6f124e"],
 transactionsRoot: "0x65ba887fcb0826f616d01f736c1d2d677bcabde2f7fc25aa91cfbc0b3bad5cb3",
 uncles: []
}

基於這個問題的回答:如何查詢某個區塊的挖礦獎勵金額? 您將添加基本獎勵和使用的氣體: 5 + (50244 gwei I think?)

但是我在 etherscan 中看到的: https ://etherscan.io/block/1000000

5.003614887722 Ether (5 + 0.003614887722 (Tx fees))

我很困惑,我做錯了什麼?

問題是每單位天然氣沒有固定價格。使用了 50,244 種氣體,但僅從標題中無法知道每個使用者為每種氣體支付了多少。

通過web3.eth.getTransaction()和檢查一個區塊中的每一筆交易web3.eth.getTransactionReceipt(),你最終可以弄清楚誰支付了什麼,然後確定最終的礦工獎勵。

正如那個連結的問題所指出的,你還必須加上叔叔的獎勵才能得到最終的總數,但我不知道那個公式。

引用自:https://ethereum.stackexchange.com/questions/28016