8 votes
Accepted

Why does the mined block differ so much from the block template?

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 ...
Ava Chow's user avatar
  • 70.5k
5 votes
Accepted

How does getblocktemplate select transactions?

The whole mempool won't fit in a block; getblocktemplate returns enough transactions for a block. Blocks are, by default, limited to 750kb by policy, but many miners increase the size to the block ...
fluffyponyza's user avatar
4 votes

How to call `getblocktemplate` without running a full node?

To create a valid bitcoin block, you will need a view of the current network state. Otherwise how will you know what the previous valid block was, or what transactions are valid and worthy of being ...
chytrik's user avatar
  • 18.3k
4 votes

Why does the mined block differ so much from the block template?

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 ...
Murch's user avatar
  • 75.4k
4 votes
Accepted

Why does getblocktemplate use priority for transaction selection?

Getblocktemplate builds a block based on configuration parameters. In recent versions, the default is to use fee per byte as criterion for the entire block. History In versions of Bitcoin up to 0.6, ...
Pieter Wuille's user avatar
4 votes
Accepted

Why is the block header version value different from the getblocktemplate version value in the bitcoin blockchain?

There is no requirement that a miner must follow the block template. They can construct their own blocks as they see fit, so long as their block follows the consensus rules. There cannot be a ...
Ava Chow's user avatar
  • 70.5k
3 votes
Accepted

What criteria does Bitcoin Core use to create block templates?

As of Bitcoin Core v26.1, the mempool tracks each transaction in the context of its ancestor set and prioritizes their inclusion on basis of their ancestor set feerate. Let’s assume a cluster of five ...
Murch's user avatar
  • 75.4k
3 votes
Accepted

Is the sum of sigops in the transaction details returned by getBlockTemplate not allowed to exceed 2000?

TL;DR: you don't need to multiply anything. 20037 ≤ 80000 is the correct comparison, so the returned values represent a valid block. The confusion arises because there used to be "old sigops"...
Pieter Wuille's user avatar
3 votes
Accepted

Constructing a block template to avoid mining "empty" blocks

A mining pool may provide an empty block template to its miners for block n+1 once it has been announced a valid header for block n but hasn't received yet the whole block n. This is also known as SPV ...
Antoine Poinsot's user avatar
3 votes
Accepted

Where does this pattern in the feerate distribution per block originate from?

1) Is this known behavior of an algorithm that creates block templates? Yes. This is behavior that is present in Bitcoin Core. Bitcoin Core bundles transactions into "packages" of one or more ...
Ava Chow's user avatar
  • 70.5k
3 votes

How does bitcoin reward who find the block?

A miner will create a special type of transaction known as a Coinbase transaction, as the first transaction in the block. This special transaction pays the block reward (including transaction fees) to ...
meshcollider's user avatar
  • 11.8k
2 votes

How i can delete last block from blockchain? altcoin

You can't delete a block, just mine a new block on top of the previous block, creating a fork. Just reference the parent block as the parent of your new block, and if you mine more on top of your new ...
meshcollider's user avatar
  • 11.8k
2 votes
Accepted

getblocktemplate fails in regtest mode even when it is connected to the other node

You need to mine a block so that the software thinks that the blockchain is fully synced. The most recent block in the regtest blockchain is probably old so you just need to mine one more block to ...
Ava Chow's user avatar
  • 70.5k
2 votes

Where does this pattern in the feerate distribution per block originate from?

As Andrew Chow pointed out, my feerate calculations were wrong. I used the totalSize of the transaction. Correct would have been to use the virtualSize. With correct calculations the visualization ...
0xb10c's user avatar
  • 1,430
2 votes
Accepted

Block version 0x20000000

The bytes you would put in the block header would be, in order: 0x00 0x00 0x00 0x20. That's how the number 221 (= 0x20000000) is stored in 32-bit little endian encoding. Note that this is actually a ...
Pieter Wuille's user avatar
2 votes
Accepted

reconstruct block template from stratum mining.notify

If there is only one output address, we can guess here that the reward is the 8 bytes before the 1976, No, you cannot. the 1976 is the start of the output script and can/will be different depending ...
Ava Chow's user avatar
  • 70.5k
2 votes
Accepted

What exactly is the data required when creating a coinbase transaction? How do I insert the blocks height into the coinbase transaction?

The requirement of encoding the block height in the coinbase transaction is specified in BIP34. You may want to read the actual documentation there. Specifically, it requires the scriptSig of the ...
Pieter Wuille's user avatar
2 votes
Accepted

Can Bitcoin Core 0.9.5 still fully sync?

Yes, 0.9.5 is consensus compatible with modern Bitcoin, though it will be considerably slower than modern versions, and probably shouldn't be used for anything that's transacting real money.
Claris's user avatar
  • 15.4k
2 votes

Keep getting high-hash error from bitcoind

I tried to make sense of the data you submitted: ...
RedGrittyBrick's user avatar
2 votes
Accepted

Mined blocks with reserved space for old utxos

Ok. I've found this: https://www.linkedin.com/pulse/what-high-priority-transaction-tara-annison, check out the comments since they have useful links. It seems 50kb of block space was reserved for high ...
dev7ba's user avatar
  • 373
1 vote
Accepted

Miners setting timestamps up to 2h into the Future

Yes, the network would accept blocks that are dated up to 2h into the future. If close to or more than half the hashrate generally dated blocks two hours into the future, miners using an accurate ...
Murch's user avatar
  • 75.4k
1 vote

MerkleRoot requires transaction hash to build a merkle tree.... Is that the "hash" key/value within the getblocktemplate response or the "data"?

The transaction Merkle tree, whose root is stored in the block header, is computed over the individual transactions' txid value (which are the double-SHA256 of their data after stripping the witness). ...
Pieter Wuille's user avatar
1 vote
Accepted

How to get unconfirmed transactions

How to get unconfirmed transactions [...] To be notified of new unconfirmed transactions, to retrieve them and to make other nodes aware of blocks you have mined you will need to implement the ...
RedGrittyBrick's user avatar
1 vote

getblocktemplate request that omits transactions?

getmininginfo or getdifficulty are useless as they return the difficulty of the most recently mined block, not the block that is currently being mined. The network difficulty is adjusted every 2016 ...
chytrik's user avatar
  • 18.3k
1 vote

Building the merkle root from transactions in a template block

I'm much closer now I hope this helps someone else trying to do this! REQUIREMENTS: NPM bitcoin bitcoin-js merkle-lib CODE: client.getBlockTemplate( function(error, template) { if (error) ...
Corbin's user avatar
  • 275
1 vote
Accepted

bitcoin fork getblocktemplate keeps reporting downloading blocks

Because block 506016 happened ~1 week ago, when you start your node software, it thinks that it is still in the initial block syncing phase because the timestamps are off of real time by a lot. The ...
Ava Chow's user avatar
  • 70.5k

Only top scored, non community-wiki answers of a minimum length are eligible