Block difficulty

From JaxNetwork Wiki
Jump to navigation Jump to search

Block difficulty is a measure of how difficult it is to complete a Proof-of-Work puzzle of the target block. It's the mathematical expectation of the number of attempts, required before block with a valid hash will be generated. The value of block difficulty could be calculated from parameters of Proof-of-Work puzzle: block target and hash-sorting number.

The value of block difficulty is predefined by the protocol. According to JaxNet protocol, blocks located on the same chain have the same value of difficulty within an epoch between consecutive difficulty adjustments. So difficulty may remain fixed for thousands consecutive blocks on the chain. The predefined difficulty of the next block on the chain is known as a current difficulty of this chain. Beacon chain and every shard chain in Jax.Network has its own current difficulty.

Block difficulty is also called work since it estimates the amount of effort made by miners to mine this block. Another term, used to refer to difficulty, is weight. The sum of block difficulties on the target chain is a chain weight. In the Proof-of-Work consensus, in the event of the fork, the chain with a higher weight is called "the longest chain". According to the longest chain rule, miner should mine on top of the last block of the longest chain.

Ambiguation about difficulty

Relation between difficulty and target

The difficulty of Proof-of-Work puzzle in Jax.Network is determined by two parameters: target and hash-sorting number. Target is recorded into the block header in the compact form called Bits. Hash-sorting number is defined to be equal 10 by the protocol. However, in test networks another value could be set through the modification of the config file.

See also