8

What are Height and Difficulty properties of Monero's blockchain?

8

Height is the current block a transaction is contained in (or sometimes also represents the highest block of the blockchain). The blockchain consists of "blocks" of grouped transactions. They are linked AKA "chained" to the last updated block every X minute interval. For Bitcoin it is 10 minutes, for Monero it is 2 minutes. When a new block is created, it is transmitted to every node in the network so that everyone can keep track of the possession of coins in the network.

Difficulty is a numerical representation of how long on average it will take to create a valid block that satisfies the Proof-of-Work algorithm being used, it does not represent minutes or time per se. but instead is an integer number that makes the PoW calculation take longer to perform, this is adjusted by the nodes and miners so that on average it ensures the network creates blocks at a generally consistent rate. This is calculated among all the nodes and miners in accordance with the globally agreed rules in the network, AKA consensus rules. Miners that do not include this number in their difficulty calculations will not have their block validated and included by the rest of the network.

3

In addition to the excellent explanation of difficulty and height by @ferretinjapan, there is something more I'd like to add to this question: the cumulative difficulty, because it is directly linked to height and difficulty.

Find the greatest cumulative difficulty and you will have found the one truth, the master said.

Since the block height gives you a numeric reference of the most recent block mined, it does not necessarily give you an indicator for the longest chain, or in case of a dispute: it does not allow you to determine the winning chain. In case there are miner collusions, i.e., two miners find the same block (ommer, orphan, uncle, etc.) the height on both such blocks is the same. In case two competing chains raise from any kind of fork, clients have to measure which chain to stick with.

This is what the greatest cumulative difficulty stands for. Sum up the difficulty for each block and calculate the longest chain by that metric... and you will have found the one truth. ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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