5

I am looking at the specific block at height 680175.

At the time when the block was not mined yet, I received the block template via bitcoin-cli getblocktemplate '{"rules": ["segwit"]}' with 1451 transactions:

{
    "capabilities": [
        "proposal"
    ],
    "version": 536870912,
    "rules": [
        "csv",
        "!segwit"
    ],
    "vbavailable": {},
    "vbrequired": 0,
    "previousblockhash": "00000000000000000008465bf3145011298dddb04f026e077d8deb5b9ac5cf7f",
    "transactions": [
        {
            "data": "..",
            "txid": "f0fcac28b1dec7b8e67f73229052639c58f7f175bdb87ea068f499a4728bb35d",
            "hash": "2a4aa6c2b5a6bee592e3690a843ee63b2598315da01954c05c4c0aa77d57af34",
            "depends": [],
            "fee": 160000,
            "sigops": 5,
            "weight": 953
        },
        ..,
        {
            "data": "..",
            "txid": "e0ae05fa82edb0dee7e9d11ca9471bf3ee1a90e19ac8abf1013511338613b814",
            "hash": "e0ae05fa82edb0dee7e9d11ca9471bf3ee1a90e19ac8abf1013511338613b814",
            "depends": [],
            "fee": 103950,
            "sigops": 4,
            "weight": 1388
        },
        ..,
        {
            "data": "..",
            "txid": "8d55bd874acea1fbc03b98e82d585c39021be083645dde83e8306171e32258d5",
            "hash": "8d55bd874acea1fbc03b98e82d585c39021be083645dde83e8306171e32258d5",
            "depends": [],
            "fee": 16425,
            "sigops": 8,
            "weight": 904
        }
    ],
    "coinbaseaux": {},
    "coinbasevalue": 745954254,
    "longpollid": "00000000000000000008465bf3145011298dddb04f026e077d8deb5b9ac5cf7f3670",
    "target": "0000000000000000000bef930000000000000000000000000000000000000000",
    "mintime": 1619115663,
    "mutable": [
        "time",
        "transactions",
        "prevblock"
    ],
    "noncerange": "00000000ffffffff",
    "sigoplimit": 80000,
    "sizelimit": 4000000,
    "weightlimit": 4000000,
    "curtime": 1619117253,
    "bits": "170bef93",
    "height": 680175,
    "default_witness_commitment": "6a24aa21a9ed82637c9b63e2165105a672c4f6edcfa0187d961843a8d2b9c7a6bceeda109a65"
}

When comparing the block template to the mined block, there are some differences:

Does anyone know how these differences can be explained?

What would have happened if a miner found a block hash for the received block template and submitted it? Would the mined block then have a different version and the missing transactions (including the transaction that was not even mined yet)?

2 Answers 2

8

The version of the mined block is 0x2fffe000 instead of 536870912.

Many miners employ a strategy known as overt Asicboost. This strategy requires modifying the version number like the nonce, so we often see blocks that have strange version numbers.

Only 194 transactions from the block template are in the mined block, e.g. f0fcac28b1dec7b8e67f73229052639c58f7f175bdb87ea068f499a4728bb35d. The other 1257 transactions are missing.

Each node has a different view of the set of unconfirmed transactions that depends on how long they have been running, where they are located, and any custom rules that they are using. It may be that your node has not been running for as long as the miner's node and so it has not seen all of the same transactions that the miner has seen. It may be that your node is using different rules than the miner is, possibly due to different versions of the same software, or possibly because some miners may be using custom software. Additionally, some miners offer a service where they will prioritize transactions after being paid out of band, so such transactions can end up in a block when they do not appear in a block template produced by your node.

What would have happened if a miner found a block hash for the received block template and submitted it? Would the mined block then have a different version and the missing transactions (including the transaction that was not even mined yet)?

There is no "current template" for the entire network. If there were, then there wouldn't need to be a blockchain as that would mean every node is actually in sync with every other node. As such, when a miner finds a block, they broadcast the block in full. When nodes receive a block, they verify it without creating their own block template. There are no requirements that the block contain the transactions a node expects it to contain. The only requirements are that the block contains valid transactions and that the block header is valid. Whether your node has seen those transactions before and whether it would include them itself are irrelevant.

4
  • Thank you for your answer! So, is it allowed to change the version, even if it is not in the mutable array? .. A transaction that I received in the block template was never mined. What happened to this transaction?
    – Andy
    Commented Apr 24, 2021 at 15:02
  • Ah, good point, I didn't address the funny version business. Have a +1.
    – Murch
    Commented Apr 24, 2021 at 15:03
  • @andy Miners have complete authority over the contents of their blocks. You include a fee in your transactions to incentivize them to include it. If a transaction is not included, it is left in mempools, and thus can be picked up again in later blocks. Commented Apr 24, 2021 at 17:43
  • 1
    @Andy Yes, the version can be changed, within the consensus rule restrictions. As stated previously, there is no requirement for blocks to conform to the block template.
    – Ava Chow
    Commented Apr 24, 2021 at 21:43
4

Going out on a limb here, but I would guess that your node is not running 24/7.

Full nodes only rebroadcast transactions once when they first hear about them. If your node is only online intermittently, it would only hear about new transactions getting submitted to the network. However, each node builds its block templates from the mempool that it locally maintains.

enter image description here via jochen-hoenicke.de

Especially in the past day, where blocks were mostly clearing transactions broadcast much earlier, your node would not be aware of the majority of the transactions mining nodes were tracking in their mempools and including in their blocks. Your node would only learn about most of the transactions as blocks get found and announced.

This is substantiated by your block template only collecting ₿7.45954254 in mining reward, whereas the block you link to collected an additional ₿1.68 in fees for a total reward of ₿9.14729350, i.e. the miner was simply aware of more valuable transactions to include in their block than you.

The version of the mined block is 0x2fffe000 instead of 536870912.

Only a few of the version field bits are constrained. Some miners have been using the remaining field to generate additional entropy, and to employ a mining optimization called Overt ASICBoost. Those uses result in various different values for the version field, which do not impact validity of blocks, though.

2
  • 2
    Thank you for the answer! Yes, my node was not running 24/7. I did the initial sync and then wanted to look at a block template. So, if I would have started mining with the block template that I received, are the chances the same compared to nodes that run 24/7?
    – Andy
    Commented Apr 24, 2021 at 14:58
  • 4
    Your chance to succeed per hash that you try would be the same, but your block reward would be lower as described.
    – Murch
    Commented Apr 24, 2021 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.