Skip to main content

difficulty_from_bits

Function difficulty_from_bits 

Source
pub fn difficulty_from_bits(bits: u64) -> Result<f64, ConsensusError>
Expand description

Spec-locked to Orange Paper Section 7.1: DifficultyFromBits

Function ‘DifficultyFromBits’ referenced but not yet in spec section 7.1 (Migration mode). Available: ExpandTarget, GetNextWorkRequired Convert compact target bits to human-readable difficulty (MAX_TARGET / target).

Used by getblockchaininfo, getmininginfo RPC for display. Formula: difficulty = MAX_TARGET / target where MAX_TARGET = 0x00000000FFFF0000000000000000000000000000000000000000000000000000 (genesis).