How are the requirements of the hash for mining a new block determined?

0

How are the requirements of the hash for mining a new block determined? Is it published or a message is sent?

user99550

Posted 2019-09-20T18:43:04.753

Reputation: 1

I think this reference is a good reading for undestend the mining

vincenzopalazzo 2019-09-23T12:48:58.043

Answers

1

The difficulty calculation is part of the consensus rules that nodes on the network follow. It can be calculated at any time by a node and is calculated every 2016 blocks (two weeks, on average). When the correct number of blocks has passed, the node calculates it based on the last two weeks and adjusts in order to maintain a 10 minute block time (on average). The calculation is in CalculateNextWorkRequired.

Miners can request a block template from a node, in order to start mining, which contains the hash target (i.e. difficulty), see getblocktemplate.

JBaczuk

Posted 2019-09-20T18:43:04.753

Reputation: 6 172